// AppendAssociation appends the association state specified by the parameter values to an existing IdentityAssociation array
555810
func AppendAssociation(associations []IdentityAssociation, resourceID string, resourceName *string, parentResourceID *string,
	identityID *uuid.UUID, member bool, role *string) []IdentityAssociation {
	found := false
	for i, assoc := range associations {
		if assoc.ResourceID == resourceID {
			found = true

			if assoc.IdentityID == nil && identityID != nil {
				id := *identityID
				assoc.IdentityID = &id
			}

			if assoc.ParentResourceID == nil && parentResourceID != nil {
				prID := *parentResourceID
				assoc.ParentResourceID = &prID
			}

			if !assoc.Member && member {
				assoc.Member = true
			}

			if role != nil {
				roleFound := false
				for _, r := range assoc.Roles {
					if r == *role {
						roleFound = true
						break
					}
				}

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

			associations[i] = assoc
			break
		}
	}

	if !found {
		roles := []string{}
		if role != nil {
			roles = append(roles, *role)
		}
		var id *uuid.UUID
		if identityID != nil {
			value := *identityID
			id = &value
		}
		var prID *string
		if parentResourceID != nil {
			value := *parentResourceID
			prID = &value
		}

		associations = append(associations, IdentityAssociation{
			ResourceID:       resourceID,
			ResourceName:     *resourceName,
			ParentResourceID: prID,
			IdentityID:       id,
			Member:           member,
			Roles:            roles,
		})
	}

	return associations
}
758778
func (s *ResourceShareAssociation) SetAssociationType(v string) *ResourceShareAssociation {
	s.AssociationType = &v
	return s
}
72494
func (c *Client) Append(key, val string, ocas uint64) (cas uint64, err error) {
	// Variants: [R] Append [Q]
	// Request : MUST key, value; MUST NOT extras
	// Response: MUST NOT key, value, extras
	m := &msg{
		header: header{
			Op:  opAppend,
			CAS: ocas,
		},
		key: key,
		val: val,
	}

	err = c.perform(m)
	return m.CAS, err
}
383652
func (s *AssociationDescription) SetAssociationId(v string) *AssociationDescription {
	s.AssociationId = &v
	return s
}
232742
func (s *ListAssociationVersionsOutput) SetAssociationVersions(v []*AssociationVersionInfo) *ListAssociationVersionsOutput {
	s.AssociationVersions = v
	return s
}
122764
func (s *ListMembersInput) SetOnlyAssociated(v string) *ListMembersInput {
	s.OnlyAssociated = &v
	return s
}
1050379
func (s *DescribeEffectiveInstanceAssociationsOutput) SetAssociations(v []*InstanceAssociation) *DescribeEffectiveInstanceAssociationsOutput {
	s.Associations = v
	return s
}
345997
func (s *Association) SetAssociationVersion(v string) *Association {
	s.AssociationVersion = &v
	return s
}
125243
func (c *CtxDimensions) Append(ctx context.Context, vals ...interface{}) context.Context {
	if len(vals) == 0 {
		return ctx
	}
	if len(vals)%2 != 0 {
		panic("Expected even number of values")
	}
	existing := c.From(ctx)
	newArr := make([]interface{}, 0, len(existing)+len(vals))
	newArr = append(newArr, existing...)
	newArr = append(newArr, vals...)
	return context.WithValue(ctx, c, newArr)
}
433211
func (s *AssociationDescription) SetAssociationVersion(v string) *AssociationDescription {
	s.AssociationVersion = &v
	return s
}
568379
func (s *DeleteAssociationInput) SetAssociationId(v string) *DeleteAssociationInput {
	s.AssociationId = &v
	return s
}
1187417
func (s *UCSService) NewAssociateUcsProfileToBladeParams(bladeid string, profiledn string, ucsmanagerid string) *AssociateUcsProfileToBladeParams {
	p := &AssociateUcsProfileToBladeParams{}
	p.p = make(map[string]interface{})
	p.p["bladeid"] = bladeid
	p.p["profiledn"] = profiledn
	p.p["ucsmanagerid"] = ucsmanagerid
	return p
}
315438
func (s *InstanceAssociation) SetAssociationVersion(v string) *InstanceAssociation {
	s.AssociationVersion = &v
	return s
}
35400
func (s *GatewayAssociation) SetAssociationId(v string) *GatewayAssociation {
	s.AssociationId = &v
	return s
}
631566
func (c *RollingCounter) Append(o *RollingCounter) error {
	c.Inc(int(o.Count()))
	return nil
}
251348
func (ldr *AEBackupInformationListLoader) Append(v interface{}) error {
	if entity, ok := v.(*AEBackupInformation); ok {
		ldr.List = append(ldr.List, entity)
	} else {
		return fmt.Errorf("v is not *AEBackupInformation, actual: %#v", v)
	}

	return nil
}
460061
func (s *Server) SetAssociatePublicIpAddress(v bool) *Server {
	s.AssociatePublicIpAddress = &v
	return s
}