{"modulePath":"github.com/openshift-hyperfleet/hyperfleet-api","version":"v0.4.1","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package presenters\n\n## Functions\n\n```go\nfunc ConvertAdapterStatus(\n\tresourceType, resourceID string,\n\treq *openapi.AdapterStatusCreateRequest,\n) (*api.AdapterStatus, error)\n```\nConvertAdapterStatus converts openapi.AdapterStatusCreateRequest to api.AdapterStatus (GORM model)\n\n```go\nfunc ConvertResource(req *openapi.ResourceCreateRequest) (*api.Resource, error)\n```\nConvertResource converts an openapi.ResourceCreateRequest to an api.Resource GORM model. CreatedBy/UpdatedBy are set by the service layer from auth context.\n\n```go\nfunc ConvertResourceWithOwner(\n\treq *openapi.ResourceCreateRequest,\n\townerID, ownerKind, ownerHref string,\n) (*api.Resource, error)\n```\nConvertResourceWithOwner converts a request to a child resource with owner references set.\n\n```go\nfunc FilterSingle(fields2Store []string, resource interface{}) (map[string]interface{}, *errors.ServiceError)\n```\nFilterSingle returns a projected map containing only the requested fields from a single resource. This is the single-resource equivalent of SliceFilter.\n\n```go\nfunc PresentAdapterStatus(adapterStatus *api.AdapterStatus) (openapi.AdapterStatus, error)\n```\nPresentAdapterStatus converts api.AdapterStatus (GORM model) to openapi.AdapterStatus\n\n```go\nfunc PresentResource(r *api.Resource) openapi.Resource\n```\nPresentResource converts an api.Resource GORM model to an openapi.Resource.\n\n```go\nfunc PresentResourceList(resources api.ResourceList, paging *api.PagingMeta) openapi.ResourceList\n```\nPresentResourceList converts a slice of resources and paging metadata to an openapi.ResourceList.\n\n```go\nfunc RegisterKind(objType interface{}, kindValue string)\n```\n\n```go\nfunc RegisterPath(objType interface{}, pathValue string)\n```\n\n## Types\n\n```go\ntype KindMappingFunc func(interface{}) string\n```\n\n```go\ntype PathMappingFunc func(interface{}) string\n```\n\n```go\ntype ProjectionList struct {\n\tItems []map[string]interface{} `json:\"items\"`\n\tPage  int32                    `json:\"page\"`\n\tSize  int32                    `json:\"size\"`\n\tTotal int32                    `json:\"total\"`\n}\n```\n\n```go\nfunc SliceFilter(fields2Store []string, model interface{}) (*ProjectionList, *errors.ServiceError)\n```\nSliceFilter returns a projected list containing requested fields from each item\n\n","path":"github.com/openshift-hyperfleet/hyperfleet-api/pkg/api/presenters","name":"presenters","synopsis":"","isRedistributable":true}
