// setTags is a helper to set the tags for a resource. It expects the
// tags field to be named "tags"
979150
func setTagsDocDB(conn *docdb.DocDB, d *schema.ResourceData) error {
	if d.HasChange("tags") {
		oraw, nraw := d.GetChange("tags")
		o := oraw.(map[string]interface{})
		n := nraw.(map[string]interface{})
		create, remove := diffTagsDocDB(tagsFromMapDocDB(o), tagsFromMapDocDB(n))

		// Set tags
		if len(remove) > 0 {
			log.Printf("[DEBUG] Removing tags: %#v", remove)
			k := make([]*string, len(remove))
			for i, t := range remove {
				k[i] = t.Key
			}

			_, err := conn.RemoveTagsFromResource(&docdb.RemoveTagsFromResourceInput{
				ResourceName: aws.String(d.Get("arn").(string)),
				TagKeys:      k,
			})
			if err != nil {
				return err
			}
		}
		if len(create) > 0 {
			log.Printf("[DEBUG] Creating tags: %#v", create)
			_, err := conn.AddTagsToResource(&docdb.AddTagsToResourceInput{
				ResourceName: aws.String(d.Get("arn").(string)),
				Tags:         create,
			})
			if err != nil {
				return err
			}
		}
	}

	return nil
}
690192
func (s *DescribeChannelOutput) SetTags(v map[string]*string) *DescribeChannelOutput {
	s.Tags = v
	return s
}
548192
func (s *CreateApplicationRequest) SetTags(v map[string]*string) *CreateApplicationRequest {
	s.Tags = v
	return s
}
801697
func (s *CreateResourceDefinitionInput) SetTags(v map[string]*string) *CreateResourceDefinitionInput {
	s.Tags = v
	return s
}
621672
func (s *DescribeReservationOutput) SetTags(v map[string]*string) *DescribeReservationOutput {
	s.Tags = v
	return s
}
931026
func (s *DescribeFleetOutput) SetTags(v map[string]*string) *DescribeFleetOutput {
	s.Tags = v
	return s
}
253426
func (s *AffectedEntity) SetTags(v map[string]*string) *AffectedEntity {
	s.Tags = v
	return s
}
602525
func (s *ListCrawlersInput) SetTags(v map[string]*string) *ListCrawlersInput {
	s.Tags = v
	return s
}
477794
func (s *ComputeResource) SetTags(v map[string]*string) *ComputeResource {
	s.Tags = v
	return s
}
1175178
func (s *MetricsAndOperator) SetTags(v []*Tag) *MetricsAndOperator {
	s.Tags = v
	return s
}
1058362
func (s *ResourceTag) SetTags(v []*Tag) *ResourceTag {
	s.Tags = v
	return s
}
464458
func (s *DocumentDescription) SetTags(v []*Tag) *DocumentDescription {
	s.Tags = v
	return s
}
73864
func (s *StartChannelOutput) SetTags(v map[string]*string) *StartChannelOutput {
	s.Tags = v
	return s
}
887027
func (s *CreateStageInput) SetTags(v map[string]*string) *CreateStageInput {
	s.Tags = v
	return s
}
2232
func (s *WorkspaceRequest) SetTags(v []*Tag) *WorkspaceRequest {
	s.Tags = v
	return s
}
200217
func (s *User) SetTags(v []*Tag) *User {
	s.Tags = v
	return s
}
1172726
func (s *CreateJobInput) SetTags(v map[string]*string) *CreateJobInput {
	s.Tags = v
	return s
}