// setObjectSelfLink sets the self link of an object as needed.
// TODO: remove the need for the namer LinkSetters by requiring objects implement either Object or List
//   interfaces
176156
func setObjectSelfLink(ctx context.Context, obj runtime.Object, req *http.Request, namer ScopeNamer) error {
	// We only generate list links on objects that implement ListInterface - historically we duck typed this
	// check via reflection, but as we move away from reflection we require that you not only carry Items but
	// ListMeta into order to be identified as a list.
	if !meta.IsListType(obj) {
		requestInfo, ok := request.RequestInfoFrom(ctx)
		if !ok {
			return fmt.Errorf("missing requestInfo")
		}
		return setSelfLink(obj, requestInfo, namer)
	}

	uri, err := namer.GenerateListLink(req)
	if err != nil {
		return err
	}
	if err := namer.SetSelfLink(obj, uri); err != nil {
		klog.V(4).Infof("Unable to set self link on object: %v", err)
	}
	requestInfo, ok := request.RequestInfoFrom(ctx)
	if !ok {
		return fmt.Errorf("missing requestInfo")
	}

	count := 0
	err = meta.EachListItem(obj, func(obj runtime.Object) error {
		count++
		return setSelfLink(obj, requestInfo, namer)
	})

	if count == 0 {
		if err := meta.SetList(obj, []runtime.Object{}); err != nil {
			return err
		}
	}

	return err
}
548778
func (s *BatchWriteOperation) SetAttachObject(v *BatchAttachObject) *BatchWriteOperation {
	s.AttachObject = v
	return s
}
1320631
func (s *GenericAttachment) SetAttachmentLinkUrl(v string) *GenericAttachment {
	s.AttachmentLinkUrl = &v
	return s
}
407263
func (s *ListOutgoingTypedLinksInput) SetFilterTypedLink(v *TypedLinkSchemaAndFacetName) *ListOutgoingTypedLinksInput {
	s.FilterTypedLink = v
	return s
}
1364499
func (s *BatchCreateObject) SetObjectAttributeList(v []*AttributeKeyAndValue) *BatchCreateObject {
	s.ObjectAttributeList = v
	return s
}
1353915
func (s *CopyObjectInput) SetObjectLockMode(v string) *CopyObjectInput {
	s.ObjectLockMode = &v
	return s
}
1361978
func (s *ListObjectParentPathsInput) SetObjectReference(v *ObjectReference) *ListObjectParentPathsInput {
	s.ObjectReference = v
	return s
}
139626
func (s *AddFacetToObjectInput) SetObjectAttributeList(v []*AttributeKeyAndValue) *AddFacetToObjectInput {
	s.ObjectAttributeList = v
	return s
}
1176588
func (a *FocusArgs) SetObjectID(objectID runtime.RemoteObjectID) *FocusArgs {
	a.ObjectID = &objectID
	return a
}
992689
func (s *Facet) SetObjectType(v string) *Facet {
	s.ObjectType = &v
	return s
}
163580
func (s *BatchWriteOperationResponse) SetAttachObject(v *BatchAttachObjectResponse) *BatchWriteOperationResponse {
	s.AttachObject = v
	return s
}
221247
func (s *ObjectAttributeUpdate) SetObjectAttributeAction(v *ObjectAttributeAction) *ObjectAttributeUpdate {
	s.ObjectAttributeAction = v
	return s
}
1159483
func (s *RemoveFacetFromObjectInput) SetObjectReference(v *ObjectReference) *RemoveFacetFromObjectInput {
	s.ObjectReference = v
	return s
}
201942
func (s *BatchWriteOperationResponse) SetAttachTypedLink(v *BatchAttachTypedLinkResponse) *BatchWriteOperationResponse {
	s.AttachTypedLink = v
	return s
}
1057730
func (s *BatchAttachTypedLink) SetTargetObjectReference(v *ObjectReference) *BatchAttachTypedLink {
	s.TargetObjectReference = v
	return s
}
80222
func (s *ListObjectParentsInput) SetObjectReference(v *ObjectReference) *ListObjectParentsInput {
	s.ObjectReference = v
	return s
}
894228
func (a *EvaluateOnCallFrameArgs) SetObjectGroup(objectGroup string) *EvaluateOnCallFrameArgs {
	a.ObjectGroup = &objectGroup
	return a
}