Skip to content

List custom object types

client.Object.ListDefinitions(ctx) (*ObjectListDefinitionsResponse, error)
GET/v1/objects

Returns all custom object types available to the caller.

ReturnsExpand Collapse
type ObjectListDefinitionsResponse struct{…}
Data []ObjectListDefinitionsResponseData

All object types available to the caller.

Label string

Human-readable display name.

ObjectType string

The slug used to reference this object type in the API.

List custom object types

package main

import (
  "context"
  "fmt"

  "github.com/Lightfld/lightfield-go"
  "github.com/Lightfld/lightfield-go/option"
)

func main() {
  client := githubcomlightfldlightfieldgo.NewClient(
    option.WithAPIKey("My API Key"),
  )
  objectListDefinitionsResponse, err := client.Object.ListDefinitions(context.TODO())
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", objectListDefinitionsResponse.Data)
}
{
  "data": [
    {
      "label": "label",
      "objectType": "objectType"
    }
  ]
}
Returns Examples
{
  "data": [
    {
      "label": "label",
      "objectType": "objectType"
    }
  ]
}