// SetAssociations sets the Associations field's value.
506900
func (s *ListAssociationsOutput) SetAssociations(v []*Association) *ListAssociationsOutput {
	s.Associations = v
	return s
}
315438
func (s *InstanceAssociation) SetAssociationVersion(v string) *InstanceAssociation {
	s.AssociationVersion = &v
	return s
}
1068348
func MergeAssociations(associations []IdentityAssociation, merge []IdentityAssociation) []IdentityAssociation {
	for _, merging := range merge {
		found := false
		for i, assoc := range associations {
			// there is a match if the record to be merged has the same ResourceID (there must always be a resource)
			if assoc.ResourceID == merging.ResourceID {
				found = true

				if !assoc.Member {
					assoc.Member = merging.Member
				}

				if assoc.IdentityID == nil && merging.IdentityID != nil {
					assoc.IdentityID = merging.IdentityID
				}

				for _, roleToMerge := range merging.Roles {
					roleFound := false

					for _, assocRole := range assoc.Roles {
						if assocRole == roleToMerge {
							roleFound = true
							break
						}
					}

					if !roleFound {
						assoc.Roles = append(assoc.Roles, roleToMerge)
					}
				}

				associations[i] = assoc
			}
		}

		if !found {
			associations = append(associations, merging)
		}
	}

	return associations
}
657567
func (s *InstanceAssociation) SetAssociationId(v string) *InstanceAssociation {
	s.AssociationId = &v
	return s
}
468863
func (s *SnapshotSchedule) SetAssociatedClusters(v []*ClusterAssociatedToSchedule) *SnapshotSchedule {
	s.AssociatedClusters = v
	return s
}
971643
func (s *Connector) SetAssociatedOn(v time.Time) *Connector {
	s.AssociatedOn = &v
	return s
}
76513
func (s *CacheBehavior) SetLambdaFunctionAssociations(v *LambdaFunctionAssociations) *CacheBehavior {
	s.LambdaFunctionAssociations = v
	return s
}
757040
func (s *InstanceAssociationStatusInfo) SetAssociationName(v string) *InstanceAssociationStatusInfo {
	s.AssociationName = &v
	return s
}
664155
func (s *BatchAssociateUserStackInput) SetUserStackAssociations(v []*UserStackAssociation) *BatchAssociateUserStackInput {
	s.UserStackAssociations = v
	return s
}
917814
func (s *ListAssociationsInput) SetAssociationFilterList(v []*AssociationFilter) *ListAssociationsInput {
	s.AssociationFilterList = v
	return s
}
532031
func (s *DescribeAssociationExecutionTargetsInput) SetAssociationId(v string) *DescribeAssociationExecutionTargetsInput {
	s.AssociationId = &v
	return s
}
512243
func (s *AssociationExecutionTarget) SetAssociationId(v string) *AssociationExecutionTarget {
	s.AssociationId = &v
	return s
}
18202
func (s *AssociateNodeOutput) SetNodeAssociationStatusToken(v string) *AssociateNodeOutput {
	s.NodeAssociationStatusToken = &v
	return s
}
1226180
func (s *ListDomainAssociationsOutput) SetDomainAssociations(v []*DomainAssociation) *ListDomainAssociationsOutput {
	s.DomainAssociations = v
	return s
}
323448
func (s *ContainerInstance) SetAttachments(v []*Attachment) *ContainerInstance {
	s.Attachments = v
	return s
}
1328318
func (s *DisassociateS3ResourcesInput) SetAssociatedS3Resources(v []*S3Resource) *DisassociateS3ResourcesInput {
	s.AssociatedS3Resources = v
	return s
}
243128
func (s *DescribeAssociationExecutionsOutput) SetAssociationExecutions(v []*AssociationExecution) *DescribeAssociationExecutionsOutput {
	s.AssociationExecutions = v
	return s
}