// SetRelationshipScore sets the RelationshipScore field's value.
185290
func (s *Attribute) SetRelationshipScore(v float64) *Attribute {
	s.RelationshipScore = &v
	return s
}
1297354
func (client *Client) UpdateSpaceIsolationSegmentRelationship(spaceGUID string, isolationSegmentGUID string) (Relationship, Warnings, error) {
	body, err := json.Marshal(Relationship{GUID: isolationSegmentGUID})
	if err != nil {
		return Relationship{}, nil, err
	}

	request, err := client.newHTTPRequest(requestOptions{
		RequestName: internal.PatchSpaceRelationshipIsolationSegmentRequest,
		URIParams:   internal.Params{"space_guid": spaceGUID},
		Body:        bytes.NewReader(body),
	})
	if err != nil {
		return Relationship{}, nil, err
	}

	var relationship Relationship
	response := cloudcontroller.Response{
		DecodeJSONResponseInto: &relationship,
	}

	err = client.connection.Make(request, &response)
	return relationship, response.Warnings, err
}
8252
func (c *Client) AddRelation(endpoints, viaCIDRs []string) (*params.AddRelationResults, error) {
	var addRelRes params.AddRelationResults
	args := params.AddRelation{Endpoints: endpoints, ViaCIDRs: viaCIDRs}
	err := c.facade.FacadeCall("AddRelation", args, &addRelRes)
	return &addRelRes, err
}
806503
func (s *RelationalDatabaseSnapshot) SetFromRelationalDatabaseBundleId(v string) *RelationalDatabaseSnapshot {
	s.FromRelationalDatabaseBundleId = &v
	return s
}
55590
func (s *UpdateRelationalDatabaseInput) SetRelationalDatabaseName(v string) *UpdateRelationalDatabaseInput {
	s.RelationalDatabaseName = &v
	return s
}
256273
func (s *GetRelationalDatabaseSnapshotsOutput) SetRelationalDatabaseSnapshots(v []*RelationalDatabaseSnapshot) *GetRelationalDatabaseSnapshotsOutput {
	s.RelationalDatabaseSnapshots = v
	return s
}
194298
func (p *PhysicalHashJoin) SetCorrelated() {
	p.basePlan.SetCorrelated()
	for _, cond := range p.EqualConditions {
		p.correlated = p.correlated || cond.IsCorrelated()
	}
	for _, cond := range p.LeftConditions {
		p.correlated = p.correlated || cond.IsCorrelated()
	}
	for _, cond := range p.RightConditions {
		p.correlated = p.correlated || cond.IsCorrelated()
	}
	for _, cond := range p.OtherConditions {
		p.correlated = p.correlated || cond.IsCorrelated()
	}
}
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
}
900856
func (s *ThingDocument) SetConnectivity(v *ThingConnectivity) *ThingDocument {
	s.Connectivity = v
	return s
}
363985
func (s *RelationalDatabaseDataSourceConfig) SetRelationalDatabaseSourceType(v string) *RelationalDatabaseDataSourceConfig {
	s.RelationalDatabaseSourceType = &v
	return s
}
890654
func (s *RelationalDatabase) SetRelationalDatabaseBundleId(v string) *RelationalDatabase {
	s.RelationalDatabaseBundleId = &v
	return s
}
31744
func (s *DetectSentimentOutput) SetSentimentScore(v *SentimentScore) *DetectSentimentOutput {
	s.SentimentScore = v
	return s
}
1371200
func (f *FirewallerAPIV4) SetRelationsStatus(args params.SetStatus) (params.ErrorResults, error) {
	var result params.ErrorResults
	result.Results = make([]params.ErrorResult, len(args.Entities))
	for i, entity := range args.Entities {
		relationTag, err := names.ParseRelationTag(entity.Tag)
		if err != nil {
			result.Results[i].Error = common.ServerError(err)
			continue
		}
		rel, err := f.st.KeyRelation(relationTag.Id())
		if err != nil {
			result.Results[i].Error = common.ServerError(err)
			continue
		}
		err = rel.SetStatus(status.StatusInfo{
			Status:  status.Status(entity.Status),
			Message: entity.Info,
		})
		result.Results[i].Error = common.ServerError(err)
	}
	return result, nil
}
742949
func (api *APIBase) SetRelationsSuspended(args params.RelationSuspendedArgs) (params.ErrorResults, error) {
	var statusResults params.ErrorResults
	if err := api.checkCanWrite(); err != nil {
		return statusResults, errors.Trace(err)
	}
	if err := api.check.ChangeAllowed(); err != nil {
		return statusResults, errors.Trace(err)
	}

	changeOne := func(arg params.RelationSuspendedArg) error {
		rel, err := api.backend.Relation(arg.RelationId)
		if err != nil {
			return errors.Trace(err)
		}
		if rel.Suspended() == arg.Suspended {
			return nil
		}
		_, err = api.backend.OfferConnectionForRelation(rel.Tag().Id())
		if errors.IsNotFound(err) {
			return errors.Errorf("cannot set suspend status for %q which is not associated with an offer", rel.Tag().Id())
		}
		message := arg.Message
		if !arg.Suspended {
			message = ""
		}
		err = rel.SetSuspended(arg.Suspended, message)
		if err != nil {
			return errors.Trace(err)
		}

		statusValue := status.Joining
		if arg.Suspended {
			statusValue = status.Suspending
		}
		return rel.SetStatus(status.StatusInfo{
			Status:  statusValue,
			Message: arg.Message,
		})
	}
	results := make([]params.ErrorResult, len(args.Args))
	for i, arg := range args.Args {
		err := changeOne(arg)
		results[i].Error = common.ServerError(err)
	}
	statusResults.Results = results
	return statusResults, nil
}
9523
func (a *GetPartialAXTreeArgs) SetFetchRelatives(fetchRelatives bool) *GetPartialAXTreeArgs {
	a.FetchRelatives = &fetchRelatives
	return a
}
225142
func (s *Master) SetRelationshipStatus(v string) *Master {
	s.RelationshipStatus = &v
	return s
}
105951
func (s *KeyPhrase) SetScore(v float64) *KeyPhrase {
	s.Score = &v
	return s
}