// SetToManyReferenceIDs sets the sweets reference IDs and satisfies the jsonapi.UnmarshalToManyRelations interface
1146
func (u *User) SetToManyReferenceIDs(name string, IDs []string) error {
	if name == "sweets" {
		u.ChocolatesIDs = IDs
		return nil
	}

	return errors.New("There is no to-many relationship with the name " + name)
}
505898
func (s *CreateDBSubnetGroupInput) SetSubnetIds(v []*string) *CreateDBSubnetGroupInput {
	s.SubnetIds = v
	return s
}
762985
func (s *ParameterDefinition) SetReferencedByResources(v []*string) *ParameterDefinition {
	s.ReferencedByResources = v
	return s
}
848978
func (s *ListIndexInput) SetIndexReference(v *ObjectReference) *ListIndexInput {
	s.IndexReference = v
	return s
}
134966
func (s *BatchListIndex) SetIndexReference(v *ObjectReference) *BatchListIndex {
	s.IndexReference = v
	return s
}
724077
func (s *BatchDeleteImageOutput) SetImageIds(v []*ImageIdentifier) *BatchDeleteImageOutput {
	s.ImageIds = v
	return s
}
1162743
func (s *BatchListIncomingTypedLinks) SetObjectReference(v *ObjectReference) *BatchListIncomingTypedLinks {
	s.ObjectReference = v
	return s
}
501506
func (s *ListComplianceItemsInput) SetResourceIds(v []*string) *ListComplianceItemsInput {
	s.ResourceIds = v
	return s
}
988005
func (s *BatchListObjectParentPaths) SetObjectReference(v *ObjectReference) *BatchListObjectParentPaths {
	s.ObjectReference = v
	return s
}
762337
func (s *DetachPolicyInput) SetObjectReference(v *ObjectReference) *DetachPolicyInput {
	s.ObjectReference = v
	return s
}
983439
func setRelationshipIDs(relationships map[string]Relationship, target UnmarshalIdentifier) error {
	for name, rel := range relationships {
		// if Data is nil, it means that we have an empty toOne relationship
		if rel.Data == nil {
			castedToOne, ok := target.(UnmarshalToOneRelations)
			if !ok {
				return fmt.Errorf("struct %s does not implement UnmarshalToOneRelations", reflect.TypeOf(target))
			}

			castedToOne.SetToOneReferenceID(name, "")
			continue
		}

		// valid toOne case
		if rel.Data.DataObject != nil {
			castedToOne, ok := target.(UnmarshalToOneRelations)
			if !ok {
				return fmt.Errorf("struct %s does not implement UnmarshalToOneRelations", reflect.TypeOf(target))
			}
			err := castedToOne.SetToOneReferenceID(name, rel.Data.DataObject.ID)
			if err != nil {
				return err
			}
		}

		// valid toMany case
		if rel.Data.DataArray != nil {
			castedToMany, ok := target.(UnmarshalToManyRelations)
			if !ok {
				return fmt.Errorf("struct %s does not implement UnmarshalToManyRelations", reflect.TypeOf(target))
			}
			IDs := make([]string, len(rel.Data.DataArray))
			for index, relData := range rel.Data.DataArray {
				IDs[index] = relData.ID
			}
			err := castedToMany.SetToManyReferenceIDs(name, IDs)
			if err != nil {
				return err
			}
		}
	}

	return nil
}
803099
func (s *BatchGetObjectInformation) SetObjectReference(v *ObjectReference) *BatchGetObjectInformation {
	s.ObjectReference = v
	return s
}
563816
func (s *ModifyCacheSubnetGroupInput) SetSubnetIds(v []*string) *ModifyCacheSubnetGroupInput {
	s.SubnetIds = v
	return s
}
210419
func (s *BatchAddFacetToObject) SetObjectReference(v *ObjectReference) *BatchAddFacetToObject {
	s.ObjectReference = v
	return s
}
1350303
func (s *BatchListObjectPolicies) SetObjectReference(v *ObjectReference) *BatchListObjectPolicies {
	s.ObjectReference = v
	return s
}
60501
func (s *H264Settings) SetNumberReferenceFrames(v int64) *H264Settings {
	s.NumberReferenceFrames = &v
	return s
}
1159483
func (s *RemoveFacetFromObjectInput) SetObjectReference(v *ObjectReference) *RemoveFacetFromObjectInput {
	s.ObjectReference = v
	return s
}