moonbase

package module
v0.1.0-alpha.11 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 19, 2026 License: Apache-2.0 Imports: 25 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Moonbase Go API Library

Go Reference

The Moonbase Go library provides convenient access to the Moonbase REST API from applications written in Go.

It is generated with Stainless.

MCP Server

Use the Moonbase MCP Server to enable AI assistants to interact with this API, allowing them to explore endpoints, make test requests, and use documentation to help integrate this SDK into your application.

Add to Cursor Install in VS Code

Note: You may need to set environment variables in your MCP client.

Installation

import (
	"github.com/moonbaseai/moonbase-sdk-go" // imported as moonbase
)

Or to pin the version:

go get -u 'github.com/moonbaseai/moonbase-sdk-go@v0.1.0-alpha.11'

Requirements

This library requires Go 1.22+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/moonbaseai/moonbase-sdk-go"
	"github.com/moonbaseai/moonbase-sdk-go/option"
)

func main() {
	client := moonbase.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("MOONBASE_API_KEY")
	)
	collection, err := client.Collections.Get(context.TODO(), "people")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", collection.ID)
}

Request fields

The moonbase library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `api:"required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, moonbase.String(string), moonbase.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := moonbase.ExampleParams{
	ID:   "id_xxx",               // required property
	Name: moonbase.String("..."), // optional property

	Point: moonbase.Point{
		X: 0,               // required field will serialize as 0
		Y: moonbase.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: moonbase.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[moonbase.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of its variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := moonbase.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Collections.Get(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

iter := client.Collections.Items.ListAutoPaging(
	context.TODO(),
	"people",
	moonbase.CollectionItemListParams{
		Limit: moonbase.Int(5),
	},
)
// Automatically fetches more pages as needed.
for iter.Next() {
	itemPointer := iter.Current()
	fmt.Printf("%+v\n", itemPointer)
}
if err := iter.Err(); err != nil {
	panic(err.Error())
}

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

people, err := client.Collections.Items.List(
	context.TODO(),
	"people",
	moonbase.CollectionItemListParams{
		Limit: moonbase.Int(5),
	},
)
for page != nil {
	for _, item := range page.Data {
		fmt.Printf("%+v\n", item)
	}
	page, err = page.GetNextPage()
}
if err != nil {
	panic(err.Error())
}
Errors

When the API returns a non-success status code, we return an error with type *moonbase.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.Collections.Get(context.TODO(), "people")
if err != nil {
	var apierr *moonbase.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/collections/{id}": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.Collections.Get(
	ctx,
	"people",
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper moonbase.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

// A file from the file system
file, err := os.Open("/path/to/file")
moonbase.InboxMessageAttachmentNewParams{
	File: file,
}

// A file from a string
moonbase.InboxMessageAttachmentNewParams{
	File: strings.NewReader("my file contents"),
}

// With a custom filename and contentType
moonbase.InboxMessageAttachmentNewParams{
	File: moonbase.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
}
Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := moonbase.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Collections.Get(
	context.TODO(),
	"people",
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
collection, err := client.Collections.Get(
	context.TODO(),
	"people",
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", collection)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: moonbase.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := moonbase.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

View Source
const TagColorAmber = shared.TagColorAmber

Equals "amber"

View Source
const TagColorBlue = shared.TagColorBlue

Equals "blue"

View Source
const TagColorCyan = shared.TagColorCyan

Equals "cyan"

View Source
const TagColorEmerald = shared.TagColorEmerald

Equals "emerald"

View Source
const TagColorFuchsia = shared.TagColorFuchsia

Equals "fuchsia"

View Source
const TagColorGreen = shared.TagColorGreen

Equals "green"

View Source
const TagColorIndigo = shared.TagColorIndigo

Equals "indigo"

View Source
const TagColorLime = shared.TagColorLime

Equals "lime"

View Source
const TagColorLunar = shared.TagColorLunar

Equals "lunar"

View Source
const TagColorOrange = shared.TagColorOrange

Equals "orange"

View Source
const TagColorPink = shared.TagColorPink

Equals "pink"

View Source
const TagColorPurple = shared.TagColorPurple

Equals "purple"

View Source
const TagColorRed = shared.TagColorRed

Equals "red"

View Source
const TagColorRose = shared.TagColorRose

Equals "rose"

View Source
const TagColorSky = shared.TagColorSky

Equals "sky"

View Source
const TagColorTeal = shared.TagColorTeal

Equals "teal"

View Source
const TagColorViolet = shared.TagColorViolet

Equals "violet"

View Source
const TagColorYellow = shared.TagColorYellow

Equals "yellow"

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

DefaultClientOptions read from the environment (MOONBASE_API_KEY, MOONBASE_BASE_URL). This should be used to initialize new clients.

func File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

Types

type Activity

type Activity struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// An array of entities involved along with each entity's relation to the activity.
	Constituents []Constituent `json:"constituents" api:"required"`
	// The time at which the event occurred, as an ISO 8601 timestamp in UTC.
	OccurredAt time.Time `json:"occurred_at" api:"required" format:"date-time"`
	// The type of activity.
	//
	// Any of "activity/call_occurred", "activity/file_created",
	// "activity/form_submitted", "activity/inbox_message_sent",
	// "activity/item_created", "activity/item_mentioned", "activity/item_merged",
	// "activity/meeting_held", "activity/meeting_scheduled", "activity/note_created",
	// "activity/program_message_bounced", "activity/program_message_clicked",
	// "activity/program_message_complained", "activity/program_message_failed",
	// "activity/program_message_opened", "activity/program_message_sent",
	// "activity/program_message_shielded", "activity/program_message_unsubscribed".
	Type ActivityType `json:"type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Constituents respjson.Field
		OccurredAt   respjson.Field
		Type         respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Activity object represents a specific event that has occurred, such as a meeting being scheduled or a form being submitted.

func (Activity) RawJSON

func (r Activity) RawJSON() string

Returns the unmodified JSON received from the API

func (*Activity) UnmarshalJSON

func (r *Activity) UnmarshalJSON(data []byte) error

type ActivityListParams

type ActivityListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Filter activities by which entities were involved. Must be paired with
	// constituent_entity_type.
	ConstituentEntityID ActivityListParamsConstituentEntityID `query:"constituent_entity_id,omitzero" json:"-"`
	// Filter activities by which entities were involved. Must be paired with
	// constituent_entity_id.
	ConstituentEntityType ActivityListParamsConstituentEntityType `query:"constituent_entity_type,omitzero" json:"-"`
	// Filter activities by which entities were involved via specific relations. Must
	// be paired with constituent_entity_type and constituent_entity_id.
	ConstituentRelation ActivityListParamsConstituentRelation `query:"constituent_relation,omitzero" json:"-"`
	// Filter activities by when they occurred.
	OccurredAt ActivityListParamsOccurredAt `query:"occurred_at,omitzero" json:"-"`
	// Filter activities by type.
	Type ActivityListParamsType `query:"type,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ActivityListParams) URLQuery

func (r ActivityListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ActivityListParams's query parameters as `url.Values`.

type ActivityListParamsConstituentEntityID

type ActivityListParamsConstituentEntityID struct {
	Eq param.Opt[string] `query:"eq,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Filter activities by which entities were involved. Must be paired with constituent_entity_type.

func (ActivityListParamsConstituentEntityID) URLQuery

func (r ActivityListParamsConstituentEntityID) URLQuery() (v url.Values, err error)

URLQuery serializes ActivityListParamsConstituentEntityID's query parameters as `url.Values`.

type ActivityListParamsConstituentEntityType

type ActivityListParamsConstituentEntityType struct {
	// The type of the entity involved as a constituent of the activity.
	//
	// Any of "call", "collection", "file", "item", "meeting", "message", "note",
	// "program", "program_message", "program_template", "unsubscribe".
	Eq string `query:"eq,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Filter activities by which entities were involved. Must be paired with constituent_entity_id.

func (ActivityListParamsConstituentEntityType) URLQuery

URLQuery serializes ActivityListParamsConstituentEntityType's query parameters as `url.Values`.

type ActivityListParamsConstituentRelation

type ActivityListParamsConstituentRelation struct {
	// Any of "actor", "object", "target".
	Eq string `query:"eq,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Filter activities by which entities were involved via specific relations. Must be paired with constituent_entity_type and constituent_entity_id.

func (ActivityListParamsConstituentRelation) URLQuery

func (r ActivityListParamsConstituentRelation) URLQuery() (v url.Values, err error)

URLQuery serializes ActivityListParamsConstituentRelation's query parameters as `url.Values`.

type ActivityListParamsOccurredAt

type ActivityListParamsOccurredAt struct {
	Gte param.Opt[time.Time] `query:"gte,omitzero" format:"date-time" json:"-"`
	Lte param.Opt[time.Time] `query:"lte,omitzero" format:"date-time" json:"-"`
	// contains filtered or unexported fields
}

Filter activities by when they occurred.

func (ActivityListParamsOccurredAt) URLQuery

func (r ActivityListParamsOccurredAt) URLQuery() (v url.Values, err error)

URLQuery serializes ActivityListParamsOccurredAt's query parameters as `url.Values`.

type ActivityListParamsType

type ActivityListParamsType struct {
	// Any of "activity/call_occurred", "activity/form_submitted",
	// "activity/inbox_message_sent", "activity/item_created",
	// "activity/item_mentioned", "activity/item_merged", "activity/file_created",
	// "activity/meeting_held", "activity/meeting_scheduled", "activity/note_created",
	// "activity/program_message_bounced", "activity/program_message_clicked",
	// "activity/program_message_complained", "activity/program_message_failed",
	// "activity/program_message_opened", "activity/program_message_sent",
	// "activity/program_message_shielded", "activity/program_message_unsubscribed".
	Eq string `query:"eq,omitzero" json:"-"`
	// contains filtered or unexported fields
}

Filter activities by type.

func (ActivityListParamsType) URLQuery

func (r ActivityListParamsType) URLQuery() (v url.Values, err error)

URLQuery serializes ActivityListParamsType's query parameters as `url.Values`.

type ActivityService

type ActivityService struct {
	Options []option.RequestOption
}

View activities and capture calls

ActivityService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewActivityService method instead.

func NewActivityService

func NewActivityService(opts ...option.RequestOption) (r ActivityService)

NewActivityService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ActivityService) Get

func (r *ActivityService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Activity, err error)

Retrieves the details of an existing activity.

func (*ActivityService) List

Returns a list of activities.

func (*ActivityService) ListAutoPaging

Returns a list of activities.

type ActivityType

type ActivityType string

The type of activity.

const (
	ActivityTypeActivityCallOccurred               ActivityType = "activity/call_occurred"
	ActivityTypeActivityFileCreated                ActivityType = "activity/file_created"
	ActivityTypeActivityFormSubmitted              ActivityType = "activity/form_submitted"
	ActivityTypeActivityInboxMessageSent           ActivityType = "activity/inbox_message_sent"
	ActivityTypeActivityItemCreated                ActivityType = "activity/item_created"
	ActivityTypeActivityItemMentioned              ActivityType = "activity/item_mentioned"
	ActivityTypeActivityItemMerged                 ActivityType = "activity/item_merged"
	ActivityTypeActivityMeetingHeld                ActivityType = "activity/meeting_held"
	ActivityTypeActivityMeetingScheduled           ActivityType = "activity/meeting_scheduled"
	ActivityTypeActivityNoteCreated                ActivityType = "activity/note_created"
	ActivityTypeActivityProgramMessageBounced      ActivityType = "activity/program_message_bounced"
	ActivityTypeActivityProgramMessageClicked      ActivityType = "activity/program_message_clicked"
	ActivityTypeActivityProgramMessageComplained   ActivityType = "activity/program_message_complained"
	ActivityTypeActivityProgramMessageFailed       ActivityType = "activity/program_message_failed"
	ActivityTypeActivityProgramMessageOpened       ActivityType = "activity/program_message_opened"
	ActivityTypeActivityProgramMessageSent         ActivityType = "activity/program_message_sent"
	ActivityTypeActivityProgramMessageShielded     ActivityType = "activity/program_message_shielded"
	ActivityTypeActivityProgramMessageUnsubscribed ActivityType = "activity/program_message_unsubscribed"
)

type AgentSettingGetResponse

type AgentSettingGetResponse struct {
	CreatedAt             time.Time              `json:"created_at" api:"required" format:"date-time"`
	Type                  constant.AgentSettings `json:"type" default:"agent_settings"`
	UpdatedAt             time.Time              `json:"updated_at" api:"required" format:"date-time"`
	DealSummaryPrompt     string                 `json:"deal_summary_prompt"`
	MeetingPrebriefPrompt string                 `json:"meeting_prebrief_prompt"`
	MeetingSummaryPrompt  string                 `json:"meeting_summary_prompt"`
	MeetingWebSearch      bool                   `json:"meeting_web_search"`
	OrganizationInfo      string                 `json:"organization_info"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt             respjson.Field
		Type                  respjson.Field
		UpdatedAt             respjson.Field
		DealSummaryPrompt     respjson.Field
		MeetingPrebriefPrompt respjson.Field
		MeetingSummaryPrompt  respjson.Field
		MeetingWebSearch      respjson.Field
		OrganizationInfo      respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AgentSettingGetResponse) RawJSON

func (r AgentSettingGetResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AgentSettingGetResponse) UnmarshalJSON

func (r *AgentSettingGetResponse) UnmarshalJSON(data []byte) error

type AgentSettingService

type AgentSettingService struct {
	Options []option.RequestOption
}

AgentSettingService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewAgentSettingService method instead.

func NewAgentSettingService

func NewAgentSettingService(opts ...option.RequestOption) (r AgentSettingService)

NewAgentSettingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*AgentSettingService) Get

func (*AgentSettingService) Update

type AgentSettingUpdateParams

type AgentSettingUpdateParams struct {
	DealSummaryPrompt     param.Opt[string] `json:"deal_summary_prompt,omitzero"`
	MeetingPrebriefPrompt param.Opt[string] `json:"meeting_prebrief_prompt,omitzero"`
	MeetingSummaryPrompt  param.Opt[string] `json:"meeting_summary_prompt,omitzero"`
	MeetingWebSearch      param.Opt[bool]   `json:"meeting_web_search,omitzero"`
	OrganizationInfo      param.Opt[string] `json:"organization_info,omitzero"`
	// contains filtered or unexported fields
}

func (AgentSettingUpdateParams) MarshalJSON

func (r AgentSettingUpdateParams) MarshalJSON() (data []byte, err error)

func (*AgentSettingUpdateParams) UnmarshalJSON

func (r *AgentSettingUpdateParams) UnmarshalJSON(data []byte) error

type AgentSettingUpdateResponse

type AgentSettingUpdateResponse struct {
	CreatedAt             time.Time              `json:"created_at" api:"required" format:"date-time"`
	Type                  constant.AgentSettings `json:"type" default:"agent_settings"`
	UpdatedAt             time.Time              `json:"updated_at" api:"required" format:"date-time"`
	DealSummaryPrompt     string                 `json:"deal_summary_prompt"`
	MeetingPrebriefPrompt string                 `json:"meeting_prebrief_prompt"`
	MeetingSummaryPrompt  string                 `json:"meeting_summary_prompt"`
	MeetingWebSearch      bool                   `json:"meeting_web_search"`
	OrganizationInfo      string                 `json:"organization_info"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt             respjson.Field
		Type                  respjson.Field
		UpdatedAt             respjson.Field
		DealSummaryPrompt     respjson.Field
		MeetingPrebriefPrompt respjson.Field
		MeetingSummaryPrompt  respjson.Field
		MeetingWebSearch      respjson.Field
		OrganizationInfo      respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AgentSettingUpdateResponse) RawJSON

func (r AgentSettingUpdateResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AgentSettingUpdateResponse) UnmarshalJSON

func (r *AgentSettingUpdateResponse) UnmarshalJSON(data []byte) error

type Attendee

type Attendee struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The email address of the attendee.
	Email string `json:"email" api:"required" format:"email"`
	// String representing the object’s type. Always `meeting_attendee` for this
	// object.
	Type constant.MeetingAttendee `json:"type" default:"meeting_attendee"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Organization ItemPointer `json:"organization"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Person ItemPointer `json:"person"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Email        respjson.Field
		Type         respjson.Field
		Organization respjson.Field
		Person       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Attendee object represents a participant in a meeting. It includes their email address and links to associated `Person` and `Organization` items, if they exist in your collections.

func (Attendee) RawJSON

func (r Attendee) RawJSON() string

Returns the unmodified JSON received from the API

func (*Attendee) UnmarshalJSON

func (r *Attendee) UnmarshalJSON(data []byte) error

type BooleanField

type BooleanField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality BooleanFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind BooleanFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Is Active").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `is_active`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/boolean` for this field.
	Type constant.FieldBoolean `json:"type" default:"field/boolean"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores true or false values.

func (BooleanField) RawJSON

func (r BooleanField) RawJSON() string

Returns the unmodified JSON received from the API

func (*BooleanField) UnmarshalJSON

func (r *BooleanField) UnmarshalJSON(data []byte) error

type BooleanFieldCardinality

type BooleanFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	BooleanFieldCardinalityOne  BooleanFieldCardinality = "one"
	BooleanFieldCardinalityMany BooleanFieldCardinality = "many"
)

type BooleanFieldKind

type BooleanFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	BooleanFieldKindSystem  BooleanFieldKind = "system"
	BooleanFieldKindInverse BooleanFieldKind = "inverse"
	BooleanFieldKindCustom  BooleanFieldKind = "custom"
)

type BooleanValue

type BooleanValue struct {
	Data bool                  `json:"data" api:"required"`
	Type constant.ValueBoolean `json:"type" default:"value/boolean"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

True or false value

func (BooleanValue) RawJSON

func (r BooleanValue) RawJSON() string

Returns the unmodified JSON received from the API

func (BooleanValue) ToParam

func (r BooleanValue) ToParam() BooleanValueParam

ToParam converts this BooleanValue to a BooleanValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with BooleanValueParam.Overrides()

func (*BooleanValue) UnmarshalJSON

func (r *BooleanValue) UnmarshalJSON(data []byte) error

type BooleanValueParam

type BooleanValueParam struct {
	Data bool `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as "value/boolean".
	Type constant.ValueBoolean `json:"type" default:"value/boolean"`
	// contains filtered or unexported fields
}

True or false value

The properties Data, Type are required.

func (BooleanValueParam) MarshalJSON

func (r BooleanValueParam) MarshalJSON() (data []byte, err error)

func (*BooleanValueParam) UnmarshalJSON

func (r *BooleanValueParam) UnmarshalJSON(data []byte) error

type Call

type Call struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The direction of the call, either `incoming` or `outgoing`.
	//
	// Any of "incoming", "outgoing".
	Direction CallDirection `json:"direction" api:"required"`
	// The participants involved in the call.
	Participants []CallParticipant `json:"participants" api:"required"`
	// The name of the phone provider that handled the call.
	//
	// Any of "openphone", "user", "zoom_phone".
	Provider CallProvider `json:"provider" api:"required"`
	// The unique identifier for the call from the provider's system.
	ProviderID string `json:"provider_id" api:"required"`
	// The current status of the call.
	ProviderStatus string `json:"provider_status" api:"required"`
	// The time the call started, as an ISO 8601 timestamp in UTC.
	StartAt time.Time `json:"start_at" api:"required" format:"date-time"`
	// The tags currently applied to this call.
	Tags []shared.Tag `json:"tags" api:"required"`
	// String representing the object’s type. Always `call` for this object.
	Type constant.Call `json:"type" default:"call"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The time the call was answered, if available, as an ISO 8601 timestamp in UTC.
	AnsweredAt time.Time `json:"answered_at" format:"date-time"`
	// The time the call ended, if available, as an ISO 8601 timestamp in UTC.
	EndAt time.Time `json:"end_at" format:"date-time"`
	// The Note object represents a block of text content, often used for meeting notes
	// or summaries.
	Note Note `json:"note" api:"nullable"`
	// A hash of additional metadata from the provider.
	ProviderMetadata map[string]any `json:"provider_metadata"`
	// The Note object represents a block of text content, often used for meeting notes
	// or summaries.
	Summary    Note           `json:"summary" api:"nullable"`
	Transcript CallTranscript `json:"transcript" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		CreatedAt        respjson.Field
		Direction        respjson.Field
		Participants     respjson.Field
		Provider         respjson.Field
		ProviderID       respjson.Field
		ProviderStatus   respjson.Field
		StartAt          respjson.Field
		Tags             respjson.Field
		Type             respjson.Field
		UpdatedAt        respjson.Field
		AnsweredAt       respjson.Field
		EndAt            respjson.Field
		Note             respjson.Field
		ProviderMetadata respjson.Field
		Summary          respjson.Field
		Transcript       respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Call object represents a phone call that has been logged in the system. It contains details about the participants, timing, and outcome of the call.

func (Call) RawJSON

func (r Call) RawJSON() string

Returns the unmodified JSON received from the API

func (*Call) UnmarshalJSON

func (r *Call) UnmarshalJSON(data []byte) error

type CallDirection

type CallDirection string

The direction of the call, either `incoming` or `outgoing`.

const (
	CallDirectionIncoming CallDirection = "incoming"
	CallDirectionOutgoing CallDirection = "outgoing"
)

type CallGetParams

type CallGetParams struct {
	// Specifies which related objects to include in the response. Valid options are
	// `transcript`, `note`, and `summary`.
	//
	// Any of "transcript", "note", "summary".
	Include []string `query:"include,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CallGetParams) URLQuery

func (r CallGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes CallGetParams's query parameters as `url.Values`.

type CallListParams

type CallListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CallListParams) URLQuery

func (r CallListParams) URLQuery() (v url.Values, err error)

URLQuery serializes CallListParams's query parameters as `url.Values`.

type CallNewParams

type CallNewParams struct {
	// The direction of the call, either `incoming` or `outgoing`.
	//
	// Any of "incoming", "outgoing".
	Direction CallNewParamsDirection `json:"direction,omitzero" api:"required"`
	// An array of participants involved in the call.
	Participants []CallNewParamsParticipant `json:"participants,omitzero" api:"required"`
	// The name of the phone provider that handled the call (e.g., `openphone`).
	//
	// Any of "openphone", "user", "zoom_phone".
	Provider CallNewParamsProvider `json:"provider,omitzero" api:"required"`
	// The unique identifier for the call from the provider's system.
	ProviderID string `json:"provider_id" api:"required"`
	// The status of the call.
	ProviderStatus string `json:"provider_status" api:"required"`
	// The time the call started, as an ISO 8601 timestamp in UTC.
	StartAt time.Time `json:"start_at" api:"required" format:"date-time"`
	// The time the call was answered, as an ISO 8601 timestamp in UTC.
	AnsweredAt param.Opt[time.Time] `json:"answered_at,omitzero" format:"date-time"`
	// The time the call ended, as an ISO 8601 timestamp in UTC.
	EndAt param.Opt[time.Time] `json:"end_at,omitzero" format:"date-time"`
	// A hash of additional metadata from the provider.
	ProviderMetadata map[string]any `json:"provider_metadata,omitzero"`
	// Any recordings associated with the call.
	Recordings []CallNewParamsRecording `json:"recordings,omitzero"`
	// Optional list of tag pointers to assign to the call.
	Tags []shared.TagPointerParam `json:"tags,omitzero"`
	// A transcript of the call.
	Transcript CallNewParamsTranscript `json:"transcript,omitzero"`
	// contains filtered or unexported fields
}

func (CallNewParams) MarshalJSON

func (r CallNewParams) MarshalJSON() (data []byte, err error)

func (*CallNewParams) UnmarshalJSON

func (r *CallNewParams) UnmarshalJSON(data []byte) error

type CallNewParamsDirection

type CallNewParamsDirection string

The direction of the call, either `incoming` or `outgoing`.

const (
	CallNewParamsDirectionIncoming CallNewParamsDirection = "incoming"
	CallNewParamsDirectionOutgoing CallNewParamsDirection = "outgoing"
)

type CallNewParamsParticipant

type CallNewParamsParticipant struct {
	// The E.164 formatted phone number of the participant.
	Phone string `json:"phone" api:"required"`
	// The role of the participant in the call. Can be `caller`, `callee`, or `other`.
	//
	// Any of "caller", "callee", "other".
	Role string `json:"role,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating a `Participant` object.

The properties Phone, Role are required.

func (CallNewParamsParticipant) MarshalJSON

func (r CallNewParamsParticipant) MarshalJSON() (data []byte, err error)

func (*CallNewParamsParticipant) UnmarshalJSON

func (r *CallNewParamsParticipant) UnmarshalJSON(data []byte) error

type CallNewParamsProvider

type CallNewParamsProvider string

The name of the phone provider that handled the call (e.g., `openphone`).

const (
	CallNewParamsProviderOpenphone CallNewParamsProvider = "openphone"
	CallNewParamsProviderUser      CallNewParamsProvider = "user"
	CallNewParamsProviderZoomPhone CallNewParamsProvider = "zoom_phone"
)

type CallNewParamsRecording

type CallNewParamsRecording struct {
	// The content type of the recording. Note that only `audio/mpeg` is supported at
	// this time.
	//
	// Any of "audio/mpeg".
	ContentType string `json:"content_type,omitzero" api:"required"`
	// The unique identifier for the recording from the provider's system.
	ProviderID string `json:"provider_id" api:"required"`
	// The URL pointing to the recording.
	URL string `json:"url" api:"required" format:"uri"`
	// contains filtered or unexported fields
}

Parameters for creating a `CallRecording` object.

The properties ContentType, ProviderID, URL are required.

func (CallNewParamsRecording) MarshalJSON

func (r CallNewParamsRecording) MarshalJSON() (data []byte, err error)

func (*CallNewParamsRecording) UnmarshalJSON

func (r *CallNewParamsRecording) UnmarshalJSON(data []byte) error

type CallNewParamsTranscript

type CallNewParamsTranscript struct {
	// A list of cues that identify the text spoken in specific time slices of the
	// call.
	Cues []CallNewParamsTranscriptCue `json:"cues,omitzero" api:"required"`
	// contains filtered or unexported fields
}

A transcript of the call.

The property Cues is required.

func (CallNewParamsTranscript) MarshalJSON

func (r CallNewParamsTranscript) MarshalJSON() (data []byte, err error)

func (*CallNewParamsTranscript) UnmarshalJSON

func (r *CallNewParamsTranscript) UnmarshalJSON(data []byte) error

type CallNewParamsTranscriptCue

type CallNewParamsTranscriptCue struct {
	// The start time of the slice, in fractional seconds from the start of the call.
	From float64 `json:"from" api:"required"`
	// The E.164 formatted phone number of the speaker.
	Speaker string `json:"speaker" api:"required"`
	// The text spoken during the slice.
	Text string `json:"text" api:"required"`
	// The end time of the slice, in fractional seconds from the start of the call.
	To float64 `json:"to" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating a `CallTranscriptCue` object to capture the text spoken in a specific time slice.

The properties From, Speaker, Text, To are required.

func (CallNewParamsTranscriptCue) MarshalJSON

func (r CallNewParamsTranscriptCue) MarshalJSON() (data []byte, err error)

func (*CallNewParamsTranscriptCue) UnmarshalJSON

func (r *CallNewParamsTranscriptCue) UnmarshalJSON(data []byte) error

type CallParticipant

type CallParticipant struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The E.164 formatted phone number of the participant.
	Phone string `json:"phone" api:"required"`
	// The role of the participant in the call. Can be `caller`, `callee`, or `other`.
	//
	// Any of "caller", "callee", "other".
	Role CallParticipantRole `json:"role" api:"required"`
	// String representing the object’s type. Always `call_participant` for this
	// object.
	Type constant.CallParticipant `json:"type" default:"call_participant"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Organization ItemPointer `json:"organization"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Person ItemPointer `json:"person"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Phone        respjson.Field
		Role         respjson.Field
		Type         respjson.Field
		Organization respjson.Field
		Person       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a participant in a call.

func (CallParticipant) RawJSON

func (r CallParticipant) RawJSON() string

Returns the unmodified JSON received from the API

func (*CallParticipant) UnmarshalJSON

func (r *CallParticipant) UnmarshalJSON(data []byte) error

type CallParticipantRole

type CallParticipantRole string

The role of the participant in the call. Can be `caller`, `callee`, or `other`.

const (
	CallParticipantRoleCaller CallParticipantRole = "caller"
	CallParticipantRoleCallee CallParticipantRole = "callee"
	CallParticipantRoleOther  CallParticipantRole = "other"
)

type CallPointer

type CallPointer struct {
	ID   string        `json:"id" api:"required"`
	Type constant.Call `json:"type" default:"call"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CallPointer) RawJSON

func (r CallPointer) RawJSON() string

Returns the unmodified JSON received from the API

func (CallPointer) ToParam

func (r CallPointer) ToParam() CallPointerParam

ToParam converts this CallPointer to a CallPointerParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CallPointerParam.Overrides()

func (*CallPointer) UnmarshalJSON

func (r *CallPointer) UnmarshalJSON(data []byte) error

type CallPointerParam

type CallPointerParam struct {
	ID string `json:"id" api:"required"`
	// This field can be elided, and will marshal its zero value as "call".
	Type constant.Call `json:"type" default:"call"`
	// contains filtered or unexported fields
}

The properties ID, Type are required.

func (CallPointerParam) MarshalJSON

func (r CallPointerParam) MarshalJSON() (data []byte, err error)

func (*CallPointerParam) UnmarshalJSON

func (r *CallPointerParam) UnmarshalJSON(data []byte) error

type CallProvider

type CallProvider string

The name of the phone provider that handled the call.

const (
	CallProviderOpenphone CallProvider = "openphone"
	CallProviderUser      CallProvider = "user"
	CallProviderZoomPhone CallProvider = "zoom_phone"
)

type CallService

type CallService struct {
	Options []option.RequestOption
}

View activities and capture calls

CallService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCallService method instead.

func NewCallService

func NewCallService(opts ...option.RequestOption) (r CallService)

NewCallService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CallService) Get

func (r *CallService) Get(ctx context.Context, id string, query CallGetParams, opts ...option.RequestOption) (res *Call, err error)

Retrieves the details of an existing call.

func (*CallService) List

func (r *CallService) List(ctx context.Context, query CallListParams, opts ...option.RequestOption) (res *pagination.CursorPage[Call], err error)

Returns a list of calls.

func (*CallService) ListAutoPaging

Returns a list of calls.

func (*CallService) New

func (r *CallService) New(ctx context.Context, body CallNewParams, opts ...option.RequestOption) (res *Call, err error)

Logs a phone call.

func (*CallService) Upsert

func (r *CallService) Upsert(ctx context.Context, body CallUpsertParams, opts ...option.RequestOption) (res *Call, err error)

Find and update an existing phone call, or create a new one.

type CallTranscript

type CallTranscript struct {
	Cues []CallTranscriptCue `json:"cues" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cues        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CallTranscript) RawJSON

func (r CallTranscript) RawJSON() string

Returns the unmodified JSON received from the API

func (*CallTranscript) UnmarshalJSON

func (r *CallTranscript) UnmarshalJSON(data []byte) error

type CallTranscriptCue

type CallTranscriptCue struct {
	From    float64               `json:"from" api:"required"`
	Speaker CallTranscriptSpeaker `json:"speaker" api:"required"`
	Text    string                `json:"text" api:"required"`
	To      float64               `json:"to" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		From        respjson.Field
		Speaker     respjson.Field
		Text        respjson.Field
		To          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CallTranscriptCue) RawJSON

func (r CallTranscriptCue) RawJSON() string

Returns the unmodified JSON received from the API

func (*CallTranscriptCue) UnmarshalJSON

func (r *CallTranscriptCue) UnmarshalJSON(data []byte) error

type CallTranscriptSpeaker

type CallTranscriptSpeaker struct {
	AttendeeID string `json:"attendee_id"`
	Label      string `json:"label"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AttendeeID  respjson.Field
		Label       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CallTranscriptSpeaker) RawJSON

func (r CallTranscriptSpeaker) RawJSON() string

Returns the unmodified JSON received from the API

func (*CallTranscriptSpeaker) UnmarshalJSON

func (r *CallTranscriptSpeaker) UnmarshalJSON(data []byte) error

type CallUpsertParams

type CallUpsertParams struct {
	// The direction of the call, either `incoming` or `outgoing`.
	//
	// Any of "incoming", "outgoing".
	Direction CallUpsertParamsDirection `json:"direction,omitzero" api:"required"`
	// An array of participants involved in the call.
	Participants []CallUpsertParamsParticipant `json:"participants,omitzero" api:"required"`
	// The name of the phone provider that handled the call (e.g., `openphone`).
	//
	// Any of "openphone", "user", "zoom_phone".
	Provider CallUpsertParamsProvider `json:"provider,omitzero" api:"required"`
	// The unique identifier for the call from the provider's system.
	ProviderID string `json:"provider_id" api:"required"`
	// The status of the call.
	ProviderStatus string `json:"provider_status" api:"required"`
	// The time the call started, as an ISO 8601 timestamp in UTC.
	StartAt time.Time `json:"start_at" api:"required" format:"date-time"`
	// The time the call was answered, as an ISO 8601 timestamp in UTC.
	AnsweredAt param.Opt[time.Time] `json:"answered_at,omitzero" format:"date-time"`
	// The time the call ended, as an ISO 8601 timestamp in UTC.
	EndAt param.Opt[time.Time] `json:"end_at,omitzero" format:"date-time"`
	// A hash of additional metadata from the provider.
	ProviderMetadata map[string]any `json:"provider_metadata,omitzero"`
	// Any recordings associated with the call.
	Recordings []CallUpsertParamsRecording `json:"recordings,omitzero"`
	// Optional list of tag pointers to assign to the call. If omitted, existing tags
	// are unchanged. Pass an empty array to clear tags.
	Tags []shared.TagPointerParam `json:"tags,omitzero"`
	// A transcript of the call.
	Transcript CallUpsertParamsTranscript `json:"transcript,omitzero"`
	// contains filtered or unexported fields
}

func (CallUpsertParams) MarshalJSON

func (r CallUpsertParams) MarshalJSON() (data []byte, err error)

func (*CallUpsertParams) UnmarshalJSON

func (r *CallUpsertParams) UnmarshalJSON(data []byte) error

type CallUpsertParamsDirection

type CallUpsertParamsDirection string

The direction of the call, either `incoming` or `outgoing`.

const (
	CallUpsertParamsDirectionIncoming CallUpsertParamsDirection = "incoming"
	CallUpsertParamsDirectionOutgoing CallUpsertParamsDirection = "outgoing"
)

type CallUpsertParamsParticipant

type CallUpsertParamsParticipant struct {
	// The E.164 formatted phone number of the participant.
	Phone string `json:"phone" api:"required"`
	// The role of the participant in the call. Can be `caller`, `callee`, or `other`.
	//
	// Any of "caller", "callee", "other".
	Role string `json:"role,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating a `Participant` object.

The properties Phone, Role are required.

func (CallUpsertParamsParticipant) MarshalJSON

func (r CallUpsertParamsParticipant) MarshalJSON() (data []byte, err error)

func (*CallUpsertParamsParticipant) UnmarshalJSON

func (r *CallUpsertParamsParticipant) UnmarshalJSON(data []byte) error

type CallUpsertParamsProvider

type CallUpsertParamsProvider string

The name of the phone provider that handled the call (e.g., `openphone`).

const (
	CallUpsertParamsProviderOpenphone CallUpsertParamsProvider = "openphone"
	CallUpsertParamsProviderUser      CallUpsertParamsProvider = "user"
	CallUpsertParamsProviderZoomPhone CallUpsertParamsProvider = "zoom_phone"
)

type CallUpsertParamsRecording

type CallUpsertParamsRecording struct {
	// The content type of the recording. Note that only `audio/mpeg` is supported at
	// this time.
	//
	// Any of "audio/mpeg".
	ContentType string `json:"content_type,omitzero" api:"required"`
	// The unique identifier for the recording from the provider's system.
	ProviderID string `json:"provider_id" api:"required"`
	// The URL pointing to the recording.
	URL string `json:"url" api:"required" format:"uri"`
	// contains filtered or unexported fields
}

Parameters for creating a `CallRecording` object.

The properties ContentType, ProviderID, URL are required.

func (CallUpsertParamsRecording) MarshalJSON

func (r CallUpsertParamsRecording) MarshalJSON() (data []byte, err error)

func (*CallUpsertParamsRecording) UnmarshalJSON

func (r *CallUpsertParamsRecording) UnmarshalJSON(data []byte) error

type CallUpsertParamsTranscript

type CallUpsertParamsTranscript struct {
	// A list of cues that identify the text spoken in specific time slices of the
	// call.
	Cues []CallUpsertParamsTranscriptCue `json:"cues,omitzero" api:"required"`
	// contains filtered or unexported fields
}

A transcript of the call.

The property Cues is required.

func (CallUpsertParamsTranscript) MarshalJSON

func (r CallUpsertParamsTranscript) MarshalJSON() (data []byte, err error)

func (*CallUpsertParamsTranscript) UnmarshalJSON

func (r *CallUpsertParamsTranscript) UnmarshalJSON(data []byte) error

type CallUpsertParamsTranscriptCue

type CallUpsertParamsTranscriptCue struct {
	// The start time of the slice, in fractional seconds from the start of the call.
	From float64 `json:"from" api:"required"`
	// The E.164 formatted phone number of the speaker.
	Speaker string `json:"speaker" api:"required"`
	// The text spoken during the slice.
	Text string `json:"text" api:"required"`
	// The end time of the slice, in fractional seconds from the start of the call.
	To float64 `json:"to" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating a `CallTranscriptCue` object to capture the text spoken in a specific time slice.

The properties From, Speaker, Text, To are required.

func (CallUpsertParamsTranscriptCue) MarshalJSON

func (r CallUpsertParamsTranscriptCue) MarshalJSON() (data []byte, err error)

func (*CallUpsertParamsTranscriptCue) UnmarshalJSON

func (r *CallUpsertParamsTranscriptCue) UnmarshalJSON(data []byte) error

type ChoiceField

type ChoiceField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality ChoiceFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind ChoiceFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Priority").
	Name string `json:"name" api:"required"`
	// A list of `FieldOption` objects representing the available choices for this
	// field.
	Options []ChoiceFieldOption `json:"options" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `priority`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/choice` for this field.
	Type constant.FieldChoice `json:"type" default:"field/choice"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Options       respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores one or more predefined options from a list of choices.

func (ChoiceField) RawJSON

func (r ChoiceField) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChoiceField) UnmarshalJSON

func (r *ChoiceField) UnmarshalJSON(data []byte) error

type ChoiceFieldCardinality

type ChoiceFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	ChoiceFieldCardinalityOne  ChoiceFieldCardinality = "one"
	ChoiceFieldCardinalityMany ChoiceFieldCardinality = "many"
)

type ChoiceFieldKind

type ChoiceFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	ChoiceFieldKindSystem  ChoiceFieldKind = "system"
	ChoiceFieldKindInverse ChoiceFieldKind = "inverse"
	ChoiceFieldKindCustom  ChoiceFieldKind = "custom"
)

type ChoiceFieldOption

type ChoiceFieldOption struct {
	// Unique identifier for the option.
	ID string `json:"id" api:"required"`
	// The color of the option.
	//
	// Any of "amber", "blue", "cyan", "emerald", "fuchsia", "green", "indigo", "lime",
	// "lunar", "orange", "pink", "purple", "red", "rose", "sky", "teal", "violet",
	// "yellow".
	Color ChoiceFieldOptionColor `json:"color" api:"required"`
	// The human-readable text displayed for this option.
	Name string `json:"name" api:"required"`
	// String representing the object’s type. Always `choice_field_option` for this
	// object.
	Type constant.ChoiceFieldOption `json:"type" default:"choice_field_option"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Color       respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a single selectable option within a choice field.

func (ChoiceFieldOption) RawJSON

func (r ChoiceFieldOption) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChoiceFieldOption) UnmarshalJSON

func (r *ChoiceFieldOption) UnmarshalJSON(data []byte) error

type ChoiceFieldOptionColor

type ChoiceFieldOptionColor string

The color of the option.

const (
	ChoiceFieldOptionColorAmber   ChoiceFieldOptionColor = "amber"
	ChoiceFieldOptionColorBlue    ChoiceFieldOptionColor = "blue"
	ChoiceFieldOptionColorCyan    ChoiceFieldOptionColor = "cyan"
	ChoiceFieldOptionColorEmerald ChoiceFieldOptionColor = "emerald"
	ChoiceFieldOptionColorFuchsia ChoiceFieldOptionColor = "fuchsia"
	ChoiceFieldOptionColorGreen   ChoiceFieldOptionColor = "green"
	ChoiceFieldOptionColorIndigo  ChoiceFieldOptionColor = "indigo"
	ChoiceFieldOptionColorLime    ChoiceFieldOptionColor = "lime"
	ChoiceFieldOptionColorLunar   ChoiceFieldOptionColor = "lunar"
	ChoiceFieldOptionColorOrange  ChoiceFieldOptionColor = "orange"
	ChoiceFieldOptionColorPink    ChoiceFieldOptionColor = "pink"
	ChoiceFieldOptionColorPurple  ChoiceFieldOptionColor = "purple"
	ChoiceFieldOptionColorRed     ChoiceFieldOptionColor = "red"
	ChoiceFieldOptionColorRose    ChoiceFieldOptionColor = "rose"
	ChoiceFieldOptionColorSky     ChoiceFieldOptionColor = "sky"
	ChoiceFieldOptionColorTeal    ChoiceFieldOptionColor = "teal"
	ChoiceFieldOptionColorViolet  ChoiceFieldOptionColor = "violet"
	ChoiceFieldOptionColorYellow  ChoiceFieldOptionColor = "yellow"
)

type ChoiceFieldOptionPointerParam

type ChoiceFieldOptionPointerParam struct {
	ID string `json:"id" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "choice_field_option".
	Type constant.ChoiceFieldOption `json:"type" default:"choice_field_option"`
	// contains filtered or unexported fields
}

The properties ID, Type are required.

func (ChoiceFieldOptionPointerParam) MarshalJSON

func (r ChoiceFieldOptionPointerParam) MarshalJSON() (data []byte, err error)

func (*ChoiceFieldOptionPointerParam) UnmarshalJSON

func (r *ChoiceFieldOptionPointerParam) UnmarshalJSON(data []byte) error

type ChoiceValue

type ChoiceValue struct {
	// An option that must match one of the predefined options for the field.
	Data ChoiceFieldOption    `json:"data" api:"required"`
	Type constant.ValueChoice `json:"type" default:"value/choice"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Selected choice option

func (ChoiceValue) RawJSON

func (r ChoiceValue) RawJSON() string

Returns the unmodified JSON received from the API

func (*ChoiceValue) UnmarshalJSON

func (r *ChoiceValue) UnmarshalJSON(data []byte) error

type ChoiceValueParam

type ChoiceValueParam struct {
	// An option that must match one of the predefined options for the field.
	Data ChoiceFieldOptionPointerParam `json:"data,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "value/choice".
	Type constant.ValueChoice `json:"type" default:"value/choice"`
	// contains filtered or unexported fields
}

Selected choice option

The properties Data, Type are required.

func (ChoiceValueParam) MarshalJSON

func (r ChoiceValueParam) MarshalJSON() (data []byte, err error)

func (*ChoiceValueParam) UnmarshalJSON

func (r *ChoiceValueParam) UnmarshalJSON(data []byte) error

type Client

type Client struct {
	Options []option.RequestOption
	// Manage your collections and items
	Funnels FunnelService
	// Manage your collections and items
	Collections CollectionService
	// Manage your collections and items
	Views ViewService
	// Manage your inboxes, conversations, and messages
	Inboxes InboxService
	// Manage your inboxes, conversations, and messages
	InboxConversations InboxConversationService
	// Manage your inboxes, conversations, and messages
	InboxMessages InboxMessageService
	// Manage your meetings, files, and notes
	Tagsets TagsetService
	// Manage your marketing campaigns and forms
	Programs ProgramService
	// Manage your marketing campaigns and forms
	ProgramTemplates ProgramTemplateService
	// Manage your marketing campaigns and forms
	ProgramMessages ProgramMessageService
	// Manage your marketing campaigns and forms
	Forms FormService
	// Manage your marketing campaigns and forms
	Unsubscribes UnsubscribeService
	// View activities and capture calls
	Activities ActivityService
	// View activities and capture calls
	Calls CallService
	// Manage your meetings, files, and notes
	Files FileService
	// Manage your meetings, files, and notes
	Meetings MeetingService
	// Manage your meetings, files, and notes
	Notes            NoteService
	WebhookEndpoints WebhookEndpointService
	AgentSettings    AgentSettingService
}

Client creates a struct with services and top level methods that help with interacting with the Moonbase API. You should not instantiate this client directly, and instead use the NewClient method instead.

func NewClient

func NewClient(opts ...option.RequestOption) (r Client)

NewClient generates a new client with the default option read from the environment (MOONBASE_API_KEY, MOONBASE_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.

func (*Client) Delete

func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Execute

func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error

Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.

If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.

The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.

If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.

Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.

The response body will be deserialized into the res variable, depending on its type:

  • A pointer to a *http.Response is populated by the raw response.
  • A pointer to a byte array will be populated with the contents of the request body.
  • A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
  • A nil value will not read the response body.

For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.

func (*Client) Get

func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Patch

func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Search

func (r *Client) Search(ctx context.Context, body SearchParams, opts ...option.RequestOption) (res *SearchResponse, err error)

Returns items and files that match the search query.

type Collection

type Collection struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// A list of `Field` objects that define the schema for items in this collection.
	Fields []FieldUnion `json:"fields" api:"required"`
	// `system` collections are managed by Moonbase (e.g., People, Organizations),
	// `form` collections back a Form, and `custom` collections are user-created.
	//
	// Any of "system", "form", "custom".
	Kind CollectionKind `json:"kind" api:"required"`
	// The user-facing name of the collection (e.g., “Organizations”).
	Name string `json:"name" api:"required"`
	// A unique, stable, machine-readable identifier for the collection. This reference
	// is used in API requests and does not change even if the `name` is updated.
	Ref string `json:"ref" api:"required"`
	// String representing the object’s type. Always `collection` for this object.
	Type constant.Collection `json:"type" default:"collection"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the collection's purpose.
	Description string `json:"description"`
	// The collection's icon, as a Phosphor icon name in kebab-case (e.g. `users`,
	// `chart-bar`). Only present when an icon is set.
	IconName string `json:"icon_name"`
	// A list of saved `View` objects for presenting the collection's data.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Views []CollectionView `json:"views"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Fields      respjson.Field
		Kind        respjson.Field
		Name        respjson.Field
		Ref         respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		Description respjson.Field
		IconName    respjson.Field
		Views       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Collection is a container for structured data, similar to a database table or spreadsheet. It defines a schema using a set of `Fields` and holds the data as a list of `Items`.

func (Collection) RawJSON

func (r Collection) RawJSON() string

Returns the unmodified JSON received from the API

func (*Collection) UnmarshalJSON

func (r *Collection) UnmarshalJSON(data []byte) error

type CollectionFieldDeleteParams

type CollectionFieldDeleteParams struct {
	CollectionID string `path:"collection_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type CollectionFieldGetParams

type CollectionFieldGetParams struct {
	CollectionID string `path:"collection_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type CollectionFieldNewParams

type CollectionFieldNewParams struct {

	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a single-line text field.
	OfFieldTextSingleLine *CollectionFieldNewParamsFieldFieldTextSingleLine `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a multi-line text field.
	OfFieldTextMultiLine *CollectionFieldNewParamsFieldFieldTextMultiLine `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfFieldIdentifier *CollectionFieldNewParamsFieldFieldIdentifier `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating an integer field.
	OfFieldNumberUnitlessInteger *CollectionFieldNewParamsFieldFieldNumberUnitlessInteger `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a decimal number field.
	OfFieldNumberUnitlessFloat *CollectionFieldNewParamsFieldFieldNumberUnitlessFloat `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a monetary field.
	OfFieldNumberMonetary *CollectionFieldNewParamsFieldFieldNumberMonetary `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a percentage field.
	OfFieldNumberPercentage *CollectionFieldNewParamsFieldFieldNumberPercentage `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a boolean field.
	OfFieldBoolean *CollectionFieldNewParamsFieldFieldBoolean `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating an email field.
	OfFieldEmail *CollectionFieldNewParamsFieldFieldEmail `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a URL field.
	OfFieldUriURL *CollectionFieldNewParamsFieldFieldUriURL `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a domain field.
	OfFieldUriDomain *CollectionFieldNewParamsFieldFieldUriDomain `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating an X (formerly Twitter) profile field.
	OfFieldUriSocialX *CollectionFieldNewParamsFieldFieldUriSocialX `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a LinkedIn profile field.
	OfFieldUriSocialLinkedIn *CollectionFieldNewParamsFieldFieldUriSocialLinkedIn `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a telephone number field.
	OfFieldTelephoneNumber *CollectionFieldNewParamsFieldFieldTelephoneNumber `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a geographic location field.
	OfFieldGeo *CollectionFieldNewParamsFieldFieldGeo `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a date field.
	OfFieldDate *CollectionFieldNewParamsFieldFieldDate `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a date and time field.
	OfFieldDatetime *CollectionFieldNewParamsFieldFieldDatetime `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a choice field with predefined options.
	OfFieldChoice *CollectionFieldNewParamsFieldFieldChoice `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a stage field.
	OfFieldStage *StageFieldCreateParams `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a relation field that links items across collections.
	OfFieldRelation *CollectionFieldNewParamsFieldFieldRelation `json:",inline"`
	// contains filtered or unexported fields
}

func (CollectionFieldNewParams) MarshalJSON

func (u CollectionFieldNewParams) MarshalJSON() ([]byte, error)

func (*CollectionFieldNewParams) UnmarshalJSON

func (r *CollectionFieldNewParams) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldBoolean

type CollectionFieldNewParamsFieldFieldBoolean struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string              `json:"cardinality,omitzero"`
	DefaultValues []BooleanValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/boolean`.
	//
	// This field can be elided, and will marshal its zero value as "field/boolean".
	Type constant.FieldBoolean `json:"type" default:"field/boolean"`
	// contains filtered or unexported fields
}

Parameters for creating a boolean field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldBoolean) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldBoolean) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldBoolean) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldBoolean) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldChoice

type CollectionFieldNewParamsFieldFieldChoice struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// A list of options to create for the field. Each option must have a `name`.
	Options []CollectionFieldNewParamsFieldFieldChoiceOption `json:"options,omitzero" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string             `json:"cardinality,omitzero"`
	DefaultValues []ChoiceValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/choice`.
	//
	// This field can be elided, and will marshal its zero value as "field/choice".
	Type constant.FieldChoice `json:"type" default:"field/choice"`
	// contains filtered or unexported fields
}

Parameters for creating a choice field with predefined options.

The properties Name, Options, Type are required.

func (CollectionFieldNewParamsFieldFieldChoice) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldChoice) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldChoice) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldChoice) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldChoiceOption

type CollectionFieldNewParamsFieldFieldChoiceOption struct {
	// The color of the option.
	//
	// Any of "amber", "blue", "cyan", "emerald", "fuchsia", "green", "indigo", "lime",
	// "lunar", "orange", "pink", "purple", "red", "rose", "sky", "teal", "violet",
	// "yellow".
	Color string `json:"color,omitzero" api:"required"`
	// The display name of the option.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

Parameters for defining an option in a choice field.

The properties Color, Name are required.

func (CollectionFieldNewParamsFieldFieldChoiceOption) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldChoiceOption) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldChoiceOption) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldDate

type CollectionFieldNewParamsFieldFieldDate struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string                            `json:"cardinality,omitzero"`
	DefaultValues []DateFieldDefaultValueParamUnion `json:"default_values,omitzero"`
	// The field type. Must be `field/date`.
	//
	// This field can be elided, and will marshal its zero value as "field/date".
	Type constant.FieldDate `json:"type" default:"field/date"`
	// contains filtered or unexported fields
}

Parameters for creating a date field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldDate) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldDate) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldDate) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldDate) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldDatetime

type CollectionFieldNewParamsFieldFieldDatetime struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string                                `json:"cardinality,omitzero"`
	DefaultValues []DatetimeFieldDefaultValueParamUnion `json:"default_values,omitzero"`
	// The field type. Must be `field/datetime`.
	//
	// This field can be elided, and will marshal its zero value as "field/datetime".
	Type constant.FieldDatetime `json:"type" default:"field/datetime"`
	// contains filtered or unexported fields
}

Parameters for creating a date and time field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldDatetime) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldDatetime) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldDatetime) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldDatetime) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldEmail

type CollectionFieldNewParamsFieldFieldEmail struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string            `json:"cardinality,omitzero"`
	DefaultValues []EmailValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/email`.
	//
	// This field can be elided, and will marshal its zero value as "field/email".
	Type constant.FieldEmail `json:"type" default:"field/email"`
	// contains filtered or unexported fields
}

Parameters for creating an email field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldEmail) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldEmail) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldEmail) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldEmail) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldGeo

type CollectionFieldNewParamsFieldFieldGeo struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string          `json:"cardinality,omitzero"`
	DefaultValues []GeoValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/geo`.
	//
	// This field can be elided, and will marshal its zero value as "field/geo".
	Type constant.FieldGeo `json:"type" default:"field/geo"`
	// contains filtered or unexported fields
}

Parameters for creating a geographic location field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldGeo) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldGeo) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldGeo) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldGeo) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldIdentifier

type CollectionFieldNewParamsFieldFieldIdentifier struct {
	Name        string            `json:"name" api:"required"`
	Description param.Opt[string] `json:"description,omitzero"`
	Required    param.Opt[bool]   `json:"required,omitzero"`
	Unique      param.Opt[bool]   `json:"unique,omitzero"`
	// Any of "one", "many".
	Cardinality   string                 `json:"cardinality,omitzero"`
	DefaultValues []IdentifierValueParam `json:"default_values,omitzero"`
	// This field can be elided, and will marshal its zero value as "field/identifier".
	Type constant.FieldIdentifier `json:"type" default:"field/identifier"`
	// contains filtered or unexported fields
}

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldIdentifier) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldIdentifier) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldIdentifier) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldIdentifier) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldNumberMonetary

type CollectionFieldNewParamsFieldFieldNumberMonetary struct {
	// The default currency for the field, as a 3-letter uppercase ISO 4217 code (e.g.,
	// `USD`, `EUR`, `GBP`).
	DefaultUnit string `json:"default_unit" api:"required"`
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string               `json:"cardinality,omitzero"`
	DefaultValues []MonetaryValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/number/monetary`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/number/monetary".
	Type constant.FieldNumberMonetary `json:"type" default:"field/number/monetary"`
	// contains filtered or unexported fields
}

Parameters for creating a monetary field.

The properties DefaultUnit, Name, Type are required.

func (CollectionFieldNewParamsFieldFieldNumberMonetary) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldNumberMonetary) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldNumberMonetary) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldNumberPercentage

type CollectionFieldNewParamsFieldFieldNumberPercentage struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string                 `json:"cardinality,omitzero"`
	DefaultValues []PercentageValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/number/percentage`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/number/percentage".
	Type constant.FieldNumberPercentage `json:"type" default:"field/number/percentage"`
	// contains filtered or unexported fields
}

Parameters for creating a percentage field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldNumberPercentage) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldNumberPercentage) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldNumberPercentage) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldNumberUnitlessFloat

type CollectionFieldNewParamsFieldFieldNumberUnitlessFloat struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string            `json:"cardinality,omitzero"`
	DefaultValues []FloatValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/number/unitless_float`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/number/unitless_float".
	Type constant.FieldNumberUnitlessFloat `json:"type" default:"field/number/unitless_float"`
	// contains filtered or unexported fields
}

Parameters for creating a decimal number field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldNumberUnitlessFloat) MarshalJSON

func (*CollectionFieldNewParamsFieldFieldNumberUnitlessFloat) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldNumberUnitlessInteger

type CollectionFieldNewParamsFieldFieldNumberUnitlessInteger struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string              `json:"cardinality,omitzero"`
	DefaultValues []IntegerValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/number/unitless_integer`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/number/unitless_integer".
	Type constant.FieldNumberUnitlessInteger `json:"type" default:"field/number/unitless_integer"`
	// contains filtered or unexported fields
}

Parameters for creating an integer field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldNumberUnitlessInteger) MarshalJSON

func (*CollectionFieldNewParamsFieldFieldNumberUnitlessInteger) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldRelation

type CollectionFieldNewParamsFieldFieldRelation struct {
	// A list of collection IDs or `ref` values that are valid targets for this
	// relation.
	AllowedCollections []CollectionFieldNewParamsFieldFieldRelationAllowedCollection `json:"allowed_collections,omitzero" api:"required"`
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// The type of relationship: `one_way` for simple references, or `two_way` for
	// bidirectional relationships.
	//
	// Any of "one_way", "two_way".
	RelationType string `json:"relation_type,omitzero" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// For `two_way` relations, the name of the reverse field created on the target
	// collection.
	ReverseFieldName param.Opt[string] `json:"reverse_field_name,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string                                `json:"cardinality,omitzero"`
	DefaultValues []RelationFieldDefaultValueParamUnion `json:"default_values,omitzero"`
	// The field type. Must be `field/relation`.
	//
	// This field can be elided, and will marshal its zero value as "field/relation".
	Type constant.FieldRelation `json:"type" default:"field/relation"`
	// contains filtered or unexported fields
}

Parameters for creating a relation field that links items across collections.

The properties AllowedCollections, Name, RelationType, Type are required.

func (CollectionFieldNewParamsFieldFieldRelation) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldRelation) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldRelation) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldRelation) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldRelationAllowedCollection

type CollectionFieldNewParamsFieldFieldRelationAllowedCollection struct {
	// Unique identifier of the collection.
	ID param.Opt[string] `json:"id,omitzero"`
	// The stable, machine-readable reference identifier of the collection.
	Ref param.Opt[string] `json:"ref,omitzero"`
	// String representing the object’s type. Always `collection` for this object.
	//
	// This field can be elided, and will marshal its zero value as "collection".
	Type constant.Collection `json:"type" default:"collection"`
	// contains filtered or unexported fields
}

A reference to a `Collection` used in request bodies. Provide at least one of `id` or `ref` to identify the collection.

The property Type is required.

func (CollectionFieldNewParamsFieldFieldRelationAllowedCollection) MarshalJSON

func (*CollectionFieldNewParamsFieldFieldRelationAllowedCollection) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldTelephoneNumber

type CollectionFieldNewParamsFieldFieldTelephoneNumber struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string                 `json:"cardinality,omitzero"`
	DefaultValues []TelephoneNumberParam `json:"default_values,omitzero"`
	// The field type. Must be `field/telephone_number`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/telephone_number".
	Type constant.FieldTelephoneNumber `json:"type" default:"field/telephone_number"`
	// contains filtered or unexported fields
}

Parameters for creating a telephone number field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldTelephoneNumber) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldTelephoneNumber) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldTelephoneNumber) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldTextMultiLine

type CollectionFieldNewParamsFieldFieldTextMultiLine struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string                    `json:"cardinality,omitzero"`
	DefaultValues []MultiLineTextValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/text/multi_line`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/text/multi_line".
	Type constant.FieldTextMultiLine `json:"type" default:"field/text/multi_line"`
	// contains filtered or unexported fields
}

Parameters for creating a multi-line text field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldTextMultiLine) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldTextMultiLine) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldTextMultiLine) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldTextSingleLine

type CollectionFieldNewParamsFieldFieldTextSingleLine struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string                     `json:"cardinality,omitzero"`
	DefaultValues []SingleLineTextValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/text/single_line`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/text/single_line".
	Type constant.FieldTextSingleLine `json:"type" default:"field/text/single_line"`
	// contains filtered or unexported fields
}

Parameters for creating a single-line text field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldTextSingleLine) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldTextSingleLine) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldTextSingleLine) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldUriDomain

type CollectionFieldNewParamsFieldFieldUriDomain struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string             `json:"cardinality,omitzero"`
	DefaultValues []DomainValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/uri/domain`.
	//
	// This field can be elided, and will marshal its zero value as "field/uri/domain".
	Type constant.FieldUriDomain `json:"type" default:"field/uri/domain"`
	// contains filtered or unexported fields
}

Parameters for creating a domain field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldUriDomain) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldUriDomain) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldUriDomain) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldUriDomain) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldUriSocialLinkedIn

type CollectionFieldNewParamsFieldFieldUriSocialLinkedIn struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string                     `json:"cardinality,omitzero"`
	DefaultValues []SocialLinkedInValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/uri/social_linked_in`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/uri/social_linked_in".
	Type constant.FieldUriSocialLinkedIn `json:"type" default:"field/uri/social_linked_in"`
	// contains filtered or unexported fields
}

Parameters for creating a LinkedIn profile field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldUriSocialLinkedIn) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldUriSocialLinkedIn) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldUriSocialLinkedIn) UnmarshalJSON

type CollectionFieldNewParamsFieldFieldUriSocialX

type CollectionFieldNewParamsFieldFieldUriSocialX struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string              `json:"cardinality,omitzero"`
	DefaultValues []SocialXValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/uri/social_x`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/uri/social_x".
	Type constant.FieldUriSocialX `json:"type" default:"field/uri/social_x"`
	// contains filtered or unexported fields
}

Parameters for creating an X (formerly Twitter) profile field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldUriSocialX) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldUriSocialX) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldUriSocialX) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldUriSocialX) UnmarshalJSON(data []byte) error

type CollectionFieldNewParamsFieldFieldUriURL

type CollectionFieldNewParamsFieldFieldUriURL struct {
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   string          `json:"cardinality,omitzero"`
	DefaultValues []URLValueParam `json:"default_values,omitzero"`
	// The field type. Must be `field/uri/url`.
	//
	// This field can be elided, and will marshal its zero value as "field/uri/url".
	Type constant.FieldUriURL `json:"type" default:"field/uri/url"`
	// contains filtered or unexported fields
}

Parameters for creating a URL field.

The properties Name, Type are required.

func (CollectionFieldNewParamsFieldFieldUriURL) MarshalJSON

func (r CollectionFieldNewParamsFieldFieldUriURL) MarshalJSON() (data []byte, err error)

func (*CollectionFieldNewParamsFieldFieldUriURL) UnmarshalJSON

func (r *CollectionFieldNewParamsFieldFieldUriURL) UnmarshalJSON(data []byte) error

type CollectionFieldService

type CollectionFieldService struct {
	Options []option.RequestOption
}

Manage your collections and items

CollectionFieldService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCollectionFieldService method instead.

func NewCollectionFieldService

func NewCollectionFieldService(opts ...option.RequestOption) (r CollectionFieldService)

NewCollectionFieldService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CollectionFieldService) Delete

Permanently deletes a field from a collection.

func (*CollectionFieldService) Get

Retrieves the details of a field in a collection.

func (*CollectionFieldService) New

func (r *CollectionFieldService) New(ctx context.Context, collectionID string, body CollectionFieldNewParams, opts ...option.RequestOption) (res *FieldUnion, err error)

Creates a new field in a collection.

func (*CollectionFieldService) Update

Updates an existing field in a collection.

type CollectionFieldUpdateParams

type CollectionFieldUpdateParams struct {
	CollectionID string `path:"collection_id" api:"required" json:"-"`

	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a single-line text field.
	OfFieldTextSingleLine *CollectionFieldUpdateParamsFieldFieldTextSingleLine `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a multi-line text field.
	OfFieldTextMultiLine *CollectionFieldUpdateParamsFieldFieldTextMultiLine `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	OfFieldIdentifier *CollectionFieldUpdateParamsFieldFieldIdentifier `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating an integer field.
	OfFieldNumberUnitlessInteger *CollectionFieldUpdateParamsFieldFieldNumberUnitlessInteger `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a decimal number field.
	OfFieldNumberUnitlessFloat *CollectionFieldUpdateParamsFieldFieldNumberUnitlessFloat `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a monetary field.
	OfFieldNumberMonetary *CollectionFieldUpdateParamsFieldFieldNumberMonetary `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a percentage field.
	OfFieldNumberPercentage *CollectionFieldUpdateParamsFieldFieldNumberPercentage `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a boolean field.
	OfFieldBoolean *CollectionFieldUpdateParamsFieldFieldBoolean `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating an email field.
	OfFieldEmail *CollectionFieldUpdateParamsFieldFieldEmail `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a URL field.
	OfFieldUriURL *CollectionFieldUpdateParamsFieldFieldUriURL `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a domain field.
	OfFieldUriDomain *CollectionFieldUpdateParamsFieldFieldUriDomain `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating an X (formerly Twitter) profile field.
	OfFieldUriSocialX *CollectionFieldUpdateParamsFieldFieldUriSocialX `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a LinkedIn profile field.
	OfFieldUriSocialLinkedIn *CollectionFieldUpdateParamsFieldFieldUriSocialLinkedIn `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a telephone number field.
	OfFieldTelephoneNumber *CollectionFieldUpdateParamsFieldFieldTelephoneNumber `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a geographic location field.
	OfFieldGeo *CollectionFieldUpdateParamsFieldFieldGeo `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a date field.
	OfFieldDate *CollectionFieldUpdateParamsFieldFieldDate `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a date and time field.
	OfFieldDatetime *CollectionFieldUpdateParamsFieldFieldDatetime `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a choice field.
	OfFieldChoice *CollectionFieldUpdateParamsFieldFieldChoice `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a stage field.
	OfFieldStage *StageFieldUpdateParams `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a relation field.
	OfFieldRelation *CollectionFieldUpdateParamsFieldFieldRelation `json:",inline"`
	// contains filtered or unexported fields
}

func (CollectionFieldUpdateParams) MarshalJSON

func (u CollectionFieldUpdateParams) MarshalJSON() ([]byte, error)

func (*CollectionFieldUpdateParams) UnmarshalJSON

func (r *CollectionFieldUpdateParams) UnmarshalJSON(data []byte) error

type CollectionFieldUpdateParamsFieldFieldBoolean

type CollectionFieldUpdateParamsFieldFieldBoolean struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]     `json:"unique,omitzero"`
	DefaultValues []BooleanValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/boolean`.
	//
	// This field can be elided, and will marshal its zero value as "field/boolean".
	Type constant.FieldBoolean `json:"type" default:"field/boolean"`
	// contains filtered or unexported fields
}

Parameters for updating a boolean field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldBoolean) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldBoolean) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldBoolean) UnmarshalJSON

func (r *CollectionFieldUpdateParamsFieldFieldBoolean) UnmarshalJSON(data []byte) error

type CollectionFieldUpdateParamsFieldFieldChoice

type CollectionFieldUpdateParamsFieldFieldChoice struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]    `json:"unique,omitzero"`
	DefaultValues []ChoiceValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The complete set of options for this field. Omit to leave unchanged. Array order
	// determines display order.
	Options []CollectionFieldUpdateParamsFieldFieldChoiceOption `json:"options,omitzero"`
	// The field type. Must be `field/choice`.
	//
	// This field can be elided, and will marshal its zero value as "field/choice".
	Type constant.FieldChoice `json:"type" default:"field/choice"`
	// contains filtered or unexported fields
}

Parameters for updating a choice field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldChoice) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldChoice) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldChoice) UnmarshalJSON

func (r *CollectionFieldUpdateParamsFieldFieldChoice) UnmarshalJSON(data []byte) error

type CollectionFieldUpdateParamsFieldFieldChoiceOption

type CollectionFieldUpdateParamsFieldFieldChoiceOption struct {
	// The color of the option.
	//
	// Any of "amber", "blue", "cyan", "emerald", "fuchsia", "green", "indigo", "lime",
	// "lunar", "orange", "pink", "purple", "red", "rose", "sky", "teal", "violet",
	// "yellow".
	Color string `json:"color,omitzero" api:"required"`
	// The display name of the option.
	Name string `json:"name" api:"required"`
	// The ID of an existing option to update. When absent, a new option is created.
	ID param.Opt[string] `json:"id,omitzero"`
	// contains filtered or unexported fields
}

A choice field option. Items with an `id` update existing options; items without an `id` are added as new options.

The properties Color, Name are required.

func (CollectionFieldUpdateParamsFieldFieldChoiceOption) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldChoiceOption) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldChoiceOption) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldDate

type CollectionFieldUpdateParamsFieldFieldDate struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]                   `json:"unique,omitzero"`
	DefaultValues []DateFieldDefaultValueParamUnion `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/date`.
	//
	// This field can be elided, and will marshal its zero value as "field/date".
	Type constant.FieldDate `json:"type" default:"field/date"`
	// contains filtered or unexported fields
}

Parameters for updating a date field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldDate) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldDate) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldDate) UnmarshalJSON

func (r *CollectionFieldUpdateParamsFieldFieldDate) UnmarshalJSON(data []byte) error

type CollectionFieldUpdateParamsFieldFieldDatetime

type CollectionFieldUpdateParamsFieldFieldDatetime struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]                       `json:"unique,omitzero"`
	DefaultValues []DatetimeFieldDefaultValueParamUnion `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/datetime`.
	//
	// This field can be elided, and will marshal its zero value as "field/datetime".
	Type constant.FieldDatetime `json:"type" default:"field/datetime"`
	// contains filtered or unexported fields
}

Parameters for updating a date and time field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldDatetime) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldDatetime) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldDatetime) UnmarshalJSON

func (r *CollectionFieldUpdateParamsFieldFieldDatetime) UnmarshalJSON(data []byte) error

type CollectionFieldUpdateParamsFieldFieldEmail

type CollectionFieldUpdateParamsFieldFieldEmail struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]   `json:"unique,omitzero"`
	DefaultValues []EmailValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/email`.
	//
	// This field can be elided, and will marshal its zero value as "field/email".
	Type constant.FieldEmail `json:"type" default:"field/email"`
	// contains filtered or unexported fields
}

Parameters for updating an email field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldEmail) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldEmail) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldEmail) UnmarshalJSON

func (r *CollectionFieldUpdateParamsFieldFieldEmail) UnmarshalJSON(data []byte) error

type CollectionFieldUpdateParamsFieldFieldGeo

type CollectionFieldUpdateParamsFieldFieldGeo struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool] `json:"unique,omitzero"`
	DefaultValues []GeoValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/geo`.
	//
	// This field can be elided, and will marshal its zero value as "field/geo".
	Type constant.FieldGeo `json:"type" default:"field/geo"`
	// contains filtered or unexported fields
}

Parameters for updating a geographic location field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldGeo) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldGeo) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldGeo) UnmarshalJSON

func (r *CollectionFieldUpdateParamsFieldFieldGeo) UnmarshalJSON(data []byte) error

type CollectionFieldUpdateParamsFieldFieldIdentifier

type CollectionFieldUpdateParamsFieldFieldIdentifier struct {
	Description   param.Opt[string]      `json:"description,omitzero"`
	Name          param.Opt[string]      `json:"name,omitzero"`
	Required      param.Opt[bool]        `json:"required,omitzero"`
	Unique        param.Opt[bool]        `json:"unique,omitzero"`
	DefaultValues []IdentifierValueParam `json:"default_values,omitzero"`
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// This field can be elided, and will marshal its zero value as "field/identifier".
	Type constant.FieldIdentifier `json:"type" default:"field/identifier"`
	// contains filtered or unexported fields
}

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldIdentifier) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldIdentifier) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldIdentifier) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldNumberMonetary

type CollectionFieldUpdateParamsFieldFieldNumberMonetary struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The default currency for the field, as a 3-letter ISO 4217 code (e.g., `USD`,
	// `EUR`, `GBP`).
	DefaultUnit param.Opt[string] `json:"default_unit,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]      `json:"unique,omitzero"`
	DefaultValues []MonetaryValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/number/monetary`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/number/monetary".
	Type constant.FieldNumberMonetary `json:"type" default:"field/number/monetary"`
	// contains filtered or unexported fields
}

Parameters for updating a monetary field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldNumberMonetary) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldNumberMonetary) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldNumberMonetary) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldNumberPercentage

type CollectionFieldUpdateParamsFieldFieldNumberPercentage struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]        `json:"unique,omitzero"`
	DefaultValues []PercentageValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/number/percentage`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/number/percentage".
	Type constant.FieldNumberPercentage `json:"type" default:"field/number/percentage"`
	// contains filtered or unexported fields
}

Parameters for updating a percentage field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldNumberPercentage) MarshalJSON

func (*CollectionFieldUpdateParamsFieldFieldNumberPercentage) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldNumberUnitlessFloat

type CollectionFieldUpdateParamsFieldFieldNumberUnitlessFloat struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]   `json:"unique,omitzero"`
	DefaultValues []FloatValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/number/unitless_float`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/number/unitless_float".
	Type constant.FieldNumberUnitlessFloat `json:"type" default:"field/number/unitless_float"`
	// contains filtered or unexported fields
}

Parameters for updating a decimal number field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldNumberUnitlessFloat) MarshalJSON

func (*CollectionFieldUpdateParamsFieldFieldNumberUnitlessFloat) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldNumberUnitlessInteger

type CollectionFieldUpdateParamsFieldFieldNumberUnitlessInteger struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]     `json:"unique,omitzero"`
	DefaultValues []IntegerValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/number/unitless_integer`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/number/unitless_integer".
	Type constant.FieldNumberUnitlessInteger `json:"type" default:"field/number/unitless_integer"`
	// contains filtered or unexported fields
}

Parameters for updating an integer field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldNumberUnitlessInteger) MarshalJSON

func (*CollectionFieldUpdateParamsFieldFieldNumberUnitlessInteger) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldRelation

type CollectionFieldUpdateParamsFieldFieldRelation struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]                       `json:"unique,omitzero"`
	DefaultValues []RelationFieldDefaultValueParamUnion `json:"default_values,omitzero"`
	// The complete set of allowed collections. Omit to leave unchanged. Array replaces
	// the current set.
	AllowedCollections []CollectionFieldUpdateParamsFieldFieldRelationAllowedCollection `json:"allowed_collections,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The type of relationship: `one_way` for simple references, or `two_way` for
	// bidirectional relationships.
	//
	// Any of "one_way", "two_way".
	RelationType string `json:"relation_type,omitzero"`
	// The field type. Must be `field/relation`.
	//
	// This field can be elided, and will marshal its zero value as "field/relation".
	Type constant.FieldRelation `json:"type" default:"field/relation"`
	// contains filtered or unexported fields
}

Parameters for updating a relation field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldRelation) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldRelation) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldRelation) UnmarshalJSON

func (r *CollectionFieldUpdateParamsFieldFieldRelation) UnmarshalJSON(data []byte) error

type CollectionFieldUpdateParamsFieldFieldRelationAllowedCollection

type CollectionFieldUpdateParamsFieldFieldRelationAllowedCollection struct {
	// Unique identifier of the collection.
	ID param.Opt[string] `json:"id,omitzero"`
	// The stable, machine-readable reference identifier of the collection.
	Ref param.Opt[string] `json:"ref,omitzero"`
	// String representing the object’s type. Always `collection` for this object.
	//
	// This field can be elided, and will marshal its zero value as "collection".
	Type constant.Collection `json:"type" default:"collection"`
	// contains filtered or unexported fields
}

A reference to a `Collection` used in request bodies. Provide at least one of `id` or `ref` to identify the collection.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldRelationAllowedCollection) MarshalJSON

func (*CollectionFieldUpdateParamsFieldFieldRelationAllowedCollection) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldTelephoneNumber

type CollectionFieldUpdateParamsFieldFieldTelephoneNumber struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]        `json:"unique,omitzero"`
	DefaultValues []TelephoneNumberParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/telephone_number`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/telephone_number".
	Type constant.FieldTelephoneNumber `json:"type" default:"field/telephone_number"`
	// contains filtered or unexported fields
}

Parameters for updating a telephone number field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldTelephoneNumber) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldTelephoneNumber) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldTelephoneNumber) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldTextMultiLine

type CollectionFieldUpdateParamsFieldFieldTextMultiLine struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]           `json:"unique,omitzero"`
	DefaultValues []MultiLineTextValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/text/multi_line`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/text/multi_line".
	Type constant.FieldTextMultiLine `json:"type" default:"field/text/multi_line"`
	// contains filtered or unexported fields
}

Parameters for updating a multi-line text field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldTextMultiLine) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldTextMultiLine) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldTextMultiLine) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldTextSingleLine

type CollectionFieldUpdateParamsFieldFieldTextSingleLine struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]            `json:"unique,omitzero"`
	DefaultValues []SingleLineTextValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/text/single_line`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/text/single_line".
	Type constant.FieldTextSingleLine `json:"type" default:"field/text/single_line"`
	// contains filtered or unexported fields
}

Parameters for updating a single-line text field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldTextSingleLine) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldTextSingleLine) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldTextSingleLine) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldUriDomain

type CollectionFieldUpdateParamsFieldFieldUriDomain struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]    `json:"unique,omitzero"`
	DefaultValues []DomainValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/uri/domain`.
	//
	// This field can be elided, and will marshal its zero value as "field/uri/domain".
	Type constant.FieldUriDomain `json:"type" default:"field/uri/domain"`
	// contains filtered or unexported fields
}

Parameters for updating a domain field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldUriDomain) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldUriDomain) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldUriDomain) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldUriSocialLinkedIn

type CollectionFieldUpdateParamsFieldFieldUriSocialLinkedIn struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]            `json:"unique,omitzero"`
	DefaultValues []SocialLinkedInValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/uri/social_linked_in`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/uri/social_linked_in".
	Type constant.FieldUriSocialLinkedIn `json:"type" default:"field/uri/social_linked_in"`
	// contains filtered or unexported fields
}

Parameters for updating a LinkedIn profile field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldUriSocialLinkedIn) MarshalJSON

func (*CollectionFieldUpdateParamsFieldFieldUriSocialLinkedIn) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldUriSocialX

type CollectionFieldUpdateParamsFieldFieldUriSocialX struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]     `json:"unique,omitzero"`
	DefaultValues []SocialXValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/uri/social_x`.
	//
	// This field can be elided, and will marshal its zero value as
	// "field/uri/social_x".
	Type constant.FieldUriSocialX `json:"type" default:"field/uri/social_x"`
	// contains filtered or unexported fields
}

Parameters for updating an X (formerly Twitter) profile field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldUriSocialX) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldUriSocialX) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldUriSocialX) UnmarshalJSON

type CollectionFieldUpdateParamsFieldFieldUriURL

type CollectionFieldUpdateParamsFieldFieldUriURL struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool] `json:"unique,omitzero"`
	DefaultValues []URLValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality string `json:"cardinality,omitzero"`
	// The field type. Must be `field/uri/url`.
	//
	// This field can be elided, and will marshal its zero value as "field/uri/url".
	Type constant.FieldUriURL `json:"type" default:"field/uri/url"`
	// contains filtered or unexported fields
}

Parameters for updating a URL field.

The property Type is required.

func (CollectionFieldUpdateParamsFieldFieldUriURL) MarshalJSON

func (r CollectionFieldUpdateParamsFieldFieldUriURL) MarshalJSON() (data []byte, err error)

func (*CollectionFieldUpdateParamsFieldFieldUriURL) UnmarshalJSON

func (r *CollectionFieldUpdateParamsFieldFieldUriURL) UnmarshalJSON(data []byte) error

type CollectionItemDeleteParams

type CollectionItemDeleteParams struct {
	CollectionID string `path:"collection_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type CollectionItemGetParams

type CollectionItemGetParams struct {
	CollectionID string `path:"collection_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type CollectionItemListParams

type CollectionItemListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Sort items returned by the specified fields, specified directly by (`name`) or
	// through relations (`organization.name`, `deals.owner.email`). Prefix with a
	// hyphen/minus (`-`) to sort in descending order.
	Sort []string `query:"sort,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CollectionItemListParams) URLQuery

func (r CollectionItemListParams) URLQuery() (v url.Values, err error)

URLQuery serializes CollectionItemListParams's query parameters as `url.Values`.

type CollectionItemMergeParams

type CollectionItemMergeParams struct {
	// The destination item pointer. This will be the remaining merged item.
	Destination ItemPointerParam `json:"destination,omitzero" api:"required"`
	// The source item pointer. This item will be deleted.
	Source ItemPointerParam `json:"source,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (CollectionItemMergeParams) MarshalJSON

func (r CollectionItemMergeParams) MarshalJSON() (data []byte, err error)

func (*CollectionItemMergeParams) UnmarshalJSON

func (r *CollectionItemMergeParams) UnmarshalJSON(data []byte) error

type CollectionItemNewParams

type CollectionItemNewParams struct {
	// A hash where keys are the `ref` of a `Field` and values are the data to be set.
	Values map[string]FieldValueParamUnion `json:"values,omitzero" api:"required"`
	// contains filtered or unexported fields
}

func (CollectionItemNewParams) MarshalJSON

func (r CollectionItemNewParams) MarshalJSON() (data []byte, err error)

func (*CollectionItemNewParams) UnmarshalJSON

func (r *CollectionItemNewParams) UnmarshalJSON(data []byte) error

type CollectionItemSearchParams

type CollectionItemSearchParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Return only items that match the filter conditions. Complex filters can be
	// created by nesting filters inside of `AND`, `OR`, and `NOT` filters.
	Filter ItemsFilterUnionParam `json:"filter,omitzero"`
	// Include only specific fields in the returned items. Specify fields by id or key.
	Include []string `json:"include,omitzero"`
	// Sort items returned by the specified fields, specified directly by (`name`) or
	// through relations (`organization.name`, `deals.owner.email`). Prefix with a
	// hyphen/minus (`-`) to sort in descending order.
	Sort []string `json:"sort,omitzero"`
	// contains filtered or unexported fields
}

func (CollectionItemSearchParams) MarshalJSON

func (r CollectionItemSearchParams) MarshalJSON() (data []byte, err error)

func (CollectionItemSearchParams) URLQuery

func (r CollectionItemSearchParams) URLQuery() (v url.Values, err error)

URLQuery serializes CollectionItemSearchParams's query parameters as `url.Values`.

func (*CollectionItemSearchParams) UnmarshalJSON

func (r *CollectionItemSearchParams) UnmarshalJSON(data []byte) error

type CollectionItemSearchResponse

type CollectionItemSearchResponse struct {
	// An Item represents a single record or row within a Collection. It holds a set of
	// `values` corresponding to the Collection's `fields`.
	Data Item                  `json:"data" api:"required"`
	Type constant.SearchResult `json:"type" default:"search_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A collection search result entry containing an item.

func (CollectionItemSearchResponse) RawJSON

Returns the unmodified JSON received from the API

func (*CollectionItemSearchResponse) UnmarshalJSON

func (r *CollectionItemSearchResponse) UnmarshalJSON(data []byte) error

type CollectionItemService

type CollectionItemService struct {
	Options []option.RequestOption
}

Manage your collections and items

CollectionItemService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCollectionItemService method instead.

func NewCollectionItemService

func NewCollectionItemService(opts ...option.RequestOption) (r CollectionItemService)

NewCollectionItemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CollectionItemService) Delete

Permanently deletes an item.

func (*CollectionItemService) Get

Retrieves the details of an existing item.

func (*CollectionItemService) List

Returns a paginated list of item pointers in a collection. Use the retrieve endpoint to get full item details including field values.

func (*CollectionItemService) ListAutoPaging

Returns a paginated list of item pointers in a collection. Use the retrieve endpoint to get full item details including field values.

func (*CollectionItemService) Merge

func (r *CollectionItemService) Merge(ctx context.Context, collectionID string, body CollectionItemMergeParams, opts ...option.RequestOption) (res *Item, err error)

Merges two items into a single item.

func (*CollectionItemService) New

func (r *CollectionItemService) New(ctx context.Context, collectionID string, body CollectionItemNewParams, opts ...option.RequestOption) (res *Item, err error)

Creates a new item in a collection.

func (*CollectionItemService) Search

Returns a list of items in the collection that match the given filters.

func (*CollectionItemService) SearchAutoPaging

Returns a list of items in the collection that match the given filters.

func (*CollectionItemService) Update

func (r *CollectionItemService) Update(ctx context.Context, id string, params CollectionItemUpdateParams, opts ...option.RequestOption) (res *Item, err error)

Updates an item.

func (*CollectionItemService) Upsert

func (r *CollectionItemService) Upsert(ctx context.Context, collectionID string, params CollectionItemUpsertParams, opts ...option.RequestOption) (res *Item, err error)

Find and update an existing item, or create a new one.

type CollectionItemUpdateParams

type CollectionItemUpdateParams struct {
	CollectionID string `path:"collection_id" api:"required" json:"-"`
	// A hash where keys are the `ref` of a `Field` and values are the new data to be
	// set.
	Values map[string]FieldValueParamUnion `json:"values,omitzero" api:"required"`
	// Any of "replace", "preserve", "merge".
	UpdateManyStrategy CollectionItemUpdateParamsUpdateManyStrategy `header:"update-many-strategy,omitzero" json:"-"`
	// Any of "replace", "preserve".
	UpdateOneStrategy CollectionItemUpdateParamsUpdateOneStrategy `header:"update-one-strategy,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CollectionItemUpdateParams) MarshalJSON

func (r CollectionItemUpdateParams) MarshalJSON() (data []byte, err error)

func (*CollectionItemUpdateParams) UnmarshalJSON

func (r *CollectionItemUpdateParams) UnmarshalJSON(data []byte) error

type CollectionItemUpdateParamsUpdateManyStrategy

type CollectionItemUpdateParamsUpdateManyStrategy string
const (
	CollectionItemUpdateParamsUpdateManyStrategyReplace  CollectionItemUpdateParamsUpdateManyStrategy = "replace"
	CollectionItemUpdateParamsUpdateManyStrategyPreserve CollectionItemUpdateParamsUpdateManyStrategy = "preserve"
	CollectionItemUpdateParamsUpdateManyStrategyMerge    CollectionItemUpdateParamsUpdateManyStrategy = "merge"
)

type CollectionItemUpdateParamsUpdateOneStrategy

type CollectionItemUpdateParamsUpdateOneStrategy string
const (
	CollectionItemUpdateParamsUpdateOneStrategyReplace  CollectionItemUpdateParamsUpdateOneStrategy = "replace"
	CollectionItemUpdateParamsUpdateOneStrategyPreserve CollectionItemUpdateParamsUpdateOneStrategy = "preserve"
)

type CollectionItemUpsertParams

type CollectionItemUpsertParams struct {
	// A hash where keys are the `ref` of a `Field` and values are used to identify the
	// item to update. When multiple identifiers are provided, the update will find
	// items that match any of the identifiers.
	Identifiers map[string]FieldValueParamUnion `json:"identifiers,omitzero" api:"required"`
	// A hash where keys are the `ref` of a `Field` and values are the data to be set.
	Values map[string]FieldValueParamUnion `json:"values,omitzero" api:"required"`
	// Any of "replace", "preserve", "merge".
	UpdateManyStrategy CollectionItemUpsertParamsUpdateManyStrategy `header:"update-many-strategy,omitzero" json:"-"`
	// Any of "replace", "preserve".
	UpdateOneStrategy CollectionItemUpsertParamsUpdateOneStrategy `header:"update-one-strategy,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CollectionItemUpsertParams) MarshalJSON

func (r CollectionItemUpsertParams) MarshalJSON() (data []byte, err error)

func (*CollectionItemUpsertParams) UnmarshalJSON

func (r *CollectionItemUpsertParams) UnmarshalJSON(data []byte) error

type CollectionItemUpsertParamsUpdateManyStrategy

type CollectionItemUpsertParamsUpdateManyStrategy string
const (
	CollectionItemUpsertParamsUpdateManyStrategyReplace  CollectionItemUpsertParamsUpdateManyStrategy = "replace"
	CollectionItemUpsertParamsUpdateManyStrategyPreserve CollectionItemUpsertParamsUpdateManyStrategy = "preserve"
	CollectionItemUpsertParamsUpdateManyStrategyMerge    CollectionItemUpsertParamsUpdateManyStrategy = "merge"
)

type CollectionItemUpsertParamsUpdateOneStrategy

type CollectionItemUpsertParamsUpdateOneStrategy string
const (
	CollectionItemUpsertParamsUpdateOneStrategyReplace  CollectionItemUpsertParamsUpdateOneStrategy = "replace"
	CollectionItemUpsertParamsUpdateOneStrategyPreserve CollectionItemUpsertParamsUpdateOneStrategy = "preserve"
)

type CollectionKind

type CollectionKind string

`system` collections are managed by Moonbase (e.g., People, Organizations), `form` collections back a Form, and `custom` collections are user-created.

const (
	CollectionKindSystem CollectionKind = "system"
	CollectionKindForm   CollectionKind = "form"
	CollectionKindCustom CollectionKind = "custom"
)

type CollectionListParams

type CollectionListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (CollectionListParams) URLQuery

func (r CollectionListParams) URLQuery() (v url.Values, err error)

URLQuery serializes CollectionListParams's query parameters as `url.Values`.

type CollectionListResponse

type CollectionListResponse struct {
	ID        string    `json:"id" api:"required"`
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Any of "system", "form", "custom".
	Kind        CollectionListResponseKind `json:"kind" api:"required"`
	Name        string                     `json:"name" api:"required"`
	Ref         string                     `json:"ref" api:"required"`
	Type        constant.Collection        `json:"type" default:"collection"`
	UpdatedAt   time.Time                  `json:"updated_at" api:"required" format:"date-time"`
	Description string                     `json:"description"`
	IconName    string                     `json:"icon_name"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Kind        respjson.Field
		Name        respjson.Field
		Ref         respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		Description respjson.Field
		IconName    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about the most essential attributes of a Collection (does not include the collection's field definitions).

func (CollectionListResponse) RawJSON

func (r CollectionListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*CollectionListResponse) UnmarshalJSON

func (r *CollectionListResponse) UnmarshalJSON(data []byte) error

type CollectionListResponseKind

type CollectionListResponseKind string
const (
	CollectionListResponseKindSystem CollectionListResponseKind = "system"
	CollectionListResponseKindForm   CollectionListResponseKind = "form"
	CollectionListResponseKindCustom CollectionListResponseKind = "custom"
)

type CollectionNewParams

type CollectionNewParams struct {
	// The user-facing name of the collection (e.g., "Leads"). A `ref` is automatically
	// derived from the name.
	Name string `json:"name" api:"required"`
	// An optional, longer-form description of the collection's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// An optional icon for the collection, as a Phosphor icon name in kebab-case (e.g.
	// `users`, `chart-bar`).
	IconName param.Opt[string] `json:"icon_name,omitzero"`
	// contains filtered or unexported fields
}

func (CollectionNewParams) MarshalJSON

func (r CollectionNewParams) MarshalJSON() (data []byte, err error)

func (*CollectionNewParams) UnmarshalJSON

func (r *CollectionNewParams) UnmarshalJSON(data []byte) error

type CollectionPointer

type CollectionPointer struct {
	// Unique identifier of the collection.
	ID string `json:"id" api:"required"`
	// The stable, machine-readable reference identifier of the collection.
	Ref string `json:"ref" api:"required"`
	// String representing the object’s type. Always `collection` for this object.
	Type constant.Collection `json:"type" default:"collection"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Ref         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A lightweight reference to a `Collection`, containing the minimal information needed to identify it.

func (CollectionPointer) RawJSON

func (r CollectionPointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*CollectionPointer) UnmarshalJSON

func (r *CollectionPointer) UnmarshalJSON(data []byte) error

type CollectionService

type CollectionService struct {
	Options []option.RequestOption
	// Manage your collections and items
	Fields CollectionFieldService
	// Manage your collections and items
	Items CollectionItemService
}

Manage your collections and items

CollectionService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewCollectionService method instead.

func NewCollectionService

func NewCollectionService(opts ...option.RequestOption) (r CollectionService)

NewCollectionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*CollectionService) Delete

func (r *CollectionService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes a collection.

func (*CollectionService) Get

func (r *CollectionService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Collection, err error)

Retrieves the details of an existing collection.

func (*CollectionService) List

Returns a list of your collections.

func (*CollectionService) ListAutoPaging

Returns a list of your collections.

func (*CollectionService) New

Creates a new collection with default fields (name, created_at, updated_at) and a default view.

func (*CollectionService) Update

func (r *CollectionService) Update(ctx context.Context, id string, body CollectionUpdateParams, opts ...option.RequestOption) (res *Collection, err error)

Updates an existing collection.

type CollectionUpdateParams

type CollectionUpdateParams struct {
	// The collection's icon, as a Phosphor icon name in kebab-case (e.g. `users`,
	// `chart-bar`), or `null` to clear it.
	IconName param.Opt[string] `json:"icon_name,omitzero"`
	// An optional, longer-form description of the collection's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// The user-facing name of the collection.
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

func (CollectionUpdateParams) MarshalJSON

func (r CollectionUpdateParams) MarshalJSON() (data []byte, err error)

func (*CollectionUpdateParams) UnmarshalJSON

func (r *CollectionUpdateParams) UnmarshalJSON(data []byte) error

type CollectionView

type CollectionView struct {
	ID string `json:"id" api:"required"`
	// A lightweight reference to a `Collection`, containing the minimal information
	// needed to identify it.
	Collection CollectionPointer `json:"collection" api:"required"`
	CreatedAt  time.Time         `json:"created_at" api:"required" format:"date-time"`
	Name       string            `json:"name" api:"required"`
	Type       constant.View     `json:"type" default:"view"`
	UpdatedAt  time.Time         `json:"updated_at" api:"required" format:"date-time"`
	// Any of "table", "board".
	ViewType string `json:"view_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Collection  respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		ViewType    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (CollectionView) RawJSON

func (r CollectionView) RawJSON() string

Returns the unmodified JSON received from the API

func (*CollectionView) UnmarshalJSON

func (r *CollectionView) UnmarshalJSON(data []byte) error

type Constituent

type Constituent struct {
	// A lightweight reference to the entity of `Constituent`, containing information
	// about what type of entity it is as well as the entity's id.
	Entity ConstituentEntityPointerUnion `json:"entity" api:"required"`
	// Any of "actor", "object", "target".
	Relation ConstituentRelation  `json:"relation" api:"required"`
	Type     constant.Constituent `json:"type" default:"constituent"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Entity      respjson.Field
		Relation    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Constituent object represents information about something that was involved in a particular activity.

func (Constituent) RawJSON

func (r Constituent) RawJSON() string

Returns the unmodified JSON received from the API

func (*Constituent) UnmarshalJSON

func (r *Constituent) UnmarshalJSON(data []byte) error

type ConstituentEntityPointerUnion

type ConstituentEntityPointerUnion struct {
	ID string `json:"id"`
	// Any of "call", "collection", "item", "file", "meeting", "message", "note",
	// "program", "program_message", "program_template", "unsubscribe".
	Type string `json:"type"`
	// This field is from variant [CollectionPointer].
	Ref string `json:"ref"`
	// This field is from variant [ItemPointer].
	Collection CollectionPointer `json:"collection"`
	JSON       struct {
		ID         respjson.Field
		Type       respjson.Field
		Ref        respjson.Field
		Collection respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ConstituentEntityPointerUnion contains all possible properties and values from CallPointer, CollectionPointer, ItemPointer, FilePointer, MeetingPointer, MessagePointer, NotePointer, ProgramPointer, ProgramMessagePointer, ProgramTemplatePointer, UnsubscribePointer.

Use the ConstituentEntityPointerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ConstituentEntityPointerUnion) AsAny

func (u ConstituentEntityPointerUnion) AsAny() anyConstituentEntityPointer

Use the following switch statement to find the correct variant

switch variant := ConstituentEntityPointerUnion.AsAny().(type) {
case moonbase.CallPointer:
case moonbase.CollectionPointer:
case moonbase.ItemPointer:
case moonbase.FilePointer:
case moonbase.MeetingPointer:
case moonbase.MessagePointer:
case moonbase.NotePointer:
case moonbase.ProgramPointer:
case moonbase.ProgramMessagePointer:
case moonbase.ProgramTemplatePointer:
case moonbase.UnsubscribePointer:
default:
  fmt.Errorf("no variant present")
}

func (ConstituentEntityPointerUnion) AsCall

func (ConstituentEntityPointerUnion) AsCollection

func (u ConstituentEntityPointerUnion) AsCollection() (v CollectionPointer)

func (ConstituentEntityPointerUnion) AsFile

func (ConstituentEntityPointerUnion) AsItem

func (ConstituentEntityPointerUnion) AsMeeting

func (ConstituentEntityPointerUnion) AsMessage

func (ConstituentEntityPointerUnion) AsNote

func (ConstituentEntityPointerUnion) AsProgram

func (ConstituentEntityPointerUnion) AsProgramMessage

func (u ConstituentEntityPointerUnion) AsProgramMessage() (v ProgramMessagePointer)

func (ConstituentEntityPointerUnion) AsProgramTemplate

func (u ConstituentEntityPointerUnion) AsProgramTemplate() (v ProgramTemplatePointer)

func (ConstituentEntityPointerUnion) AsUnsubscribe

func (u ConstituentEntityPointerUnion) AsUnsubscribe() (v UnsubscribePointer)

func (ConstituentEntityPointerUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ConstituentEntityPointerUnion) UnmarshalJSON

func (r *ConstituentEntityPointerUnion) UnmarshalJSON(data []byte) error

type ConstituentRelation

type ConstituentRelation string
const (
	ConstituentRelationActor  ConstituentRelation = "actor"
	ConstituentRelationObject ConstituentRelation = "object"
	ConstituentRelationTarget ConstituentRelation = "target"
)

type CurrentDate

type CurrentDate struct {
	Type constant.CurrentDate `json:"type" default:"current_date"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolves to today's date at the time the record is created.

func (CurrentDate) RawJSON

func (r CurrentDate) RawJSON() string

Returns the unmodified JSON received from the API

func (CurrentDate) ToParam

func (r CurrentDate) ToParam() CurrentDateParam

ToParam converts this CurrentDate to a CurrentDateParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CurrentDateParam.Overrides()

func (*CurrentDate) UnmarshalJSON

func (r *CurrentDate) UnmarshalJSON(data []byte) error

type CurrentDateParam

type CurrentDateParam struct {
	Type constant.CurrentDate `json:"type" default:"current_date"`
	// contains filtered or unexported fields
}

Resolves to today's date at the time the record is created.

This struct has a constant value, construct it with NewCurrentDateParam.

func NewCurrentDateParam

func NewCurrentDateParam() CurrentDateParam

func (CurrentDateParam) MarshalJSON

func (r CurrentDateParam) MarshalJSON() (data []byte, err error)

func (*CurrentDateParam) UnmarshalJSON

func (r *CurrentDateParam) UnmarshalJSON(data []byte) error

type CurrentDatetime

type CurrentDatetime struct {
	Type constant.CurrentDatetime `json:"type" default:"current_datetime"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolves to the current date and time at the time the record is created.

func (CurrentDatetime) RawJSON

func (r CurrentDatetime) RawJSON() string

Returns the unmodified JSON received from the API

func (CurrentDatetime) ToParam

ToParam converts this CurrentDatetime to a CurrentDatetimeParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CurrentDatetimeParam.Overrides()

func (*CurrentDatetime) UnmarshalJSON

func (r *CurrentDatetime) UnmarshalJSON(data []byte) error

type CurrentDatetimeParam

type CurrentDatetimeParam struct {
	Type constant.CurrentDatetime `json:"type" default:"current_datetime"`
	// contains filtered or unexported fields
}

Resolves to the current date and time at the time the record is created.

This struct has a constant value, construct it with NewCurrentDatetimeParam.

func NewCurrentDatetimeParam

func NewCurrentDatetimeParam() CurrentDatetimeParam

func (CurrentDatetimeParam) MarshalJSON

func (r CurrentDatetimeParam) MarshalJSON() (data []byte, err error)

func (*CurrentDatetimeParam) UnmarshalJSON

func (r *CurrentDatetimeParam) UnmarshalJSON(data []byte) error

type CurrentMember

type CurrentMember struct {
	Type constant.CurrentMember `json:"type" default:"current_member"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Resolves to the team member who creates the record.

func (CurrentMember) RawJSON

func (r CurrentMember) RawJSON() string

Returns the unmodified JSON received from the API

func (CurrentMember) ToParam

func (r CurrentMember) ToParam() CurrentMemberParam

ToParam converts this CurrentMember to a CurrentMemberParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with CurrentMemberParam.Overrides()

func (*CurrentMember) UnmarshalJSON

func (r *CurrentMember) UnmarshalJSON(data []byte) error

type CurrentMemberParam

type CurrentMemberParam struct {
	Type constant.CurrentMember `json:"type" default:"current_member"`
	// contains filtered or unexported fields
}

Resolves to the team member who creates the record.

This struct has a constant value, construct it with NewCurrentMemberParam.

func NewCurrentMemberParam

func NewCurrentMemberParam() CurrentMemberParam

func (CurrentMemberParam) MarshalJSON

func (r CurrentMemberParam) MarshalJSON() (data []byte, err error)

func (*CurrentMemberParam) UnmarshalJSON

func (r *CurrentMemberParam) UnmarshalJSON(data []byte) error

type DateField

type DateField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality DateFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind DateFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Due Date").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `due_date`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/date` for this field.
	Type constant.FieldDate `json:"type" default:"field/date"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores dates without time information.

func (DateField) RawJSON

func (r DateField) RawJSON() string

Returns the unmodified JSON received from the API

func (*DateField) UnmarshalJSON

func (r *DateField) UnmarshalJSON(data []byte) error

type DateFieldCardinality

type DateFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	DateFieldCardinalityOne  DateFieldCardinality = "one"
	DateFieldCardinalityMany DateFieldCardinality = "many"
)

type DateFieldDefaultValueParamUnion

type DateFieldDefaultValueParamUnion struct {
	OfValueDate   *DateValueParam   `json:",omitzero,inline"`
	OfCurrentDate *CurrentDateParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func DateFieldDefaultValueParamOfValueDate

func DateFieldDefaultValueParamOfValueDate(data time.Time) DateFieldDefaultValueParamUnion

func (DateFieldDefaultValueParamUnion) GetData

Returns a pointer to the underlying variant's property, if present.

func (DateFieldDefaultValueParamUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (DateFieldDefaultValueParamUnion) MarshalJSON

func (u DateFieldDefaultValueParamUnion) MarshalJSON() ([]byte, error)

func (*DateFieldDefaultValueParamUnion) UnmarshalJSON

func (u *DateFieldDefaultValueParamUnion) UnmarshalJSON(data []byte) error

type DateFieldKind

type DateFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	DateFieldKindSystem  DateFieldKind = "system"
	DateFieldKindInverse DateFieldKind = "inverse"
	DateFieldKindCustom  DateFieldKind = "custom"
)

type DateValue

type DateValue struct {
	Data time.Time          `json:"data" api:"required" format:"date"`
	Type constant.ValueDate `json:"type" default:"value/date"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Date without time

func (DateValue) RawJSON

func (r DateValue) RawJSON() string

Returns the unmodified JSON received from the API

func (DateValue) ToParam

func (r DateValue) ToParam() DateValueParam

ToParam converts this DateValue to a DateValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DateValueParam.Overrides()

func (*DateValue) UnmarshalJSON

func (r *DateValue) UnmarshalJSON(data []byte) error

type DateValueParam

type DateValueParam struct {
	Data time.Time `json:"data" api:"required" format:"date"`
	// This field can be elided, and will marshal its zero value as "value/date".
	Type constant.ValueDate `json:"type" default:"value/date"`
	// contains filtered or unexported fields
}

Date without time

The properties Data, Type are required.

func (DateValueParam) MarshalJSON

func (r DateValueParam) MarshalJSON() (data []byte, err error)

func (*DateValueParam) UnmarshalJSON

func (r *DateValueParam) UnmarshalJSON(data []byte) error

type DatetimeField

type DatetimeField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality DatetimeFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind DatetimeFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Meeting Time").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `meeting_time`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/datetime` for this field.
	Type constant.FieldDatetime `json:"type" default:"field/datetime"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores dates with time information.

func (DatetimeField) RawJSON

func (r DatetimeField) RawJSON() string

Returns the unmodified JSON received from the API

func (*DatetimeField) UnmarshalJSON

func (r *DatetimeField) UnmarshalJSON(data []byte) error

type DatetimeFieldCardinality

type DatetimeFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	DatetimeFieldCardinalityOne  DatetimeFieldCardinality = "one"
	DatetimeFieldCardinalityMany DatetimeFieldCardinality = "many"
)

type DatetimeFieldDefaultValueParamUnion

type DatetimeFieldDefaultValueParamUnion struct {
	OfValueDatetime   *DatetimeValueParam   `json:",omitzero,inline"`
	OfCurrentDatetime *CurrentDatetimeParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func DatetimeFieldDefaultValueParamOfValueDatetime

func DatetimeFieldDefaultValueParamOfValueDatetime(data time.Time) DatetimeFieldDefaultValueParamUnion

func (DatetimeFieldDefaultValueParamUnion) GetData

Returns a pointer to the underlying variant's property, if present.

func (DatetimeFieldDefaultValueParamUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (DatetimeFieldDefaultValueParamUnion) MarshalJSON

func (u DatetimeFieldDefaultValueParamUnion) MarshalJSON() ([]byte, error)

func (*DatetimeFieldDefaultValueParamUnion) UnmarshalJSON

func (u *DatetimeFieldDefaultValueParamUnion) UnmarshalJSON(data []byte) error

type DatetimeFieldKind

type DatetimeFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	DatetimeFieldKindSystem  DatetimeFieldKind = "system"
	DatetimeFieldKindInverse DatetimeFieldKind = "inverse"
	DatetimeFieldKindCustom  DatetimeFieldKind = "custom"
)

type DatetimeValue

type DatetimeValue struct {
	Data time.Time              `json:"data" api:"required" format:"date-time"`
	Type constant.ValueDatetime `json:"type" default:"value/datetime"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Date and time value

func (DatetimeValue) RawJSON

func (r DatetimeValue) RawJSON() string

Returns the unmodified JSON received from the API

func (DatetimeValue) ToParam

func (r DatetimeValue) ToParam() DatetimeValueParam

ToParam converts this DatetimeValue to a DatetimeValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DatetimeValueParam.Overrides()

func (*DatetimeValue) UnmarshalJSON

func (r *DatetimeValue) UnmarshalJSON(data []byte) error

type DatetimeValueParam

type DatetimeValueParam struct {
	Data time.Time `json:"data" api:"required" format:"date-time"`
	// This field can be elided, and will marshal its zero value as "value/datetime".
	Type constant.ValueDatetime `json:"type" default:"value/datetime"`
	// contains filtered or unexported fields
}

Date and time value

The properties Data, Type are required.

func (DatetimeValueParam) MarshalJSON

func (r DatetimeValueParam) MarshalJSON() (data []byte, err error)

func (*DatetimeValueParam) UnmarshalJSON

func (r *DatetimeValueParam) UnmarshalJSON(data []byte) error

type DomainField

type DomainField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality DomainFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind DomainFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Company Domain").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `company_domain`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/uri/domain` for this field.
	Type constant.FieldUriDomain `json:"type" default:"field/uri/domain"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores internet domain names.

func (DomainField) RawJSON

func (r DomainField) RawJSON() string

Returns the unmodified JSON received from the API

func (*DomainField) UnmarshalJSON

func (r *DomainField) UnmarshalJSON(data []byte) error

type DomainFieldCardinality

type DomainFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	DomainFieldCardinalityOne  DomainFieldCardinality = "one"
	DomainFieldCardinalityMany DomainFieldCardinality = "many"
)

type DomainFieldKind

type DomainFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	DomainFieldKindSystem  DomainFieldKind = "system"
	DomainFieldKindInverse DomainFieldKind = "inverse"
	DomainFieldKindCustom  DomainFieldKind = "custom"
)

type DomainValue

type DomainValue struct {
	// A valid internet domain name, without protocol (e.g., 'https://') or path.
	Data string                  `json:"data" api:"required"`
	Type constant.ValueUriDomain `json:"type" default:"value/uri/domain"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Internet domain name

func (DomainValue) RawJSON

func (r DomainValue) RawJSON() string

Returns the unmodified JSON received from the API

func (DomainValue) ToParam

func (r DomainValue) ToParam() DomainValueParam

ToParam converts this DomainValue to a DomainValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with DomainValueParam.Overrides()

func (*DomainValue) UnmarshalJSON

func (r *DomainValue) UnmarshalJSON(data []byte) error

type DomainValueParam

type DomainValueParam struct {
	// A valid internet domain name, without protocol (e.g., 'https://') or path.
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as "value/uri/domain".
	Type constant.ValueUriDomain `json:"type" default:"value/uri/domain"`
	// contains filtered or unexported fields
}

Internet domain name

The properties Data, Type are required.

func (DomainValueParam) MarshalJSON

func (r DomainValueParam) MarshalJSON() (data []byte, err error)

func (*DomainValueParam) UnmarshalJSON

func (r *DomainValueParam) UnmarshalJSON(data []byte) error

type EmailField

type EmailField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality EmailFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind EmailFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Work Email").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `work_email`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/email` for this field.
	Type constant.FieldEmail `json:"type" default:"field/email"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores and validates email addresses.

func (EmailField) RawJSON

func (r EmailField) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmailField) UnmarshalJSON

func (r *EmailField) UnmarshalJSON(data []byte) error

type EmailFieldCardinality

type EmailFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	EmailFieldCardinalityOne  EmailFieldCardinality = "one"
	EmailFieldCardinalityMany EmailFieldCardinality = "many"
)

type EmailFieldKind

type EmailFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	EmailFieldKindSystem  EmailFieldKind = "system"
	EmailFieldKindInverse EmailFieldKind = "inverse"
	EmailFieldKindCustom  EmailFieldKind = "custom"
)

type EmailMessage

type EmailMessage struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Structured content that can be rendered in multiple formats, currently
	// supporting Markdown.
	Body shared.FormattedText `json:"body" api:"required"`
	// `true` if the message appears to be part of a bulk mailing.
	Bulk bool `json:"bulk" api:"required"`
	// The time the message was received, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// `true` if the message is a draft that has not been sent.
	Draft bool `json:"draft" api:"required"`
	// The current lock version of the message for optimistic concurrency control.
	LockVersion int64 `json:"lock_version" api:"required"`
	// `true` if the message is classified as spam.
	Spam bool `json:"spam" api:"required"`
	// The subject line of the email.
	Subject string `json:"subject" api:"required"`
	// `true` if the message is in the trash.
	Trash bool `json:"trash" api:"required"`
	// String representing the object’s type. Always `email_message` for this object.
	Type constant.EmailMessage `json:"type" default:"email_message"`
	// `true` if the message has not been read.
	Unread bool `json:"unread" api:"required"`
	// A list of `Address` objects associated with the message (sender and recipients).
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Addresses []EmailMessageAddress `json:"addresses"`
	// A list of `Attachment` objects on the message.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Attachments []MessageAttachment `json:"attachments"`
	// The `Conversation` thread this message is part of.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Conversation *InboxConversation `json:"conversation"`
	// A concise, system-generated summary of the email content.
	Summary string `json:"summary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Body         respjson.Field
		Bulk         respjson.Field
		CreatedAt    respjson.Field
		Draft        respjson.Field
		LockVersion  respjson.Field
		Spam         respjson.Field
		Subject      respjson.Field
		Trash        respjson.Field
		Type         respjson.Field
		Unread       respjson.Field
		Addresses    respjson.Field
		Attachments  respjson.Field
		Conversation respjson.Field
		Summary      respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Email Message object represents a single email within a `Conversation`.

func (EmailMessage) RawJSON

func (r EmailMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmailMessage) UnmarshalJSON

func (r *EmailMessage) UnmarshalJSON(data []byte) error

type EmailMessageAddress

type EmailMessageAddress struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The email address.
	Email string `json:"email" api:"required" format:"email"`
	// The role of the address in the message. Can be `from`, `reply_to`, `to`, `cc`,
	// or `bcc`.
	//
	// Any of "from", "reply_to", "to", "cc", "bcc".
	Role EmailMessageAddressRole `json:"role" api:"required"`
	// String representing the object’s type. Always `message_address` for this object.
	Type constant.EmailMessageAddress `json:"type" default:"email_message_address"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Organization ItemPointer `json:"organization"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Person ItemPointer `json:"person"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Email        respjson.Field
		Role         respjson.Field
		Type         respjson.Field
		Organization respjson.Field
		Person       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The EmailMessageAddress object represents a recipient or sender of a message. It contains an email address and can be linked to a person and an organization in your collections.

func (EmailMessageAddress) RawJSON

func (r EmailMessageAddress) RawJSON() string

Returns the unmodified JSON received from the API

func (*EmailMessageAddress) UnmarshalJSON

func (r *EmailMessageAddress) UnmarshalJSON(data []byte) error

type EmailMessageAddressParams

type EmailMessageAddressParams struct {
	// The email address.
	Email string `json:"email" api:"required" format:"email"`
	// The recipient's name.
	Name param.Opt[string] `json:"name,omitzero"`
	// contains filtered or unexported fields
}

The property Email is required.

func (EmailMessageAddressParams) MarshalJSON

func (r EmailMessageAddressParams) MarshalJSON() (data []byte, err error)

func (*EmailMessageAddressParams) UnmarshalJSON

func (r *EmailMessageAddressParams) UnmarshalJSON(data []byte) error

type EmailMessageAddressRole

type EmailMessageAddressRole string

The role of the address in the message. Can be `from`, `reply_to`, `to`, `cc`, or `bcc`.

const (
	EmailMessageAddressRoleFrom    EmailMessageAddressRole = "from"
	EmailMessageAddressRoleReplyTo EmailMessageAddressRole = "reply_to"
	EmailMessageAddressRoleTo      EmailMessageAddressRole = "to"
	EmailMessageAddressRoleCc      EmailMessageAddressRole = "cc"
	EmailMessageAddressRoleBcc     EmailMessageAddressRole = "bcc"
)

type EmailValue

type EmailValue struct {
	// A valid email address.
	Data string              `json:"data" api:"required" format:"email"`
	Type constant.ValueEmail `json:"type" default:"value/email"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Email address value

func (EmailValue) RawJSON

func (r EmailValue) RawJSON() string

Returns the unmodified JSON received from the API

func (EmailValue) ToParam

func (r EmailValue) ToParam() EmailValueParam

ToParam converts this EmailValue to a EmailValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with EmailValueParam.Overrides()

func (*EmailValue) UnmarshalJSON

func (r *EmailValue) UnmarshalJSON(data []byte) error

type EmailValueParam

type EmailValueParam struct {
	// A valid email address.
	Data string `json:"data" api:"required" format:"email"`
	// This field can be elided, and will marshal its zero value as "value/email".
	Type constant.ValueEmail `json:"type" default:"value/email"`
	// contains filtered or unexported fields
}

Email address value

The properties Data, Type are required.

func (EmailValueParam) MarshalJSON

func (r EmailValueParam) MarshalJSON() (data []byte, err error)

func (*EmailValueParam) UnmarshalJSON

func (r *EmailValueParam) UnmarshalJSON(data []byte) error

type Endpoint

type Endpoint struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// Indicates whether the endpoint is enabled.
	//
	// Any of "disabled", "enabled".
	Status EndpointStatus `json:"status" api:"required"`
	// An array of `WebhookSubscription` objects representing the events this endpoint
	// will receive.
	Subscriptions []Subscription `json:"subscriptions" api:"required"`
	// String representing the object’s type. Always `webhook_endpoint` for this
	// object.
	Type constant.WebhookEndpoint `json:"type" default:"webhook_endpoint"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The HTTPS URL where webhook events will be sent.
	URL string `json:"url" api:"required"`
	// The signing secret used to verify webhook authenticity. This value is only shown
	// when creating the endpoint and starts with `whsec_`.
	Secret string `json:"secret"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		CreatedAt     respjson.Field
		Status        respjson.Field
		Subscriptions respjson.Field
		Type          respjson.Field
		UpdatedAt     respjson.Field
		URL           respjson.Field
		Secret        respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Webhook Endpoint is an HTTP endpoint that receives webhooks. You can configure which events are sent to each endpoint by creating `WebhookSubscription` objects.

func (Endpoint) RawJSON

func (r Endpoint) RawJSON() string

Returns the unmodified JSON received from the API

func (*Endpoint) UnmarshalJSON

func (r *Endpoint) UnmarshalJSON(data []byte) error

type EndpointStatus

type EndpointStatus string

Indicates whether the endpoint is enabled.

const (
	EndpointStatusDisabled EndpointStatus = "disabled"
	EndpointStatusEnabled  EndpointStatus = "enabled"
)

type Error

type Error = apierror.Error

type FieldDefaultValueUnion

type FieldDefaultValueUnion struct {
	// This field is a union of [string], [string], [string], [int64], [float64],
	// [MonetaryValueData], [float64], [bool], [string], [string], [string],
	// [SocialXValueData], [SocialLinkedInValueData], [string], [string], [time.Time],
	// [time.Time], [ChoiceFieldOption], [FunnelStep], [ItemPointer]
	Data FieldDefaultValueUnionData `json:"data"`
	// Any of "value/text/single_line", "value/text/multi_line", "value/identifier",
	// "value/number/unitless_integer", "value/number/unitless_float",
	// "value/number/monetary", "value/number/percentage", "value/boolean",
	// "value/email", "value/uri/url", "value/uri/domain", "value/uri/social_x",
	// "value/uri/social_linked_in", "value/telephone_number", "value/geo",
	// "value/date", "current_date", "value/datetime", "current_datetime",
	// "value/choice", "value/funnel_step", "value/relation", "current_member".
	Type string `json:"type"`
	JSON struct {
		Data respjson.Field
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FieldDefaultValueUnion contains all possible properties and values from SingleLineTextValue, MultiLineTextValue, IdentifierValue, IntegerValue, FloatValue, MonetaryValue, PercentageValue, BooleanValue, EmailValue, URLValue, DomainValue, SocialXValue, SocialLinkedInValue, TelephoneNumber, GeoValue, DateValue, CurrentDate, DatetimeValue, CurrentDatetime, ChoiceValue, FunnelStepValue, RelationValue, CurrentMember.

Use the FieldDefaultValueUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FieldDefaultValueUnion) AsAny

func (u FieldDefaultValueUnion) AsAny() anyFieldDefaultValue

Use the following switch statement to find the correct variant

switch variant := FieldDefaultValueUnion.AsAny().(type) {
case moonbase.SingleLineTextValue:
case moonbase.MultiLineTextValue:
case moonbase.IdentifierValue:
case moonbase.IntegerValue:
case moonbase.FloatValue:
case moonbase.MonetaryValue:
case moonbase.PercentageValue:
case moonbase.BooleanValue:
case moonbase.EmailValue:
case moonbase.URLValue:
case moonbase.DomainValue:
case moonbase.SocialXValue:
case moonbase.SocialLinkedInValue:
case moonbase.TelephoneNumber:
case moonbase.GeoValue:
case moonbase.DateValue:
case moonbase.CurrentDate:
case moonbase.DatetimeValue:
case moonbase.CurrentDatetime:
case moonbase.ChoiceValue:
case moonbase.FunnelStepValue:
case moonbase.RelationValue:
case moonbase.CurrentMember:
default:
  fmt.Errorf("no variant present")
}

func (FieldDefaultValueUnion) AsCurrentDate

func (u FieldDefaultValueUnion) AsCurrentDate() (v CurrentDate)

func (FieldDefaultValueUnion) AsCurrentDatetime

func (u FieldDefaultValueUnion) AsCurrentDatetime() (v CurrentDatetime)

func (FieldDefaultValueUnion) AsCurrentMember

func (u FieldDefaultValueUnion) AsCurrentMember() (v CurrentMember)

func (FieldDefaultValueUnion) AsValueBoolean

func (u FieldDefaultValueUnion) AsValueBoolean() (v BooleanValue)

func (FieldDefaultValueUnion) AsValueChoice

func (u FieldDefaultValueUnion) AsValueChoice() (v ChoiceValue)

func (FieldDefaultValueUnion) AsValueDate

func (u FieldDefaultValueUnion) AsValueDate() (v DateValue)

func (FieldDefaultValueUnion) AsValueDatetime

func (u FieldDefaultValueUnion) AsValueDatetime() (v DatetimeValue)

func (FieldDefaultValueUnion) AsValueEmail

func (u FieldDefaultValueUnion) AsValueEmail() (v EmailValue)

func (FieldDefaultValueUnion) AsValueFunnelStep

func (u FieldDefaultValueUnion) AsValueFunnelStep() (v FunnelStepValue)

func (FieldDefaultValueUnion) AsValueGeo

func (u FieldDefaultValueUnion) AsValueGeo() (v GeoValue)

func (FieldDefaultValueUnion) AsValueIdentifier

func (u FieldDefaultValueUnion) AsValueIdentifier() (v IdentifierValue)

func (FieldDefaultValueUnion) AsValueNumberMonetary

func (u FieldDefaultValueUnion) AsValueNumberMonetary() (v MonetaryValue)

func (FieldDefaultValueUnion) AsValueNumberPercentage

func (u FieldDefaultValueUnion) AsValueNumberPercentage() (v PercentageValue)

func (FieldDefaultValueUnion) AsValueNumberUnitlessFloat

func (u FieldDefaultValueUnion) AsValueNumberUnitlessFloat() (v FloatValue)

func (FieldDefaultValueUnion) AsValueNumberUnitlessInteger

func (u FieldDefaultValueUnion) AsValueNumberUnitlessInteger() (v IntegerValue)

func (FieldDefaultValueUnion) AsValueRelation

func (u FieldDefaultValueUnion) AsValueRelation() (v RelationValue)

func (FieldDefaultValueUnion) AsValueTelephoneNumber

func (u FieldDefaultValueUnion) AsValueTelephoneNumber() (v TelephoneNumber)

func (FieldDefaultValueUnion) AsValueTextMultiLine

func (u FieldDefaultValueUnion) AsValueTextMultiLine() (v MultiLineTextValue)

func (FieldDefaultValueUnion) AsValueTextSingleLine

func (u FieldDefaultValueUnion) AsValueTextSingleLine() (v SingleLineTextValue)

func (FieldDefaultValueUnion) AsValueUriDomain

func (u FieldDefaultValueUnion) AsValueUriDomain() (v DomainValue)

func (FieldDefaultValueUnion) AsValueUriSocialLinkedIn

func (u FieldDefaultValueUnion) AsValueUriSocialLinkedIn() (v SocialLinkedInValue)

func (FieldDefaultValueUnion) AsValueUriSocialX

func (u FieldDefaultValueUnion) AsValueUriSocialX() (v SocialXValue)

func (FieldDefaultValueUnion) AsValueUriURL

func (u FieldDefaultValueUnion) AsValueUriURL() (v URLValue)

func (FieldDefaultValueUnion) RawJSON

func (u FieldDefaultValueUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*FieldDefaultValueUnion) UnmarshalJSON

func (r *FieldDefaultValueUnion) UnmarshalJSON(data []byte) error

type FieldDefaultValueUnionData

type FieldDefaultValueUnionData struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [int64] instead of an object.
	OfInt int64 `json:",inline"`
	// This field will be present if the value is a [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [time.Time] instead of an object.
	OfTime time.Time `json:",inline"`
	// This field is from variant [MonetaryValueData].
	Currency string `json:"currency"`
	// This field is from variant [MonetaryValueData].
	InMinorUnits int64  `json:"in_minor_units"`
	URL          string `json:"url"`
	Username     string `json:"username"`
	ID           string `json:"id"`
	Color        string `json:"color"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	// This field is from variant [FunnelStep].
	StepType FunnelStepStepType `json:"step_type"`
	// This field is from variant [ItemPointer].
	Collection CollectionPointer `json:"collection"`
	JSON       struct {
		OfString     respjson.Field
		OfInt        respjson.Field
		OfFloat      respjson.Field
		OfBool       respjson.Field
		OfTime       respjson.Field
		Currency     respjson.Field
		InMinorUnits respjson.Field
		URL          respjson.Field
		Username     respjson.Field
		ID           respjson.Field
		Color        respjson.Field
		Name         respjson.Field
		Type         respjson.Field
		StepType     respjson.Field
		Collection   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FieldDefaultValueUnionData is an implicit subunion of FieldDefaultValueUnion. FieldDefaultValueUnionData provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the FieldDefaultValueUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfInt OfFloat OfBool OfTime]

func (*FieldDefaultValueUnionData) UnmarshalJSON

func (r *FieldDefaultValueUnionData) UnmarshalJSON(data []byte) error

type FieldPointer

type FieldPointer struct {
	// Unique identifier of the field.
	ID string `json:"id" api:"required"`
	// A reference to the `Collection` containing this field.
	Collection CollectionPointer `json:"collection" api:"required"`
	// The stable, machine-readable reference identifier of the field.
	Ref string `json:"ref" api:"required"`
	// String representing the object’s type. Always `field` for this object.
	Type constant.Field `json:"type" default:"field"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Collection  respjson.Field
		Ref         respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A lightweight reference to a `Field`, containing the minimal information needed to identify it.

func (FieldPointer) RawJSON

func (r FieldPointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*FieldPointer) UnmarshalJSON

func (r *FieldPointer) UnmarshalJSON(data []byte) error

type FieldUnion

type FieldUnion struct {
	ID            string                   `json:"id"`
	Cardinality   string                   `json:"cardinality"`
	CreatedAt     time.Time                `json:"created_at"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values"`
	Kind          string                   `json:"kind"`
	Name          string                   `json:"name"`
	Readonly      bool                     `json:"readonly"`
	Ref           string                   `json:"ref"`
	Required      bool                     `json:"required"`
	// Any of "field/text/single_line", "field/text/multi_line", "field/identifier",
	// "field/number/unitless_integer", "field/number/unitless_float",
	// "field/number/monetary", "field/number/percentage", "field/boolean",
	// "field/email", "field/uri/url", "field/uri/domain", "field/uri/social_x",
	// "field/uri/social_linked_in", "field/telephone_number", "field/geo",
	// "field/date", "field/datetime", "field/choice", "field/stage", "field/relation".
	Type        string    `json:"type"`
	Unique      bool      `json:"unique"`
	UpdatedAt   time.Time `json:"updated_at"`
	Description string    `json:"description"`
	// This field is from variant [MonetaryField].
	DefaultUnit string `json:"default_unit"`
	// This field is from variant [ChoiceField].
	Options []ChoiceFieldOption `json:"options"`
	// This field is from variant [StageField].
	Funnel Funnel `json:"funnel"`
	// This field is from variant [RelationField].
	AllowedCollections []CollectionPointer `json:"allowed_collections"`
	// This field is from variant [RelationField].
	RelationType RelationFieldRelationType `json:"relation_type"`
	// This field is from variant [RelationField].
	ReverseFieldName string `json:"reverse_field_name"`
	// This field is from variant [RelationField].
	ReverseFields []FieldPointer `json:"reverse_fields"`
	// This field is from variant [RelationField].
	SourceField FieldPointer `json:"source_field"`
	JSON        struct {
		ID                 respjson.Field
		Cardinality        respjson.Field
		CreatedAt          respjson.Field
		DefaultValues      respjson.Field
		Kind               respjson.Field
		Name               respjson.Field
		Readonly           respjson.Field
		Ref                respjson.Field
		Required           respjson.Field
		Type               respjson.Field
		Unique             respjson.Field
		UpdatedAt          respjson.Field
		Description        respjson.Field
		DefaultUnit        respjson.Field
		Options            respjson.Field
		Funnel             respjson.Field
		AllowedCollections respjson.Field
		RelationType       respjson.Field
		ReverseFieldName   respjson.Field
		ReverseFields      respjson.Field
		SourceField        respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FieldUnion contains all possible properties and values from SingleLineTextField, MultiLineTextField, IdentifierField, IntegerField, FloatField, MonetaryField, PercentageField, BooleanField, EmailField, URLField, DomainField, SocialXField, SocialLinkedInField, TelephoneNumberField, GeoField, DateField, DatetimeField, ChoiceField, StageField, RelationField.

Use the FieldUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (FieldUnion) AsAny

func (u FieldUnion) AsAny() anyField

Use the following switch statement to find the correct variant

switch variant := FieldUnion.AsAny().(type) {
case moonbase.SingleLineTextField:
case moonbase.MultiLineTextField:
case moonbase.IdentifierField:
case moonbase.IntegerField:
case moonbase.FloatField:
case moonbase.MonetaryField:
case moonbase.PercentageField:
case moonbase.BooleanField:
case moonbase.EmailField:
case moonbase.URLField:
case moonbase.DomainField:
case moonbase.SocialXField:
case moonbase.SocialLinkedInField:
case moonbase.TelephoneNumberField:
case moonbase.GeoField:
case moonbase.DateField:
case moonbase.DatetimeField:
case moonbase.ChoiceField:
case moonbase.StageField:
case moonbase.RelationField:
default:
  fmt.Errorf("no variant present")
}

func (FieldUnion) AsFieldBoolean

func (u FieldUnion) AsFieldBoolean() (v BooleanField)

func (FieldUnion) AsFieldChoice

func (u FieldUnion) AsFieldChoice() (v ChoiceField)

func (FieldUnion) AsFieldDate

func (u FieldUnion) AsFieldDate() (v DateField)

func (FieldUnion) AsFieldDatetime

func (u FieldUnion) AsFieldDatetime() (v DatetimeField)

func (FieldUnion) AsFieldEmail

func (u FieldUnion) AsFieldEmail() (v EmailField)

func (FieldUnion) AsFieldGeo

func (u FieldUnion) AsFieldGeo() (v GeoField)

func (FieldUnion) AsFieldIdentifier

func (u FieldUnion) AsFieldIdentifier() (v IdentifierField)

func (FieldUnion) AsFieldNumberMonetary

func (u FieldUnion) AsFieldNumberMonetary() (v MonetaryField)

func (FieldUnion) AsFieldNumberPercentage

func (u FieldUnion) AsFieldNumberPercentage() (v PercentageField)

func (FieldUnion) AsFieldNumberUnitlessFloat

func (u FieldUnion) AsFieldNumberUnitlessFloat() (v FloatField)

func (FieldUnion) AsFieldNumberUnitlessInteger

func (u FieldUnion) AsFieldNumberUnitlessInteger() (v IntegerField)

func (FieldUnion) AsFieldRelation

func (u FieldUnion) AsFieldRelation() (v RelationField)

func (FieldUnion) AsFieldStage

func (u FieldUnion) AsFieldStage() (v StageField)

func (FieldUnion) AsFieldTelephoneNumber

func (u FieldUnion) AsFieldTelephoneNumber() (v TelephoneNumberField)

func (FieldUnion) AsFieldTextMultiLine

func (u FieldUnion) AsFieldTextMultiLine() (v MultiLineTextField)

func (FieldUnion) AsFieldTextSingleLine

func (u FieldUnion) AsFieldTextSingleLine() (v SingleLineTextField)

func (FieldUnion) AsFieldUriDomain

func (u FieldUnion) AsFieldUriDomain() (v DomainField)

func (FieldUnion) AsFieldUriSocialLinkedIn

func (u FieldUnion) AsFieldUriSocialLinkedIn() (v SocialLinkedInField)

func (FieldUnion) AsFieldUriSocialX

func (u FieldUnion) AsFieldUriSocialX() (v SocialXField)

func (FieldUnion) AsFieldUriURL

func (u FieldUnion) AsFieldUriURL() (v URLField)

func (FieldUnion) RawJSON

func (u FieldUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*FieldUnion) UnmarshalJSON

func (r *FieldUnion) UnmarshalJSON(data []byte) error

type FieldValueParamUnion

type FieldValueParamUnion struct {
	OfSingleLineText  *SingleLineTextValueParam `json:",omitzero,inline"`
	OfMultiLineText   *MultiLineTextValueParam  `json:",omitzero,inline"`
	OfIdentifier      *IdentifierValueParam     `json:",omitzero,inline"`
	OfInteger         *IntegerValueParam        `json:",omitzero,inline"`
	OfFloat           *FloatValueParam          `json:",omitzero,inline"`
	OfMonetary        *MonetaryValueParam       `json:",omitzero,inline"`
	OfPercentage      *PercentageValueParam     `json:",omitzero,inline"`
	OfBoolean         *BooleanValueParam        `json:",omitzero,inline"`
	OfEmail           *EmailValueParam          `json:",omitzero,inline"`
	OfURL             *URLValueParam            `json:",omitzero,inline"`
	OfDomain          *DomainValueParam         `json:",omitzero,inline"`
	OfX               *SocialXValueParam        `json:",omitzero,inline"`
	OfLinkedIn        *SocialLinkedInValueParam `json:",omitzero,inline"`
	OfTelephoneNumber *TelephoneNumberParam     `json:",omitzero,inline"`
	OfGeo             *GeoValueParam            `json:",omitzero,inline"`
	OfDate            *DateValueParam           `json:",omitzero,inline"`
	OfDateTime        *DatetimeValueParam       `json:",omitzero,inline"`
	OfChoice          *ChoiceValueParam         `json:",omitzero,inline"`
	OfFunnelStep      *FunnelStepValueParam     `json:",omitzero,inline"`
	OfRelation        *RelationValueParam       `json:",omitzero,inline"`
	OfArrayOfValues   []ValueParamUnion         `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func FieldValueParamOfBoolean

func FieldValueParamOfBoolean(data bool) FieldValueParamUnion

func FieldValueParamOfDate

func FieldValueParamOfDate(data time.Time) FieldValueParamUnion

func FieldValueParamOfDateTime

func FieldValueParamOfDateTime(data time.Time) FieldValueParamUnion

func FieldValueParamOfDomain

func FieldValueParamOfDomain(data string) FieldValueParamUnion

func FieldValueParamOfEmail

func FieldValueParamOfEmail(data string) FieldValueParamUnion

func FieldValueParamOfFloat

func FieldValueParamOfFloat(data float64) FieldValueParamUnion

func FieldValueParamOfFunnelStep

func FieldValueParamOfFunnelStep(data FunnelStepPointerParam) FieldValueParamUnion

func FieldValueParamOfGeo

func FieldValueParamOfGeo(data string) FieldValueParamUnion

func FieldValueParamOfIdentifier

func FieldValueParamOfIdentifier(data string) FieldValueParamUnion

func FieldValueParamOfInteger

func FieldValueParamOfInteger(data int64) FieldValueParamUnion

func FieldValueParamOfMonetary

func FieldValueParamOfMonetary(data MonetaryValueDataParam) FieldValueParamUnion

func FieldValueParamOfMultiLineText

func FieldValueParamOfMultiLineText(data string) FieldValueParamUnion

func FieldValueParamOfPercentage

func FieldValueParamOfPercentage(data float64) FieldValueParamUnion

func FieldValueParamOfRelation

func FieldValueParamOfRelation(data ItemPointerParam) FieldValueParamUnion

func FieldValueParamOfSingleLineText

func FieldValueParamOfSingleLineText(data string) FieldValueParamUnion

func FieldValueParamOfTelephoneNumber

func FieldValueParamOfTelephoneNumber(data string) FieldValueParamUnion

func FieldValueParamOfURL

func FieldValueParamOfURL(data string) FieldValueParamUnion

func FieldValueParamOfX

func FieldValueParamOfX(data SocialProfileXParam) FieldValueParamUnion

func (FieldValueParamUnion) GetData

func (u FieldValueParamUnion) GetData() (res fieldValueParamUnionData)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (FieldValueParamUnion) GetType

func (u FieldValueParamUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (FieldValueParamUnion) MarshalJSON

func (u FieldValueParamUnion) MarshalJSON() ([]byte, error)

func (*FieldValueParamUnion) UnmarshalJSON

func (u *FieldValueParamUnion) UnmarshalJSON(data []byte) error

type FieldValueUnion

type FieldValueUnion struct {
	// This field will be present if the value is a [[]ValueUnion] instead of an
	// object.
	OfArrayOfValues []ValueUnion `json:",inline"`
	// This field is a union of [string], [string], [string], [int64], [float64],
	// [MonetaryValueData], [float64], [bool], [string], [string], [string],
	// [SocialXValueData], [SocialLinkedInValueData], [string], [string], [time.Time],
	// [time.Time], [ChoiceFieldOption], [FunnelStep], [ItemPointer]
	Data FieldValueUnionData `json:"data"`
	Type string              `json:"type"`
	JSON struct {
		OfArrayOfValues respjson.Field
		Data            respjson.Field
		Type            respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FieldValueUnion contains all possible properties and values from SingleLineTextValue, MultiLineTextValue, IdentifierValue, IntegerValue, FloatValue, MonetaryValue, PercentageValue, BooleanValue, EmailValue, URLValue, DomainValue, SocialXValue, SocialLinkedInValue, TelephoneNumber, GeoValue, DateValue, DatetimeValue, ChoiceValue, FunnelStepValue, RelationValue, [[]ValueUnion].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfArrayOfValues]

func (FieldValueUnion) AsArrayOfValues

func (u FieldValueUnion) AsArrayOfValues() (v []ValueUnion)

func (FieldValueUnion) AsBoolean

func (u FieldValueUnion) AsBoolean() (v BooleanValue)

func (FieldValueUnion) AsChoice

func (u FieldValueUnion) AsChoice() (v ChoiceValue)

func (FieldValueUnion) AsDate

func (u FieldValueUnion) AsDate() (v DateValue)

func (FieldValueUnion) AsDateTime

func (u FieldValueUnion) AsDateTime() (v DatetimeValue)

func (FieldValueUnion) AsDomain

func (u FieldValueUnion) AsDomain() (v DomainValue)

func (FieldValueUnion) AsEmail

func (u FieldValueUnion) AsEmail() (v EmailValue)

func (FieldValueUnion) AsFloat

func (u FieldValueUnion) AsFloat() (v FloatValue)

func (FieldValueUnion) AsFunnelStep

func (u FieldValueUnion) AsFunnelStep() (v FunnelStepValue)

func (FieldValueUnion) AsGeo

func (u FieldValueUnion) AsGeo() (v GeoValue)

func (FieldValueUnion) AsIdentifier

func (u FieldValueUnion) AsIdentifier() (v IdentifierValue)

func (FieldValueUnion) AsInteger

func (u FieldValueUnion) AsInteger() (v IntegerValue)

func (FieldValueUnion) AsLinkedIn

func (u FieldValueUnion) AsLinkedIn() (v SocialLinkedInValue)

func (FieldValueUnion) AsMonetary

func (u FieldValueUnion) AsMonetary() (v MonetaryValue)

func (FieldValueUnion) AsMultiLineText

func (u FieldValueUnion) AsMultiLineText() (v MultiLineTextValue)

func (FieldValueUnion) AsPercentage

func (u FieldValueUnion) AsPercentage() (v PercentageValue)

func (FieldValueUnion) AsRelation

func (u FieldValueUnion) AsRelation() (v RelationValue)

func (FieldValueUnion) AsSingleLineText

func (u FieldValueUnion) AsSingleLineText() (v SingleLineTextValue)

func (FieldValueUnion) AsTelephoneNumber

func (u FieldValueUnion) AsTelephoneNumber() (v TelephoneNumber)

func (FieldValueUnion) AsURL

func (u FieldValueUnion) AsURL() (v URLValue)

func (FieldValueUnion) AsX

func (u FieldValueUnion) AsX() (v SocialXValue)

func (FieldValueUnion) RawJSON

func (u FieldValueUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*FieldValueUnion) UnmarshalJSON

func (r *FieldValueUnion) UnmarshalJSON(data []byte) error

type FieldValueUnionData

type FieldValueUnionData struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [int64] instead of an object.
	OfInt int64 `json:",inline"`
	// This field will be present if the value is a [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [time.Time] instead of an object.
	OfTime time.Time `json:",inline"`
	// This field is from variant [MonetaryValueData].
	Currency string `json:"currency"`
	// This field is from variant [MonetaryValueData].
	InMinorUnits int64  `json:"in_minor_units"`
	URL          string `json:"url"`
	Username     string `json:"username"`
	ID           string `json:"id"`
	Color        string `json:"color"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	// This field is from variant [FunnelStep].
	StepType FunnelStepStepType `json:"step_type"`
	// This field is from variant [ItemPointer].
	Collection CollectionPointer `json:"collection"`
	JSON       struct {
		OfString     respjson.Field
		OfInt        respjson.Field
		OfFloat      respjson.Field
		OfBool       respjson.Field
		OfTime       respjson.Field
		Currency     respjson.Field
		InMinorUnits respjson.Field
		URL          respjson.Field
		Username     respjson.Field
		ID           respjson.Field
		Color        respjson.Field
		Name         respjson.Field
		Type         respjson.Field
		StepType     respjson.Field
		Collection   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

FieldValueUnionData is an implicit subunion of FieldValueUnion. FieldValueUnionData provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the FieldValueUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfInt OfFloat OfBool OfTime]

func (*FieldValueUnionData) UnmarshalJSON

func (r *FieldValueUnionData) UnmarshalJSON(data []byte) error

type FileListParams

type FileListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FileListParams) URLQuery

func (r FileListParams) URLQuery() (v url.Values, err error)

URLQuery serializes FileListParams's query parameters as `url.Values`.

type FilePointer

type FilePointer struct {
	ID   string        `json:"id" api:"required"`
	Type constant.File `json:"type" default:"file"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (FilePointer) RawJSON

func (r FilePointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*FilePointer) UnmarshalJSON

func (r *FilePointer) UnmarshalJSON(data []byte) error

type FileService

type FileService struct {
	Options []option.RequestOption
}

Manage your meetings, files, and notes

FileService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFileService method instead.

func NewFileService

func NewFileService(opts ...option.RequestOption) (r FileService)

NewFileService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FileService) Delete

func (r *FileService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes a file.

func (*FileService) Get

func (r *FileService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *MoonbaseFile, err error)

Retrieves the details of an existing file.

func (*FileService) List

Returns a list of files that you have uploaded.

func (*FileService) ListAutoPaging

Returns a list of files that you have uploaded.

func (*FileService) Upload

func (r *FileService) Upload(ctx context.Context, body FileUploadParams, opts ...option.RequestOption) (res *MoonbaseFile, err error)

Uploads a file to your library. The file must be 5 MB or smaller.

type FileUploadParams

type FileUploadParams struct {
	// The raw file content to upload in a multipart/form-data request. Must be 5 MB or
	// smaller.
	File io.Reader `json:"file,omitzero" api:"required" format:"binary"`
	// The display name of the file.
	Name param.Opt[string] `json:"name,omitzero"`
	// Link the File to Moonbase items like a person, organization, deal, task, or an
	// item in a custom collection.
	Associations []ItemPointerParam `json:"associations,omitzero"`
	// contains filtered or unexported fields
}

func (FileUploadParams) MarshalMultipart

func (r FileUploadParams) MarshalMultipart() (data []byte, contentType string, err error)

type FloatField

type FloatField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality FloatFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind FloatFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Rating").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `rating`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/number/unitless_float` for this field.
	Type constant.FieldNumberUnitlessFloat `json:"type" default:"field/number/unitless_float"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores decimal numbers with floating-point precision.

func (FloatField) RawJSON

func (r FloatField) RawJSON() string

Returns the unmodified JSON received from the API

func (*FloatField) UnmarshalJSON

func (r *FloatField) UnmarshalJSON(data []byte) error

type FloatFieldCardinality

type FloatFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	FloatFieldCardinalityOne  FloatFieldCardinality = "one"
	FloatFieldCardinalityMany FloatFieldCardinality = "many"
)

type FloatFieldKind

type FloatFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	FloatFieldKindSystem  FloatFieldKind = "system"
	FloatFieldKindInverse FloatFieldKind = "inverse"
	FloatFieldKindCustom  FloatFieldKind = "custom"
)

type FloatValue

type FloatValue struct {
	Data float64                           `json:"data" api:"required"`
	Type constant.ValueNumberUnitlessFloat `json:"type" default:"value/number/unitless_float"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Floating point number

func (FloatValue) RawJSON

func (r FloatValue) RawJSON() string

Returns the unmodified JSON received from the API

func (FloatValue) ToParam

func (r FloatValue) ToParam() FloatValueParam

ToParam converts this FloatValue to a FloatValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with FloatValueParam.Overrides()

func (*FloatValue) UnmarshalJSON

func (r *FloatValue) UnmarshalJSON(data []byte) error

type FloatValueParam

type FloatValueParam struct {
	Data float64 `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/number/unitless_float".
	Type constant.ValueNumberUnitlessFloat `json:"type" default:"value/number/unitless_float"`
	// contains filtered or unexported fields
}

Floating point number

The properties Data, Type are required.

func (FloatValueParam) MarshalJSON

func (r FloatValueParam) MarshalJSON() (data []byte, err error)

func (*FloatValueParam) UnmarshalJSON

func (r *FloatValueParam) UnmarshalJSON(data []byte) error

type Form

type Form struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// `true` if submissions require a business email address, blocking free and
	// disposable providers.
	BusinessEmailRequired bool `json:"business_email_required" api:"required"`
	// The `Collection` that submissions to this form are saved to.
	Collection CollectionPointer `json:"collection" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The HTML snippet for embedding the form on your website.
	HTMLEmbed string `json:"html_embed" api:"required"`
	// The name of the form, used as the title on its public page.
	Name string `json:"name" api:"required"`
	// If `true`, a Moonbase Pages hosted page is enabled for this form, providing a
	// standalone public URL for sharing.
	PagesEnabled bool `json:"pages_enabled" api:"required"`
	// String representing the object’s type. Always `form` for this object.
	Type constant.Form `json:"type" default:"form"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The public URL for the form, if `pages_enabled` is `true`.
	PagesURL string `json:"pages_url" format:"uri"`
	// Optional URL the user is redirected to after a successful submission. When
	// unset, no redirect occurs. Stored as a Liquid template; rendered at submission
	// time with form field values under `submission.<key>` (keyed by the field's
	// `key`) plus UTM params (`utm_source`, `utm_medium`, `utm_campaign`, `utm_term`,
	// `utm_content`) automatically appended. Use the `uri_encode` filter for URL-safe
	// values, e.g.
	// `https://example.com/thanks?email={{ submission.email | uri_encode }}`. The
	// rendered URL must parse as a valid URL or the submission errors.
	RedirectURL string `json:"redirect_url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		BusinessEmailRequired respjson.Field
		Collection            respjson.Field
		CreatedAt             respjson.Field
		HTMLEmbed             respjson.Field
		Name                  respjson.Field
		PagesEnabled          respjson.Field
		Type                  respjson.Field
		UpdatedAt             respjson.Field
		PagesURL              respjson.Field
		RedirectURL           respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Form provides a way to create `Items` in a `Collection`, often via a public URL for external users. Each form submission creates a new item.

func (Form) RawJSON

func (r Form) RawJSON() string

Returns the unmodified JSON received from the API

func (*Form) UnmarshalJSON

func (r *Form) UnmarshalJSON(data []byte) error

type FormListParams

type FormListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FormListParams) URLQuery

func (r FormListParams) URLQuery() (v url.Values, err error)

URLQuery serializes FormListParams's query parameters as `url.Values`.

type FormListResponse

type FormListResponse struct {
	ID                    string `json:"id" api:"required"`
	BusinessEmailRequired bool   `json:"business_email_required" api:"required"`
	// A lightweight reference to a `Collection`, containing the minimal information
	// needed to identify it.
	Collection   CollectionPointer `json:"collection" api:"required"`
	CreatedAt    time.Time         `json:"created_at" api:"required" format:"date-time"`
	Name         string            `json:"name" api:"required"`
	PagesEnabled bool              `json:"pages_enabled" api:"required"`
	Type         constant.Form     `json:"type" default:"form"`
	UpdatedAt    time.Time         `json:"updated_at" api:"required" format:"date-time"`
	PagesURL     string            `json:"pages_url" format:"uri"`
	RedirectURL  string            `json:"redirect_url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                    respjson.Field
		BusinessEmailRequired respjson.Field
		Collection            respjson.Field
		CreatedAt             respjson.Field
		Name                  respjson.Field
		PagesEnabled          respjson.Field
		Type                  respjson.Field
		UpdatedAt             respjson.Field
		PagesURL              respjson.Field
		RedirectURL           respjson.Field
		ExtraFields           map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Information about the most essential attributes of a Form (does not include the embed HTML).

func (FormListResponse) RawJSON

func (r FormListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*FormListResponse) UnmarshalJSON

func (r *FormListResponse) UnmarshalJSON(data []byte) error

type FormNewParams

type FormNewParams struct {
	// The name of the form, used as the title on its public page.
	Name string `json:"name" api:"required"`
	// If `true`, submissions require a business email address. Defaults to `false`.
	BusinessEmailRequired param.Opt[bool] `json:"business_email_required,omitzero"`
	// If `true`, enables a Moonbase Pages hosted page for this form, providing a
	// standalone public URL for sharing. Defaults to `false`.
	PagesEnabled param.Opt[bool] `json:"pages_enabled,omitzero"`
	// Optional URL the user is redirected to after a successful submission. Omit to
	// leave submissions without a redirect. Stored as a Liquid template; rendered at
	// submission time with form field values under `submission.<key>` (keyed by the
	// field's `key`) plus UTM params (`utm_source`, `utm_medium`, `utm_campaign`,
	// `utm_term`, `utm_content`) automatically appended. Use the `uri_encode` filter
	// for URL-safe values, e.g.
	// `https://example.com/thanks?email={{ submission.email | uri_encode }}`. The
	// rendered URL must parse as a valid URL or the submission errors.
	RedirectURL param.Opt[string] `json:"redirect_url,omitzero"`
	// contains filtered or unexported fields
}

func (FormNewParams) MarshalJSON

func (r FormNewParams) MarshalJSON() (data []byte, err error)

func (*FormNewParams) UnmarshalJSON

func (r *FormNewParams) UnmarshalJSON(data []byte) error

type FormService

type FormService struct {
	Options []option.RequestOption
}

Manage your marketing campaigns and forms

FormService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFormService method instead.

func NewFormService

func NewFormService(opts ...option.RequestOption) (r FormService)

NewFormService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FormService) Delete

func (r *FormService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes a form. The backing collection is preserved.

func (*FormService) Get

func (r *FormService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Form, err error)

Retrieves the details of an existing form.

func (*FormService) List

Returns a list of your forms.

func (*FormService) ListAutoPaging

Returns a list of your forms.

func (*FormService) New

func (r *FormService) New(ctx context.Context, body FormNewParams, opts ...option.RequestOption) (res *Form, err error)

Creates a new form with an auto-generated collection and default fields.

func (*FormService) Update

func (r *FormService) Update(ctx context.Context, id string, body FormUpdateParams, opts ...option.RequestOption) (res *Form, err error)

Updates an existing form.

type FormUpdateParams

type FormUpdateParams struct {
	// Updated redirect URL, or `null` to clear. Omit to leave the existing value
	// unchanged. Liquid template rendered at submission time with form field values
	// under `submission.<key>` (keyed by the field's `key`) plus UTM params
	// (`utm_source`, `utm_medium`, `utm_campaign`, `utm_term`, `utm_content`)
	// automatically appended. Use the `uri_encode` filter for URL-safe values. The
	// rendered URL must parse as a valid URL or the submission errors.
	RedirectURL param.Opt[string] `json:"redirect_url,omitzero"`
	// If `true`, submissions require a business email address.
	BusinessEmailRequired param.Opt[bool] `json:"business_email_required,omitzero"`
	// The new name for the form.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, a Moonbase Pages hosted page is enabled for this form, providing a
	// standalone public URL for sharing.
	PagesEnabled param.Opt[bool] `json:"pages_enabled,omitzero"`
	// contains filtered or unexported fields
}

func (FormUpdateParams) MarshalJSON

func (r FormUpdateParams) MarshalJSON() (data []byte, err error)

func (*FormUpdateParams) UnmarshalJSON

func (r *FormUpdateParams) UnmarshalJSON(data []byte) error

type FormattedText

type FormattedText = shared.FormattedText

Structured content that can be rendered in multiple formats, currently supporting Markdown.

This is an alias to an internal type.

type FormattedTextParam

type FormattedTextParam = shared.FormattedTextParam

Structured content that can be rendered in multiple formats, currently supporting Markdown.

This is an alias to an internal type.

type Funnel

type Funnel struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The name of the funnel.
	Name string `json:"name" api:"required"`
	// An ordered list of `FunnelStep` objects that make up the funnel.
	Steps []FunnelStep `json:"steps" api:"required"`
	// String representing the object’s type. Always `funnel` for this object.
	Type constant.Funnel `json:"type" default:"funnel"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		Steps       respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Funnel represents a series of steps used to track progression.

func (Funnel) RawJSON

func (r Funnel) RawJSON() string

Returns the unmodified JSON received from the API

func (*Funnel) UnmarshalJSON

func (r *Funnel) UnmarshalJSON(data []byte) error

type FunnelListParams

type FunnelListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (FunnelListParams) URLQuery

func (r FunnelListParams) URLQuery() (v url.Values, err error)

URLQuery serializes FunnelListParams's query parameters as `url.Values`.

type FunnelNewParams

type FunnelNewParams struct {
	// The name of the funnel.
	Name string `json:"name" api:"required"`
	// An ordered list of steps to create. Array order determines step order.
	Steps []FunnelNewParamsStep `json:"steps,omitzero"`
	// contains filtered or unexported fields
}

func (FunnelNewParams) MarshalJSON

func (r FunnelNewParams) MarshalJSON() (data []byte, err error)

func (*FunnelNewParams) UnmarshalJSON

func (r *FunnelNewParams) UnmarshalJSON(data []byte) error

type FunnelNewParamsStep

type FunnelNewParamsStep struct {
	// The display color of the step.
	//
	// Any of "amber", "blue", "cyan", "emerald", "fuchsia", "green", "indigo", "lime",
	// "lunar", "orange", "pink", "purple", "red", "rose", "sky", "teal", "violet",
	// "yellow".
	Color string `json:"color,omitzero" api:"required"`
	// The name of the step.
	Name string `json:"name" api:"required"`
	// The status of the step in the funnel flow.
	//
	// - `active`: represents an in progress state within the funnel
	// - `success`: completed successfully and exited the funnel
	// - `failure`: exited the funnel without conversion
	//
	// Any of "active", "success", "failure".
	StepType string `json:"step_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating a funnel step.

The properties Color, Name, StepType are required.

func (FunnelNewParamsStep) MarshalJSON

func (r FunnelNewParamsStep) MarshalJSON() (data []byte, err error)

func (*FunnelNewParamsStep) UnmarshalJSON

func (r *FunnelNewParamsStep) UnmarshalJSON(data []byte) error

type FunnelPointerParam

type FunnelPointerParam struct {
	// The ID of the funnel.
	ID string `json:"id" api:"required"`
	// String representing the object's type. Always `funnel` for this parameter.
	//
	// This field can be elided, and will marshal its zero value as "funnel".
	Type constant.Funnel `json:"type" default:"funnel"`
	// contains filtered or unexported fields
}

A pointer to a Funnel, used as a parameter.

The properties ID, Type are required.

func (FunnelPointerParam) MarshalJSON

func (r FunnelPointerParam) MarshalJSON() (data []byte, err error)

func (*FunnelPointerParam) UnmarshalJSON

func (r *FunnelPointerParam) UnmarshalJSON(data []byte) error

type FunnelService

type FunnelService struct {
	Options []option.RequestOption
}

Manage your collections and items

FunnelService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewFunnelService method instead.

func NewFunnelService

func NewFunnelService(opts ...option.RequestOption) (r FunnelService)

NewFunnelService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*FunnelService) Delete

func (r *FunnelService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes a funnel.

func (*FunnelService) Get

func (r *FunnelService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Funnel, err error)

Retrieves the details of an existing funnel.

func (*FunnelService) List

Returns a list of funnels.

func (*FunnelService) ListAutoPaging

Returns a list of funnels.

func (*FunnelService) New

func (r *FunnelService) New(ctx context.Context, body FunnelNewParams, opts ...option.RequestOption) (res *Funnel, err error)

Creates a new funnel.

func (*FunnelService) Update

func (r *FunnelService) Update(ctx context.Context, id string, body FunnelUpdateParams, opts ...option.RequestOption) (res *Funnel, err error)

Updates a funnel.

type FunnelStep

type FunnelStep struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The display color of the step.
	//
	// Any of "amber", "blue", "cyan", "emerald", "fuchsia", "green", "indigo", "lime",
	// "lunar", "orange", "pink", "purple", "red", "rose", "sky", "teal", "violet",
	// "yellow".
	Color FunnelStepColor `json:"color" api:"required"`
	// The name of the step.
	Name string `json:"name" api:"required"`
	// The status of the step in the funnel flow.
	//
	// - `active`: represents an in progress state within the funnel
	// - `success`: completed successfully and exited the funnel
	// - `failure`: exited the funnel without conversion
	//
	// Any of "active", "success", "failure".
	StepType FunnelStepStepType `json:"step_type" api:"required"`
	// String representing the object’s type. Always `funnel_step` for this object.
	Type constant.FunnelStep `json:"type" default:"funnel_step"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Color       respjson.Field
		Name        respjson.Field
		StepType    respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a single step within a `Funnel`.

func (FunnelStep) RawJSON

func (r FunnelStep) RawJSON() string

Returns the unmodified JSON received from the API

func (*FunnelStep) UnmarshalJSON

func (r *FunnelStep) UnmarshalJSON(data []byte) error

type FunnelStepColor

type FunnelStepColor string

The display color of the step.

const (
	FunnelStepColorAmber   FunnelStepColor = "amber"
	FunnelStepColorBlue    FunnelStepColor = "blue"
	FunnelStepColorCyan    FunnelStepColor = "cyan"
	FunnelStepColorEmerald FunnelStepColor = "emerald"
	FunnelStepColorFuchsia FunnelStepColor = "fuchsia"
	FunnelStepColorGreen   FunnelStepColor = "green"
	FunnelStepColorIndigo  FunnelStepColor = "indigo"
	FunnelStepColorLime    FunnelStepColor = "lime"
	FunnelStepColorLunar   FunnelStepColor = "lunar"
	FunnelStepColorOrange  FunnelStepColor = "orange"
	FunnelStepColorPink    FunnelStepColor = "pink"
	FunnelStepColorPurple  FunnelStepColor = "purple"
	FunnelStepColorRed     FunnelStepColor = "red"
	FunnelStepColorRose    FunnelStepColor = "rose"
	FunnelStepColorSky     FunnelStepColor = "sky"
	FunnelStepColorTeal    FunnelStepColor = "teal"
	FunnelStepColorViolet  FunnelStepColor = "violet"
	FunnelStepColorYellow  FunnelStepColor = "yellow"
)

type FunnelStepPointerParam

type FunnelStepPointerParam struct {
	ID string `json:"id" api:"required"`
	// This field can be elided, and will marshal its zero value as "funnel_step".
	Type constant.FunnelStep `json:"type" default:"funnel_step"`
	// contains filtered or unexported fields
}

The properties ID, Type are required.

func (FunnelStepPointerParam) MarshalJSON

func (r FunnelStepPointerParam) MarshalJSON() (data []byte, err error)

func (*FunnelStepPointerParam) UnmarshalJSON

func (r *FunnelStepPointerParam) UnmarshalJSON(data []byte) error

type FunnelStepStepType

type FunnelStepStepType string

The status of the step in the funnel flow.

- `active`: represents an in progress state within the funnel - `success`: completed successfully and exited the funnel - `failure`: exited the funnel without conversion

const (
	FunnelStepStepTypeActive  FunnelStepStepType = "active"
	FunnelStepStepTypeSuccess FunnelStepStepType = "success"
	FunnelStepStepTypeFailure FunnelStepStepType = "failure"
)

type FunnelStepValue

type FunnelStepValue struct {
	// A specific funnel step, as configured on the Funnel.
	Data FunnelStep               `json:"data" api:"required"`
	Type constant.ValueFunnelStep `json:"type" default:"value/funnel_step"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Funnel step value

func (FunnelStepValue) RawJSON

func (r FunnelStepValue) RawJSON() string

Returns the unmodified JSON received from the API

func (*FunnelStepValue) UnmarshalJSON

func (r *FunnelStepValue) UnmarshalJSON(data []byte) error

type FunnelStepValueParam

type FunnelStepValueParam struct {
	// A specific funnel step, as configured on the Funnel.
	Data FunnelStepPointerParam `json:"data,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/funnel_step".
	Type constant.ValueFunnelStep `json:"type" default:"value/funnel_step"`
	// contains filtered or unexported fields
}

Funnel step value

The properties Data, Type are required.

func (FunnelStepValueParam) MarshalJSON

func (r FunnelStepValueParam) MarshalJSON() (data []byte, err error)

func (*FunnelStepValueParam) UnmarshalJSON

func (r *FunnelStepValueParam) UnmarshalJSON(data []byte) error

type FunnelUpdateParams

type FunnelUpdateParams struct {
	// The name of the funnel.
	Name param.Opt[string] `json:"name,omitzero"`
	// An ordered list of steps. Providing this replaces all existing steps. Omitting
	// preserves existing steps.
	Steps []FunnelUpdateParamsStep `json:"steps,omitzero"`
	// contains filtered or unexported fields
}

func (FunnelUpdateParams) MarshalJSON

func (r FunnelUpdateParams) MarshalJSON() (data []byte, err error)

func (*FunnelUpdateParams) UnmarshalJSON

func (r *FunnelUpdateParams) UnmarshalJSON(data []byte) error

type FunnelUpdateParamsStep

type FunnelUpdateParamsStep struct {
	// The display color of the step.
	//
	// Any of "amber", "blue", "cyan", "emerald", "fuchsia", "green", "indigo", "lime",
	// "lunar", "orange", "pink", "purple", "red", "rose", "sky", "teal", "violet",
	// "yellow".
	Color string `json:"color,omitzero" api:"required"`
	// The name of the step.
	Name string `json:"name" api:"required"`
	// The status of the step in the funnel flow.
	//
	// - `active`: represents an in progress state within the funnel
	// - `success`: completed successfully and exited the funnel
	// - `failure`: exited the funnel without conversion
	//
	// Any of "active", "success", "failure".
	StepType string `json:"step_type,omitzero" api:"required"`
	// The ID of an existing step to update. Omit to create a new step.
	ID param.Opt[string] `json:"id,omitzero"`
	// contains filtered or unexported fields
}

Parameters for updating a funnel step. Include `id` to update an existing step, or omit `id` to create a new one. Steps not included are removed.

The properties Color, Name, StepType are required.

func (FunnelUpdateParamsStep) MarshalJSON

func (r FunnelUpdateParamsStep) MarshalJSON() (data []byte, err error)

func (*FunnelUpdateParamsStep) UnmarshalJSON

func (r *FunnelUpdateParamsStep) UnmarshalJSON(data []byte) error

type GeoField

type GeoField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality GeoFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind GeoFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Location").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `location`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/geo` for this field.
	Type constant.FieldGeo `json:"type" default:"field/geo"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores geographic coordinates or location data.

func (GeoField) RawJSON

func (r GeoField) RawJSON() string

Returns the unmodified JSON received from the API

func (*GeoField) UnmarshalJSON

func (r *GeoField) UnmarshalJSON(data []byte) error

type GeoFieldCardinality

type GeoFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	GeoFieldCardinalityOne  GeoFieldCardinality = "one"
	GeoFieldCardinalityMany GeoFieldCardinality = "many"
)

type GeoFieldKind

type GeoFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	GeoFieldKindSystem  GeoFieldKind = "system"
	GeoFieldKindInverse GeoFieldKind = "inverse"
	GeoFieldKindCustom  GeoFieldKind = "custom"
)

type GeoValue

type GeoValue struct {
	// A string that represents some geographic location. The exact format may vary
	// based on context.
	Data string            `json:"data" api:"required"`
	Type constant.ValueGeo `json:"type" default:"value/geo"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Geographic coordinate value

func (GeoValue) RawJSON

func (r GeoValue) RawJSON() string

Returns the unmodified JSON received from the API

func (GeoValue) ToParam

func (r GeoValue) ToParam() GeoValueParam

ToParam converts this GeoValue to a GeoValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with GeoValueParam.Overrides()

func (*GeoValue) UnmarshalJSON

func (r *GeoValue) UnmarshalJSON(data []byte) error

type GeoValueParam

type GeoValueParam struct {
	// A string that represents some geographic location. The exact format may vary
	// based on context.
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as "value/geo".
	Type constant.ValueGeo `json:"type" default:"value/geo"`
	// contains filtered or unexported fields
}

Geographic coordinate value

The properties Data, Type are required.

func (GeoValueParam) MarshalJSON

func (r GeoValueParam) MarshalJSON() (data []byte, err error)

func (*GeoValueParam) UnmarshalJSON

func (r *GeoValueParam) UnmarshalJSON(data []byte) error

type IdentifierField

type IdentifierField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality IdentifierFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// Any of "system", "inverse", "custom".
	Kind IdentifierFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Stripe Id").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `stripe_id`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/identifier` for this field.
	Type constant.FieldIdentifier `json:"type" default:"field/identifier"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores opaque external identifiers verbatim.

func (IdentifierField) RawJSON

func (r IdentifierField) RawJSON() string

Returns the unmodified JSON received from the API

func (*IdentifierField) UnmarshalJSON

func (r *IdentifierField) UnmarshalJSON(data []byte) error

type IdentifierFieldCardinality

type IdentifierFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	IdentifierFieldCardinalityOne  IdentifierFieldCardinality = "one"
	IdentifierFieldCardinalityMany IdentifierFieldCardinality = "many"
)

type IdentifierFieldKind

type IdentifierFieldKind string
const (
	IdentifierFieldKindSystem  IdentifierFieldKind = "system"
	IdentifierFieldKindInverse IdentifierFieldKind = "inverse"
	IdentifierFieldKindCustom  IdentifierFieldKind = "custom"
)

type IdentifierValue

type IdentifierValue struct {
	// An external identifier as text, uo to 255 characters in length.
	Data string                   `json:"data" api:"required"`
	Type constant.ValueIdentifier `json:"type" default:"value/identifier"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Identifier string

func (IdentifierValue) RawJSON

func (r IdentifierValue) RawJSON() string

Returns the unmodified JSON received from the API

func (IdentifierValue) ToParam

ToParam converts this IdentifierValue to a IdentifierValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with IdentifierValueParam.Overrides()

func (*IdentifierValue) UnmarshalJSON

func (r *IdentifierValue) UnmarshalJSON(data []byte) error

type IdentifierValueParam

type IdentifierValueParam struct {
	// An external identifier as text, uo to 255 characters in length.
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as "value/identifier".
	Type constant.ValueIdentifier `json:"type" default:"value/identifier"`
	// contains filtered or unexported fields
}

Identifier string

The properties Data, Type are required.

func (IdentifierValueParam) MarshalJSON

func (r IdentifierValueParam) MarshalJSON() (data []byte, err error)

func (*IdentifierValueParam) UnmarshalJSON

func (r *IdentifierValueParam) UnmarshalJSON(data []byte) error

type Inbox

type Inbox struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The display name of the inbox.
	Name string `json:"name" api:"required"`
	// A list of `TagsetPointer` objects referring to the Tagsets associated with this
	// inbox, which defines the tags available for its conversations.
	Tagsets []TagsetPointer `json:"tagsets" api:"required"`
	// String representing the object’s type. Always `inbox` for this object.
	Type constant.Inbox `json:"type" default:"inbox"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	CanRead   bool      `json:"can_read"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		Tagsets     respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		CanRead     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Inbox object represents a shared inbox for receiving and sending messages.

func (Inbox) RawJSON

func (r Inbox) RawJSON() string

Returns the unmodified JSON received from the API

func (*Inbox) UnmarshalJSON

func (r *Inbox) UnmarshalJSON(data []byte) error

type InboxConversation

type InboxConversation struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// `true` if the conversation appears to be part of a bulk mailing.
	Bulk bool `json:"bulk" api:"required"`
	// The communication channel of the conversation, which can be `email`, `chat`, or
	// `slack`.
	//
	// Any of "email", "chat", "slack".
	Channel InboxConversationChannel `json:"channel" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// `true` if a new draft reply to this conversation has been started.
	Draft bool `json:"draft" api:"required"`
	// Whether the conversation is marked for follow-up.
	FollowUp bool `json:"follow_up" api:"required"`
	// The time of the most recent activity in the conversation, as an ISO 8601
	// timestamp in UTC.
	LastMessageAt time.Time `json:"last_message_at" api:"required" format:"date-time"`
	// `true` if the conversation is marked as spam.
	Spam bool `json:"spam" api:"required"`
	// The current state, which can be `unassigned`, `active`, `closed`, or `waiting`.
	//
	// Any of "unassigned", "active", "closed", "waiting".
	State InboxConversationState `json:"state" api:"required"`
	// The subject line of the conversation.
	Subject string `json:"subject" api:"required"`
	// A list of `Tag` objects applied to this conversation.
	Tags []shared.Tag `json:"tags" api:"required"`
	// `true` if the conversation is in the trash.
	Trash bool `json:"trash" api:"required"`
	// String representing the object’s type. Always `inbox_conversation` for this
	// object.
	Type constant.InboxConversation `json:"type" default:"inbox_conversation"`
	// `true` if the conversation contains unread messages.
	Unread bool `json:"unread" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The `Inbox` that this conversations belongs to.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Inbox Inbox `json:"inbox"`
	// The `Message` objects that belong to this conversation.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Messages []any `json:"messages"`
	// If the conversation is snoozed, this is the time it will reappear in the inbox,
	// as an ISO 8601 timestamp in UTC.
	UnsnoozeAt time.Time `json:"unsnooze_at" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Bulk          respjson.Field
		Channel       respjson.Field
		CreatedAt     respjson.Field
		Draft         respjson.Field
		FollowUp      respjson.Field
		LastMessageAt respjson.Field
		Spam          respjson.Field
		State         respjson.Field
		Subject       respjson.Field
		Tags          respjson.Field
		Trash         respjson.Field
		Type          respjson.Field
		Unread        respjson.Field
		UpdatedAt     respjson.Field
		Inbox         respjson.Field
		Messages      respjson.Field
		UnsnoozeAt    respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Conversation object represents a thread of related messages.

func (InboxConversation) RawJSON

func (r InboxConversation) RawJSON() string

Returns the unmodified JSON received from the API

func (*InboxConversation) UnmarshalJSON

func (r *InboxConversation) UnmarshalJSON(data []byte) error

type InboxConversationChannel

type InboxConversationChannel string

The communication channel of the conversation, which can be `email`, `chat`, or `slack`.

const (
	InboxConversationChannelEmail InboxConversationChannel = "email"
	InboxConversationChannelChat  InboxConversationChannel = "chat"
	InboxConversationChannelSlack InboxConversationChannel = "slack"
)

type InboxConversationGetParams

type InboxConversationGetParams struct {
	// Specifies which related objects to include in the response. Valid options are
	// `inbox`, `messages`, and `messages.addresses`.
	//
	// Any of "inbox", "messages", "messages.addresses".
	Include []string `query:"include,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InboxConversationGetParams) URLQuery

func (r InboxConversationGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes InboxConversationGetParams's query parameters as `url.Values`.

type InboxConversationListParams

type InboxConversationListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit   param.Opt[int64]                   `query:"limit,omitzero" json:"-"`
	InboxID InboxConversationListParamsInboxID `query:"inbox_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InboxConversationListParams) URLQuery

func (r InboxConversationListParams) URLQuery() (v url.Values, err error)

URLQuery serializes InboxConversationListParams's query parameters as `url.Values`.

type InboxConversationListParamsInboxID

type InboxConversationListParamsInboxID struct {
	Eq param.Opt[string] `query:"eq,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InboxConversationListParamsInboxID) URLQuery

func (r InboxConversationListParamsInboxID) URLQuery() (v url.Values, err error)

URLQuery serializes InboxConversationListParamsInboxID's query parameters as `url.Values`.

type InboxConversationListResponse

type InboxConversationListResponse struct {
	ID   string                     `json:"id" api:"required"`
	Type constant.InboxConversation `json:"type" default:"inbox_conversation"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (InboxConversationListResponse) RawJSON

Returns the unmodified JSON received from the API

func (*InboxConversationListResponse) UnmarshalJSON

func (r *InboxConversationListResponse) UnmarshalJSON(data []byte) error

type InboxConversationService

type InboxConversationService struct {
	Options []option.RequestOption
}

Manage your inboxes, conversations, and messages

InboxConversationService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInboxConversationService method instead.

func NewInboxConversationService

func NewInboxConversationService(opts ...option.RequestOption) (r InboxConversationService)

NewInboxConversationService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*InboxConversationService) Get

Retrieves the details of an existing conversation.

func (*InboxConversationService) List

Returns a list of your conversations.

func (*InboxConversationService) ListAutoPaging

Returns a list of your conversations.

type InboxConversationState

type InboxConversationState string

The current state, which can be `unassigned`, `active`, `closed`, or `waiting`.

const (
	InboxConversationStateUnassigned InboxConversationState = "unassigned"
	InboxConversationStateActive     InboxConversationState = "active"
	InboxConversationStateClosed     InboxConversationState = "closed"
	InboxConversationStateWaiting    InboxConversationState = "waiting"
)

type InboxListParams

type InboxListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InboxListParams) URLQuery

func (r InboxListParams) URLQuery() (v url.Values, err error)

URLQuery serializes InboxListParams's query parameters as `url.Values`.

type InboxMessageAttachmentDeleteParams

type InboxMessageAttachmentDeleteParams struct {
	InboxMessageID string `path:"inbox_message_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type InboxMessageAttachmentNewParams

type InboxMessageAttachmentNewParams struct {
	FileID param.Opt[string] `json:"file_id,omitzero"`
	File   io.Reader         `json:"file,omitzero" format:"binary"`
	// contains filtered or unexported fields
}

func (InboxMessageAttachmentNewParams) MarshalMultipart

func (r InboxMessageAttachmentNewParams) MarshalMultipart() (data []byte, contentType string, err error)

type InboxMessageAttachmentService

type InboxMessageAttachmentService struct {
	Options []option.RequestOption
}

Manage your inboxes, conversations, and messages

InboxMessageAttachmentService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInboxMessageAttachmentService method instead.

func NewInboxMessageAttachmentService

func NewInboxMessageAttachmentService(opts ...option.RequestOption) (r InboxMessageAttachmentService)

NewInboxMessageAttachmentService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*InboxMessageAttachmentService) Delete

Removes an attachment from a draft message.

func (*InboxMessageAttachmentService) New

Add an attachment to a draft message. You can send either a multipart/form-data request with the raw file content, or a JSON request with a file ID.

type InboxMessageGetParams

type InboxMessageGetParams struct {
	// Specifies which related objects to include in the response. Valid options are
	// `addresses`, `attachments`, and `conversation`.
	//
	// Any of "addresses", "attachments", "conversation".
	Include []string `query:"include,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InboxMessageGetParams) URLQuery

func (r InboxMessageGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes InboxMessageGetParams's query parameters as `url.Values`.

type InboxMessageGetResponseUnion

type InboxMessageGetResponseUnion struct {
	ID string `json:"id"`
	// This field is from variant [EmailMessage].
	Body        shared.FormattedText `json:"body"`
	Bulk        bool                 `json:"bulk"`
	CreatedAt   time.Time            `json:"created_at"`
	Draft       bool                 `json:"draft"`
	LockVersion int64                `json:"lock_version"`
	Spam        bool                 `json:"spam"`
	Subject     string               `json:"subject"`
	Trash       bool                 `json:"trash"`
	// Any of "email_message", "slack_message".
	Type   string `json:"type"`
	Unread bool   `json:"unread"`
	// This field is a union of [[]EmailMessageAddress], [[]SlackMessageAddressUnion]
	Addresses   InboxMessageGetResponseUnionAddresses `json:"addresses"`
	Attachments []MessageAttachment                   `json:"attachments"`
	// This field is from variant [EmailMessage].
	Conversation InboxConversation `json:"conversation"`
	Summary      string            `json:"summary"`
	JSON         struct {
		ID           respjson.Field
		Body         respjson.Field
		Bulk         respjson.Field
		CreatedAt    respjson.Field
		Draft        respjson.Field
		LockVersion  respjson.Field
		Spam         respjson.Field
		Subject      respjson.Field
		Trash        respjson.Field
		Type         respjson.Field
		Unread       respjson.Field
		Addresses    respjson.Field
		Attachments  respjson.Field
		Conversation respjson.Field
		Summary      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

InboxMessageGetResponseUnion contains all possible properties and values from EmailMessage, SlackMessage.

Use the InboxMessageGetResponseUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (InboxMessageGetResponseUnion) AsAny

func (u InboxMessageGetResponseUnion) AsAny() anyInboxMessageGetResponse

Use the following switch statement to find the correct variant

switch variant := InboxMessageGetResponseUnion.AsAny().(type) {
case moonbase.EmailMessage:
case moonbase.SlackMessage:
default:
  fmt.Errorf("no variant present")
}

func (InboxMessageGetResponseUnion) AsEmailMessage

func (u InboxMessageGetResponseUnion) AsEmailMessage() (v EmailMessage)

func (InboxMessageGetResponseUnion) AsSlackMessage

func (u InboxMessageGetResponseUnion) AsSlackMessage() (v SlackMessage)

func (InboxMessageGetResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*InboxMessageGetResponseUnion) UnmarshalJSON

func (r *InboxMessageGetResponseUnion) UnmarshalJSON(data []byte) error

type InboxMessageGetResponseUnionAddresses

type InboxMessageGetResponseUnionAddresses struct {
	// This field will be present if the value is a [[]EmailMessageAddress] instead of
	// an object.
	OfEmailMessageAddressArray []EmailMessageAddress `json:",inline"`
	// This field will be present if the value is a [[]SlackMessageAddressUnion]
	// instead of an object.
	OfSlackMessageAddressArray []SlackMessageAddressUnion `json:",inline"`
	JSON                       struct {
		OfEmailMessageAddressArray respjson.Field
		OfSlackMessageAddressArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

InboxMessageGetResponseUnionAddresses is an implicit subunion of InboxMessageGetResponseUnion. InboxMessageGetResponseUnionAddresses provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the InboxMessageGetResponseUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfEmailMessageAddressArray OfSlackMessageAddressArray]

func (*InboxMessageGetResponseUnionAddresses) UnmarshalJSON

func (r *InboxMessageGetResponseUnionAddresses) UnmarshalJSON(data []byte) error

type InboxMessageListParams

type InboxMessageListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit          param.Opt[int64]                     `query:"limit,omitzero" json:"-"`
	ConversationID InboxMessageListParamsConversationID `query:"conversation_id,omitzero" json:"-"`
	InboxID        InboxMessageListParamsInboxID        `query:"inbox_id,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InboxMessageListParams) URLQuery

func (r InboxMessageListParams) URLQuery() (v url.Values, err error)

URLQuery serializes InboxMessageListParams's query parameters as `url.Values`.

type InboxMessageListParamsConversationID

type InboxMessageListParamsConversationID struct {
	Eq param.Opt[string] `query:"eq,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InboxMessageListParamsConversationID) URLQuery

func (r InboxMessageListParamsConversationID) URLQuery() (v url.Values, err error)

URLQuery serializes InboxMessageListParamsConversationID's query parameters as `url.Values`.

type InboxMessageListParamsInboxID

type InboxMessageListParamsInboxID struct {
	Eq param.Opt[string] `query:"eq,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InboxMessageListParamsInboxID) URLQuery

func (r InboxMessageListParamsInboxID) URLQuery() (v url.Values, err error)

URLQuery serializes InboxMessageListParamsInboxID's query parameters as `url.Values`.

type InboxMessageNewParams

type InboxMessageNewParams struct {

	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a draft in a new conversation.
	OfEmailMessageNewConversationCreates *InboxMessageNewParamsMessageEmailMessageNewConversationCreateParams `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a draft in a new conversation.
	OfSlackMessageNewConversationCreates *InboxMessageNewParamsMessageSlackMessageNewConversationCreateParams `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a draft reply in an existing conversation.
	OfEmailMessageReplyCreates *InboxMessageNewParamsMessageEmailMessageReplyCreateParams `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for creating a draft reply in an existing conversation.
	OfSlackMessageReplyCreates *InboxMessageNewParamsMessageSlackMessageReplyCreateParams `json:",inline"`
	// contains filtered or unexported fields
}

func (InboxMessageNewParams) MarshalJSON

func (u InboxMessageNewParams) MarshalJSON() ([]byte, error)

func (*InboxMessageNewParams) UnmarshalJSON

func (r *InboxMessageNewParams) UnmarshalJSON(data []byte) error

type InboxMessageNewParamsMessageEmailMessageNewConversationCreateParams

type InboxMessageNewParamsMessageEmailMessageNewConversationCreateParams struct {
	// The email body.
	Body shared.FormattedTextParam `json:"body,omitzero" api:"required"`
	// The inbox to use for sending the email.
	InboxID string `json:"inbox_id" api:"required"`
	// The subject line of the email.
	Subject string `json:"subject" api:"required"`
	// A list of recipients.
	To []EmailMessageAddressParams `json:"to,omitzero" api:"required"`
	// A list of the BCC recipients.
	Bcc []EmailMessageAddressParams `json:"bcc,omitzero"`
	// A list of the CC recipients.
	Cc []EmailMessageAddressParams `json:"cc,omitzero"`
	// This field can be elided, and will marshal its zero value as "email_message".
	Type constant.EmailMessage `json:"type" default:"email_message"`
	// contains filtered or unexported fields
}

Parameters for creating a draft in a new conversation.

The properties Body, InboxID, Subject, To, Type are required.

func (InboxMessageNewParamsMessageEmailMessageNewConversationCreateParams) MarshalJSON

func (*InboxMessageNewParamsMessageEmailMessageNewConversationCreateParams) UnmarshalJSON

type InboxMessageNewParamsMessageEmailMessageReplyCreateParams

type InboxMessageNewParamsMessageEmailMessageReplyCreateParams struct {
	// The email body.
	Body shared.FormattedTextParam `json:"body,omitzero" api:"required"`
	// The ID of the conversation to reply to.
	ConversationID string `json:"conversation_id" api:"required"`
	// The inbox to use for sending the email.
	InboxID string `json:"inbox_id" api:"required"`
	// A list of the BCC recipients.
	Bcc []EmailMessageAddressParams `json:"bcc,omitzero"`
	// A list of the CC recipients.
	Cc []EmailMessageAddressParams `json:"cc,omitzero"`
	// A list of recipients. If omitted, recipients are derived from the conversation.
	To []EmailMessageAddressParams `json:"to,omitzero"`
	// This field can be elided, and will marshal its zero value as "email_message".
	Type constant.EmailMessage `json:"type" default:"email_message"`
	// contains filtered or unexported fields
}

Parameters for creating a draft reply in an existing conversation.

The properties Body, ConversationID, InboxID, Type are required.

func (InboxMessageNewParamsMessageEmailMessageReplyCreateParams) MarshalJSON

func (*InboxMessageNewParamsMessageEmailMessageReplyCreateParams) UnmarshalJSON

type InboxMessageNewParamsMessageSlackMessageNewConversationCreateParams

type InboxMessageNewParamsMessageSlackMessageNewConversationCreateParams struct {
	// The message body.
	Body shared.FormattedTextParam `json:"body,omitzero" api:"required"`
	// The inbox to use for sending the Slack message.
	InboxID string `json:"inbox_id" api:"required"`
	// The subject line of the conversation (not included in actual Slack message).
	Subject string `json:"subject" api:"required"`
	// The Slack channel to post the message in.
	To []SlackMessageAddressParams `json:"to,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "slack_message".
	Type constant.SlackMessage `json:"type" default:"slack_message"`
	// contains filtered or unexported fields
}

Parameters for creating a draft in a new conversation.

The properties Body, InboxID, Subject, To, Type are required.

func (InboxMessageNewParamsMessageSlackMessageNewConversationCreateParams) MarshalJSON

func (*InboxMessageNewParamsMessageSlackMessageNewConversationCreateParams) UnmarshalJSON

type InboxMessageNewParamsMessageSlackMessageReplyCreateParams

type InboxMessageNewParamsMessageSlackMessageReplyCreateParams struct {
	// The message body.
	Body shared.FormattedTextParam `json:"body,omitzero" api:"required"`
	// The ID of the conversation to reply to.
	ConversationID string `json:"conversation_id" api:"required"`
	// The inbox to use for sending the Slack message.
	InboxID string `json:"inbox_id" api:"required"`
	// The Slack channel to post the message in.
	To []SlackMessageAddressParams `json:"to,omitzero"`
	// This field can be elided, and will marshal its zero value as "slack_message".
	Type constant.SlackMessage `json:"type" default:"slack_message"`
	// contains filtered or unexported fields
}

Parameters for creating a draft reply in an existing conversation.

The properties Body, ConversationID, InboxID, Type are required.

func (InboxMessageNewParamsMessageSlackMessageReplyCreateParams) MarshalJSON

func (*InboxMessageNewParamsMessageSlackMessageReplyCreateParams) UnmarshalJSON

type InboxMessageNewResponseUnion

type InboxMessageNewResponseUnion struct {
	ID string `json:"id"`
	// This field is from variant [EmailMessage].
	Body        shared.FormattedText `json:"body"`
	Bulk        bool                 `json:"bulk"`
	CreatedAt   time.Time            `json:"created_at"`
	Draft       bool                 `json:"draft"`
	LockVersion int64                `json:"lock_version"`
	Spam        bool                 `json:"spam"`
	Subject     string               `json:"subject"`
	Trash       bool                 `json:"trash"`
	// Any of "email_message", "slack_message".
	Type   string `json:"type"`
	Unread bool   `json:"unread"`
	// This field is a union of [[]EmailMessageAddress], [[]SlackMessageAddressUnion]
	Addresses   InboxMessageNewResponseUnionAddresses `json:"addresses"`
	Attachments []MessageAttachment                   `json:"attachments"`
	// This field is from variant [EmailMessage].
	Conversation InboxConversation `json:"conversation"`
	Summary      string            `json:"summary"`
	JSON         struct {
		ID           respjson.Field
		Body         respjson.Field
		Bulk         respjson.Field
		CreatedAt    respjson.Field
		Draft        respjson.Field
		LockVersion  respjson.Field
		Spam         respjson.Field
		Subject      respjson.Field
		Trash        respjson.Field
		Type         respjson.Field
		Unread       respjson.Field
		Addresses    respjson.Field
		Attachments  respjson.Field
		Conversation respjson.Field
		Summary      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

InboxMessageNewResponseUnion contains all possible properties and values from EmailMessage, SlackMessage.

Use the InboxMessageNewResponseUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (InboxMessageNewResponseUnion) AsAny

func (u InboxMessageNewResponseUnion) AsAny() anyInboxMessageNewResponse

Use the following switch statement to find the correct variant

switch variant := InboxMessageNewResponseUnion.AsAny().(type) {
case moonbase.EmailMessage:
case moonbase.SlackMessage:
default:
  fmt.Errorf("no variant present")
}

func (InboxMessageNewResponseUnion) AsEmailMessage

func (u InboxMessageNewResponseUnion) AsEmailMessage() (v EmailMessage)

func (InboxMessageNewResponseUnion) AsSlackMessage

func (u InboxMessageNewResponseUnion) AsSlackMessage() (v SlackMessage)

func (InboxMessageNewResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*InboxMessageNewResponseUnion) UnmarshalJSON

func (r *InboxMessageNewResponseUnion) UnmarshalJSON(data []byte) error

type InboxMessageNewResponseUnionAddresses

type InboxMessageNewResponseUnionAddresses struct {
	// This field will be present if the value is a [[]EmailMessageAddress] instead of
	// an object.
	OfEmailMessageAddressArray []EmailMessageAddress `json:",inline"`
	// This field will be present if the value is a [[]SlackMessageAddressUnion]
	// instead of an object.
	OfSlackMessageAddressArray []SlackMessageAddressUnion `json:",inline"`
	JSON                       struct {
		OfEmailMessageAddressArray respjson.Field
		OfSlackMessageAddressArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

InboxMessageNewResponseUnionAddresses is an implicit subunion of InboxMessageNewResponseUnion. InboxMessageNewResponseUnionAddresses provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the InboxMessageNewResponseUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfEmailMessageAddressArray OfSlackMessageAddressArray]

func (*InboxMessageNewResponseUnionAddresses) UnmarshalJSON

func (r *InboxMessageNewResponseUnionAddresses) UnmarshalJSON(data []byte) error

type InboxMessageService

type InboxMessageService struct {
	Options []option.RequestOption
	// Manage your inboxes, conversations, and messages
	Attachments InboxMessageAttachmentService
}

Manage your inboxes, conversations, and messages

InboxMessageService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInboxMessageService method instead.

func NewInboxMessageService

func NewInboxMessageService(opts ...option.RequestOption) (r InboxMessageService)

NewInboxMessageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*InboxMessageService) Delete

func (r *InboxMessageService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes a message draft.

func (*InboxMessageService) Get

Retrieves the details of an existing message.

func (*InboxMessageService) List

Returns a list of messages.

func (*InboxMessageService) ListAutoPaging

Returns a list of messages.

func (*InboxMessageService) New

Creates a new message draft.

func (*InboxMessageService) Update

Updates an existing message draft.

type InboxMessageUpdateParams

type InboxMessageUpdateParams struct {

	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a draft message in an existing conversation.
	OfEmailMessageUpdates *InboxMessageUpdateParamsMessageEmailMessageUpdateParams `json:",inline"`
	// This field is a request body variant, only one variant field can be set.
	// Parameters for updating a draft message in an existing conversation.
	OfSlackMessageUpdates *InboxMessageUpdateParamsMessageSlackMessageUpdateParams `json:",inline"`
	// contains filtered or unexported fields
}

func (InboxMessageUpdateParams) MarshalJSON

func (u InboxMessageUpdateParams) MarshalJSON() ([]byte, error)

func (*InboxMessageUpdateParams) UnmarshalJSON

func (r *InboxMessageUpdateParams) UnmarshalJSON(data []byte) error

type InboxMessageUpdateParamsMessageEmailMessageUpdateParams

type InboxMessageUpdateParamsMessageEmailMessageUpdateParams struct {
	// The current lock version of the draft for optimistic concurrency control.
	LockVersion int64 `json:"lock_version" api:"required"`
	// The subject line of the email.
	Subject param.Opt[string] `json:"subject,omitzero"`
	// A list of the BCC recipients.
	Bcc []EmailMessageAddressParams `json:"bcc,omitzero"`
	// The email body.
	Body shared.FormattedTextParam `json:"body,omitzero"`
	// A list of the CC recipients.
	Cc []EmailMessageAddressParams `json:"cc,omitzero"`
	// A list of the recipients.
	To []EmailMessageAddressParams `json:"to,omitzero"`
	// This field can be elided, and will marshal its zero value as "email_message".
	Type constant.EmailMessage `json:"type" default:"email_message"`
	// contains filtered or unexported fields
}

Parameters for updating a draft message in an existing conversation.

The properties LockVersion, Type are required.

func (InboxMessageUpdateParamsMessageEmailMessageUpdateParams) MarshalJSON

func (*InboxMessageUpdateParamsMessageEmailMessageUpdateParams) UnmarshalJSON

type InboxMessageUpdateParamsMessageSlackMessageUpdateParams

type InboxMessageUpdateParamsMessageSlackMessageUpdateParams struct {
	// The current lock version of the draft for optimistic concurrency control.
	LockVersion int64 `json:"lock_version" api:"required"`
	// The subject line of the conversation (not included in actual Slack message).
	Subject param.Opt[string] `json:"subject,omitzero"`
	// The message body.
	Body shared.FormattedTextParam `json:"body,omitzero"`
	// The Slack channel to post the message in.
	To []SlackMessageAddressParams `json:"to,omitzero"`
	// This field can be elided, and will marshal its zero value as "slack_message".
	Type constant.SlackMessage `json:"type" default:"slack_message"`
	// contains filtered or unexported fields
}

Parameters for updating a draft message in an existing conversation.

The properties LockVersion, Type are required.

func (InboxMessageUpdateParamsMessageSlackMessageUpdateParams) MarshalJSON

func (*InboxMessageUpdateParamsMessageSlackMessageUpdateParams) UnmarshalJSON

type InboxMessageUpdateResponseUnion

type InboxMessageUpdateResponseUnion struct {
	ID string `json:"id"`
	// This field is from variant [EmailMessage].
	Body        shared.FormattedText `json:"body"`
	Bulk        bool                 `json:"bulk"`
	CreatedAt   time.Time            `json:"created_at"`
	Draft       bool                 `json:"draft"`
	LockVersion int64                `json:"lock_version"`
	Spam        bool                 `json:"spam"`
	Subject     string               `json:"subject"`
	Trash       bool                 `json:"trash"`
	// Any of "email_message", "slack_message".
	Type   string `json:"type"`
	Unread bool   `json:"unread"`
	// This field is a union of [[]EmailMessageAddress], [[]SlackMessageAddressUnion]
	Addresses   InboxMessageUpdateResponseUnionAddresses `json:"addresses"`
	Attachments []MessageAttachment                      `json:"attachments"`
	// This field is from variant [EmailMessage].
	Conversation InboxConversation `json:"conversation"`
	Summary      string            `json:"summary"`
	JSON         struct {
		ID           respjson.Field
		Body         respjson.Field
		Bulk         respjson.Field
		CreatedAt    respjson.Field
		Draft        respjson.Field
		LockVersion  respjson.Field
		Spam         respjson.Field
		Subject      respjson.Field
		Trash        respjson.Field
		Type         respjson.Field
		Unread       respjson.Field
		Addresses    respjson.Field
		Attachments  respjson.Field
		Conversation respjson.Field
		Summary      respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

InboxMessageUpdateResponseUnion contains all possible properties and values from EmailMessage, SlackMessage.

Use the InboxMessageUpdateResponseUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (InboxMessageUpdateResponseUnion) AsAny

func (u InboxMessageUpdateResponseUnion) AsAny() anyInboxMessageUpdateResponse

Use the following switch statement to find the correct variant

switch variant := InboxMessageUpdateResponseUnion.AsAny().(type) {
case moonbase.EmailMessage:
case moonbase.SlackMessage:
default:
  fmt.Errorf("no variant present")
}

func (InboxMessageUpdateResponseUnion) AsEmailMessage

func (u InboxMessageUpdateResponseUnion) AsEmailMessage() (v EmailMessage)

func (InboxMessageUpdateResponseUnion) AsSlackMessage

func (u InboxMessageUpdateResponseUnion) AsSlackMessage() (v SlackMessage)

func (InboxMessageUpdateResponseUnion) RawJSON

Returns the unmodified JSON received from the API

func (*InboxMessageUpdateResponseUnion) UnmarshalJSON

func (r *InboxMessageUpdateResponseUnion) UnmarshalJSON(data []byte) error

type InboxMessageUpdateResponseUnionAddresses

type InboxMessageUpdateResponseUnionAddresses struct {
	// This field will be present if the value is a [[]EmailMessageAddress] instead of
	// an object.
	OfEmailMessageAddressArray []EmailMessageAddress `json:",inline"`
	// This field will be present if the value is a [[]SlackMessageAddressUnion]
	// instead of an object.
	OfSlackMessageAddressArray []SlackMessageAddressUnion `json:",inline"`
	JSON                       struct {
		OfEmailMessageAddressArray respjson.Field
		OfSlackMessageAddressArray respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

InboxMessageUpdateResponseUnionAddresses is an implicit subunion of InboxMessageUpdateResponseUnion. InboxMessageUpdateResponseUnionAddresses provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the InboxMessageUpdateResponseUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfEmailMessageAddressArray OfSlackMessageAddressArray]

func (*InboxMessageUpdateResponseUnionAddresses) UnmarshalJSON

func (r *InboxMessageUpdateResponseUnionAddresses) UnmarshalJSON(data []byte) error

type InboxService

type InboxService struct {
	Options []option.RequestOption
}

Manage your inboxes, conversations, and messages

InboxService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewInboxService method instead.

func NewInboxService

func NewInboxService(opts ...option.RequestOption) (r InboxService)

NewInboxService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*InboxService) Get

func (r *InboxService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Inbox, err error)

Retrieves the details of an existing inbox.

func (*InboxService) List

func (r *InboxService) List(ctx context.Context, query InboxListParams, opts ...option.RequestOption) (res *pagination.CursorPage[Inbox], err error)

Returns a list of shared inboxes.

func (*InboxService) ListAutoPaging

Returns a list of shared inboxes.

type IntegerField

type IntegerField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality IntegerFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind IntegerFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Employee Count").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `employee_count`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/number/unitless_integer` for this
	// field.
	Type constant.FieldNumberUnitlessInteger `json:"type" default:"field/number/unitless_integer"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores whole numbers without decimal places.

func (IntegerField) RawJSON

func (r IntegerField) RawJSON() string

Returns the unmodified JSON received from the API

func (*IntegerField) UnmarshalJSON

func (r *IntegerField) UnmarshalJSON(data []byte) error

type IntegerFieldCardinality

type IntegerFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	IntegerFieldCardinalityOne  IntegerFieldCardinality = "one"
	IntegerFieldCardinalityMany IntegerFieldCardinality = "many"
)

type IntegerFieldKind

type IntegerFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	IntegerFieldKindSystem  IntegerFieldKind = "system"
	IntegerFieldKindInverse IntegerFieldKind = "inverse"
	IntegerFieldKindCustom  IntegerFieldKind = "custom"
)

type IntegerValue

type IntegerValue struct {
	Data int64                               `json:"data" api:"required"`
	Type constant.ValueNumberUnitlessInteger `json:"type" default:"value/number/unitless_integer"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Integer value without units

func (IntegerValue) RawJSON

func (r IntegerValue) RawJSON() string

Returns the unmodified JSON received from the API

func (IntegerValue) ToParam

func (r IntegerValue) ToParam() IntegerValueParam

ToParam converts this IntegerValue to a IntegerValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with IntegerValueParam.Overrides()

func (*IntegerValue) UnmarshalJSON

func (r *IntegerValue) UnmarshalJSON(data []byte) error

type IntegerValueParam

type IntegerValueParam struct {
	Data int64 `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/number/unitless_integer".
	Type constant.ValueNumberUnitlessInteger `json:"type" default:"value/number/unitless_integer"`
	// contains filtered or unexported fields
}

Integer value without units

The properties Data, Type are required.

func (IntegerValueParam) MarshalJSON

func (r IntegerValueParam) MarshalJSON() (data []byte, err error)

func (*IntegerValueParam) UnmarshalJSON

func (r *IntegerValueParam) UnmarshalJSON(data []byte) error

type Item

type Item struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// A lightweight reference to a `Collection`, containing the minimal information
	// needed to identify it.
	Collection CollectionPointer `json:"collection" api:"required"`
	// String representing the object’s type. Always `item` for this object.
	Type constant.Item `json:"type" default:"item"`
	// A hash where keys are the `ref` of a `Field` and values are the data stored for
	// that field.
	Values map[string]FieldValueUnion `json:"values" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Collection  respjson.Field
		Type        respjson.Field
		Values      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

An Item represents a single record or row within a Collection. It holds a set of `values` corresponding to the Collection's `fields`.

func (Item) RawJSON

func (r Item) RawJSON() string

Returns the unmodified JSON received from the API

func (*Item) UnmarshalJSON

func (r *Item) UnmarshalJSON(data []byte) error

type ItemPointer

type ItemPointer struct {
	// Unique identifier of the item.
	ID string `json:"id" api:"required"`
	// A reference to the `Collection` containing this item.
	Collection CollectionPointer `json:"collection" api:"required"`
	// String representing the object’s type. Always `item` for this object.
	Type constant.Item `json:"type" default:"item"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Collection  respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A reference to an `Item` within a specific `Collection`, providing the context needed to locate the item.

func (ItemPointer) RawJSON

func (r ItemPointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*ItemPointer) UnmarshalJSON

func (r *ItemPointer) UnmarshalJSON(data []byte) error

type ItemPointerParam

type ItemPointerParam struct {
	// Unique identifier of the item.
	ID string `json:"id" api:"required"`
	// String representing the object’s type. Always `item` for this object.
	//
	// This field can be elided, and will marshal its zero value as "item".
	Type constant.Item `json:"type" default:"item"`
	// contains filtered or unexported fields
}

A lightweight reference to an `Item` used in request bodies.

The properties ID, Type are required.

func (ItemPointerParam) MarshalJSON

func (r ItemPointerParam) MarshalJSON() (data []byte, err error)

func (*ItemPointerParam) UnmarshalJSON

func (r *ItemPointerParam) UnmarshalJSON(data []byte) error

type ItemsFilterAndGroup

type ItemsFilterAndGroup struct {
	// An array of filters, ALL of which must be satisfied for this `and` filter to
	// match.
	Filters []ItemsFilterUnion `json:"filters" api:"required"`
	Op      constant.And       `json:"op" default:"and"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Filters     respjson.Field
		Op          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Include only items that match ALL of the filters in `filters`.

func (ItemsFilterAndGroup) RawJSON

func (r ItemsFilterAndGroup) RawJSON() string

Returns the unmodified JSON received from the API

func (ItemsFilterAndGroup) ToParam

ToParam converts this ItemsFilterAndGroup to a ItemsFilterAndGroupParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ItemsFilterAndGroupParam.Overrides()

func (*ItemsFilterAndGroup) UnmarshalJSON

func (r *ItemsFilterAndGroup) UnmarshalJSON(data []byte) error

type ItemsFilterAndGroupParam

type ItemsFilterAndGroupParam struct {
	// An array of filters, ALL of which must be satisfied for this `and` filter to
	// match.
	Filters []ItemsFilterUnionParam `json:"filters,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "and".
	Op constant.And `json:"op" default:"and"`
	// contains filtered or unexported fields
}

Include only items that match ALL of the filters in `filters`.

The properties Filters, Op are required.

func (ItemsFilterAndGroupParam) MarshalJSON

func (r ItemsFilterAndGroupParam) MarshalJSON() (data []byte, err error)

func (*ItemsFilterAndGroupParam) UnmarshalJSON

func (r *ItemsFilterAndGroupParam) UnmarshalJSON(data []byte) error

type ItemsFilterNotGroup

type ItemsFilterNotGroup struct {
	// A nested filter which must NOT match in order for this `not` filter to match.
	Filter ItemsFilterUnion `json:"filter" api:"required"`
	Op     constant.Not     `json:"op" default:"not"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Filter      respjson.Field
		Op          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Include only items that do NOT match the nested `filter`.

func (ItemsFilterNotGroup) RawJSON

func (r ItemsFilterNotGroup) RawJSON() string

Returns the unmodified JSON received from the API

func (ItemsFilterNotGroup) ToParam

ToParam converts this ItemsFilterNotGroup to a ItemsFilterNotGroupParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ItemsFilterNotGroupParam.Overrides()

func (*ItemsFilterNotGroup) UnmarshalJSON

func (r *ItemsFilterNotGroup) UnmarshalJSON(data []byte) error

type ItemsFilterNotGroupParam

type ItemsFilterNotGroupParam struct {
	// A nested filter which must NOT match in order for this `not` filter to match.
	Filter ItemsFilterUnionParam `json:"filter,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "not".
	Op constant.Not `json:"op" default:"not"`
	// contains filtered or unexported fields
}

Include only items that do NOT match the nested `filter`.

The properties Filter, Op are required.

func (ItemsFilterNotGroupParam) MarshalJSON

func (r ItemsFilterNotGroupParam) MarshalJSON() (data []byte, err error)

func (*ItemsFilterNotGroupParam) UnmarshalJSON

func (r *ItemsFilterNotGroupParam) UnmarshalJSON(data []byte) error

type ItemsFilterOrGroup

type ItemsFilterOrGroup struct {
	// An array of filters, ANY of which must be satisfied for this `or` filter to
	// match.
	Filters []ItemsFilterUnion `json:"filters" api:"required"`
	Op      constant.Or        `json:"op" default:"or"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Filters     respjson.Field
		Op          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Include only items that match ANY of the filters in `filters`.

func (ItemsFilterOrGroup) RawJSON

func (r ItemsFilterOrGroup) RawJSON() string

Returns the unmodified JSON received from the API

func (ItemsFilterOrGroup) ToParam

ToParam converts this ItemsFilterOrGroup to a ItemsFilterOrGroupParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ItemsFilterOrGroupParam.Overrides()

func (*ItemsFilterOrGroup) UnmarshalJSON

func (r *ItemsFilterOrGroup) UnmarshalJSON(data []byte) error

type ItemsFilterOrGroupParam

type ItemsFilterOrGroupParam struct {
	// An array of filters, ANY of which must be satisfied for this `or` filter to
	// match.
	Filters []ItemsFilterUnionParam `json:"filters,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "or".
	Op constant.Or `json:"op" default:"or"`
	// contains filtered or unexported fields
}

Include only items that match ANY of the filters in `filters`.

The properties Filters, Op are required.

func (ItemsFilterOrGroupParam) MarshalJSON

func (r ItemsFilterOrGroupParam) MarshalJSON() (data []byte, err error)

func (*ItemsFilterOrGroupParam) UnmarshalJSON

func (r *ItemsFilterOrGroupParam) UnmarshalJSON(data []byte) error

type ItemsFilterUnion

type ItemsFilterUnion struct {
	Field string `json:"field"`
	// Any of nil, "exists", "and", "or", "not".
	Op string `json:"op"`
	// This field is from variant [ItemsFilterValueMatches].
	Value   ItemsFilterValueMatchesValueUnion `json:"value"`
	Filters []ItemsFilterUnion                `json:"filters"`
	// This field is from variant [ItemsFilterNotGroup].
	Filter *ItemsFilterUnion `json:"filter"`
	JSON   struct {
		Field   respjson.Field
		Op      respjson.Field
		Value   respjson.Field
		Filters respjson.Field
		Filter  respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ItemsFilterUnion contains all possible properties and values from ItemsFilterValueMatches, ItemsFilterValueExists, ItemsFilterAndGroup, ItemsFilterOrGroup, ItemsFilterNotGroup.

Use the [ItemsFilterUnion.AsAny] method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ItemsFilterUnion) AsAnd

func (u ItemsFilterUnion) AsAnd() (v ItemsFilterAndGroup)

func (ItemsFilterUnion) AsExists

func (u ItemsFilterUnion) AsExists() (v ItemsFilterValueExists)

func (ItemsFilterUnion) AsItemsFilterValueMatches

func (u ItemsFilterUnion) AsItemsFilterValueMatches() (v ItemsFilterValueMatches)

func (ItemsFilterUnion) AsNot

func (u ItemsFilterUnion) AsNot() (v ItemsFilterNotGroup)

func (ItemsFilterUnion) AsOr

func (u ItemsFilterUnion) AsOr() (v ItemsFilterOrGroup)

func (ItemsFilterUnion) RawJSON

func (u ItemsFilterUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (ItemsFilterUnion) ToParam

ToParam converts this ItemsFilterUnion to a ItemsFilterUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ItemsFilterUnionParam.Overrides()

func (*ItemsFilterUnion) UnmarshalJSON

func (r *ItemsFilterUnion) UnmarshalJSON(data []byte) error

type ItemsFilterUnionParam

type ItemsFilterUnionParam struct {
	OfItemsFilterValueMatches *ItemsFilterValueMatchesParam `json:",omitzero,inline"`
	OfExists                  *ItemsFilterValueExistsParam  `json:",omitzero,inline"`
	OfAnd                     *ItemsFilterAndGroupParam     `json:",omitzero,inline"`
	OfOr                      *ItemsFilterOrGroupParam      `json:",omitzero,inline"`
	OfNot                     *ItemsFilterNotGroupParam     `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func ItemsFilterParamOfAnd

func ItemsFilterParamOfAnd(filters []ItemsFilterUnionParam) ItemsFilterUnionParam

func ItemsFilterParamOfExists

func ItemsFilterParamOfExists(field string) ItemsFilterUnionParam

func ItemsFilterParamOfItemsFilterValueMatches

func ItemsFilterParamOfItemsFilterValueMatches[T string | float64 | bool](field string, op ItemsFilterValueMatchesOp, value T) ItemsFilterUnionParam

func ItemsFilterParamOfOr

func ItemsFilterParamOfOr(filters []ItemsFilterUnionParam) ItemsFilterUnionParam

func (ItemsFilterUnionParam) GetField

func (u ItemsFilterUnionParam) GetField() *string

Returns a pointer to the underlying variant's property, if present.

func (ItemsFilterUnionParam) GetFilter

Returns a pointer to the underlying variant's property, if present.

func (ItemsFilterUnionParam) GetFilters

Returns a pointer to the underlying variant's Filters property, if present.

func (ItemsFilterUnionParam) GetOp

func (u ItemsFilterUnionParam) GetOp() *string

Returns a pointer to the underlying variant's property, if present.

func (ItemsFilterUnionParam) GetValue

Returns a pointer to the underlying variant's property, if present.

func (ItemsFilterUnionParam) MarshalJSON

func (u ItemsFilterUnionParam) MarshalJSON() ([]byte, error)

func (*ItemsFilterUnionParam) UnmarshalJSON

func (u *ItemsFilterUnionParam) UnmarshalJSON(data []byte) error

type ItemsFilterValueExists

type ItemsFilterValueExists struct {
	// The id or key of the field for which a value must exist, or a path to the field
	// for which a value must exist.
	Field string          `json:"field" api:"required"`
	Op    constant.Exists `json:"op" default:"exists"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Field       respjson.Field
		Op          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Include only items that have a value in the given `field`.

func (ItemsFilterValueExists) RawJSON

func (r ItemsFilterValueExists) RawJSON() string

Returns the unmodified JSON received from the API

func (ItemsFilterValueExists) ToParam

ToParam converts this ItemsFilterValueExists to a ItemsFilterValueExistsParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ItemsFilterValueExistsParam.Overrides()

func (*ItemsFilterValueExists) UnmarshalJSON

func (r *ItemsFilterValueExists) UnmarshalJSON(data []byte) error

type ItemsFilterValueExistsParam

type ItemsFilterValueExistsParam struct {
	// The id or key of the field for which a value must exist, or a path to the field
	// for which a value must exist.
	Field string `json:"field" api:"required"`
	// This field can be elided, and will marshal its zero value as "exists".
	Op constant.Exists `json:"op" default:"exists"`
	// contains filtered or unexported fields
}

Include only items that have a value in the given `field`.

The properties Field, Op are required.

func (ItemsFilterValueExistsParam) MarshalJSON

func (r ItemsFilterValueExistsParam) MarshalJSON() (data []byte, err error)

func (*ItemsFilterValueExistsParam) UnmarshalJSON

func (r *ItemsFilterValueExistsParam) UnmarshalJSON(data []byte) error

type ItemsFilterValueMatches

type ItemsFilterValueMatches struct {
	// The id or key of the field in which values are matched, or a path to the field
	// in which values are matched.
	Field string `json:"field" api:"required"`
	// The matching operator for this filter.
	//
	// Any of "starts_with", "ends_with", "contains", "not_contains", "eq", "not_eq",
	// "gt", "lt", "gte", "lte".
	Op ItemsFilterValueMatchesOp `json:"op" api:"required"`
	// The value to match against. Use ISO8601 format for dates and datetime fields.
	// For date fields, the time portion of the date-time will be ignored. For currency
	// fields, the amount should be in the smallest unit of currency (eg: cents for
	// USD).
	Value ItemsFilterValueMatchesValueUnion `json:"value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Field       respjson.Field
		Op          respjson.Field
		Value       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Include only items with a value in the given `field` that satisfies the `op` condition.

func (ItemsFilterValueMatches) RawJSON

func (r ItemsFilterValueMatches) RawJSON() string

Returns the unmodified JSON received from the API

func (ItemsFilterValueMatches) ToParam

ToParam converts this ItemsFilterValueMatches to a ItemsFilterValueMatchesParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ItemsFilterValueMatchesParam.Overrides()

func (*ItemsFilterValueMatches) UnmarshalJSON

func (r *ItemsFilterValueMatches) UnmarshalJSON(data []byte) error

type ItemsFilterValueMatchesOp

type ItemsFilterValueMatchesOp string

The matching operator for this filter.

const (
	ItemsFilterValueMatchesOpStartsWith  ItemsFilterValueMatchesOp = "starts_with"
	ItemsFilterValueMatchesOpEndsWith    ItemsFilterValueMatchesOp = "ends_with"
	ItemsFilterValueMatchesOpContains    ItemsFilterValueMatchesOp = "contains"
	ItemsFilterValueMatchesOpNotContains ItemsFilterValueMatchesOp = "not_contains"
	ItemsFilterValueMatchesOpEq          ItemsFilterValueMatchesOp = "eq"
	ItemsFilterValueMatchesOpNotEq       ItemsFilterValueMatchesOp = "not_eq"
	ItemsFilterValueMatchesOpGt          ItemsFilterValueMatchesOp = "gt"
	ItemsFilterValueMatchesOpLt          ItemsFilterValueMatchesOp = "lt"
	ItemsFilterValueMatchesOpGte         ItemsFilterValueMatchesOp = "gte"
	ItemsFilterValueMatchesOpLte         ItemsFilterValueMatchesOp = "lte"
)

type ItemsFilterValueMatchesParam

type ItemsFilterValueMatchesParam struct {
	// The id or key of the field in which values are matched, or a path to the field
	// in which values are matched.
	Field string `json:"field" api:"required"`
	// The matching operator for this filter.
	//
	// Any of "starts_with", "ends_with", "contains", "not_contains", "eq", "not_eq",
	// "gt", "lt", "gte", "lte".
	Op ItemsFilterValueMatchesOp `json:"op,omitzero" api:"required"`
	// The value to match against. Use ISO8601 format for dates and datetime fields.
	// For date fields, the time portion of the date-time will be ignored. For currency
	// fields, the amount should be in the smallest unit of currency (eg: cents for
	// USD).
	Value ItemsFilterValueMatchesValueUnionParam `json:"value,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Include only items with a value in the given `field` that satisfies the `op` condition.

The properties Field, Op, Value are required.

func (ItemsFilterValueMatchesParam) MarshalJSON

func (r ItemsFilterValueMatchesParam) MarshalJSON() (data []byte, err error)

func (*ItemsFilterValueMatchesParam) UnmarshalJSON

func (r *ItemsFilterValueMatchesParam) UnmarshalJSON(data []byte) error

type ItemsFilterValueMatchesValueUnion

type ItemsFilterValueMatchesValueUnion struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	JSON   struct {
		OfString respjson.Field
		OfFloat  respjson.Field
		OfBool   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ItemsFilterValueMatchesValueUnion contains all possible properties and values from [string], [float64], [bool].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfFloat OfBool]

func (ItemsFilterValueMatchesValueUnion) AsBool

func (u ItemsFilterValueMatchesValueUnion) AsBool() (v bool)

func (ItemsFilterValueMatchesValueUnion) AsFloat

func (ItemsFilterValueMatchesValueUnion) AsString

func (u ItemsFilterValueMatchesValueUnion) AsString() (v string)

func (ItemsFilterValueMatchesValueUnion) RawJSON

Returns the unmodified JSON received from the API

func (*ItemsFilterValueMatchesValueUnion) UnmarshalJSON

func (r *ItemsFilterValueMatchesValueUnion) UnmarshalJSON(data []byte) error

type ItemsFilterValueMatchesValueUnionParam

type ItemsFilterValueMatchesValueUnionParam struct {
	OfString param.Opt[string]  `json:",omitzero,inline"`
	OfFloat  param.Opt[float64] `json:",omitzero,inline"`
	OfBool   param.Opt[bool]    `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ItemsFilterValueMatchesValueUnionParam) MarshalJSON

func (u ItemsFilterValueMatchesValueUnionParam) MarshalJSON() ([]byte, error)

func (*ItemsFilterValueMatchesValueUnionParam) UnmarshalJSON

func (u *ItemsFilterValueMatchesValueUnionParam) UnmarshalJSON(data []byte) error

type Meeting

type Meeting struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The end time of the meeting, as an ISO 8601 timestamp in UTC.
	EndAt time.Time `json:"end_at" api:"required" format:"date-time"`
	// The globally unique iCalendar UID for the meeting event.
	ICalUid string `json:"i_cal_uid" api:"required"`
	// The unique identifier for the meeting from the external calendar provider (e.g.,
	// Google Calendar).
	ProviderID string `json:"provider_id" api:"required"`
	// The start time of the meeting, as an ISO 8601 timestamp in UTC.
	StartAt time.Time `json:"start_at" api:"required" format:"date-time"`
	// The tags currently applied to this meeting.
	Tags []shared.Tag `json:"tags" api:"required"`
	// The IANA time zone in which the meeting is scheduled (e.g.,
	// `America/Los_Angeles`).
	TimeZone string `json:"time_zone" api:"required"`
	// String representing the object’s type. Always `meeting` for this object.
	Type constant.Meeting `json:"type" default:"meeting"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// A list of `Attendee` objects for the meeting.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Attendees []Attendee `json:"attendees"`
	// A detailed description or agenda for the meeting.
	Description string `json:"description"`
	// The duration of the meeting in seconds.
	Duration float64 `json:"duration"`
	// The physical or virtual location of the meeting.
	Location string `json:"location"`
	// The Note object represents a block of text content, often used for meeting notes
	// or summaries.
	Note Note `json:"note" api:"nullable"`
	// The `Organizer` of the meeting.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Organizer Organizer `json:"organizer"`
	// A URL to access the meeting in the external provider's system.
	ProviderUri string `json:"provider_uri" format:"uri"`
	// A temporary, signed URL to download the meeting recording. The URL expires after
	// one hour.
	RecordingURL string `json:"recording_url" format:"uri"`
	// The Note object represents a block of text content, often used for meeting notes
	// or summaries.
	Summary Note `json:"summary" api:"nullable"`
	// The title or subject of the meeting.
	Title      string            `json:"title"`
	Transcript MeetingTranscript `json:"transcript" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		CreatedAt    respjson.Field
		EndAt        respjson.Field
		ICalUid      respjson.Field
		ProviderID   respjson.Field
		StartAt      respjson.Field
		Tags         respjson.Field
		TimeZone     respjson.Field
		Type         respjson.Field
		UpdatedAt    respjson.Field
		Attendees    respjson.Field
		Description  respjson.Field
		Duration     respjson.Field
		Location     respjson.Field
		Note         respjson.Field
		Organizer    respjson.Field
		ProviderUri  respjson.Field
		RecordingURL respjson.Field
		Summary      respjson.Field
		Title        respjson.Field
		Transcript   respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Meeting object represents a calendar event. It includes details about the participants, timing, and associated content like summaries and recordings.

func (Meeting) RawJSON

func (r Meeting) RawJSON() string

Returns the unmodified JSON received from the API

func (*Meeting) UnmarshalJSON

func (r *Meeting) UnmarshalJSON(data []byte) error

type MeetingGetParams

type MeetingGetParams struct {
	// Specifies which related objects to include in the response. Valid options are
	// `organizer`, `attendees`, `transcript`, `note`, and `summary`.
	//
	// Any of "organizer", "attendees", "transcript", "note", "summary".
	Include []string `query:"include,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MeetingGetParams) URLQuery

func (r MeetingGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes MeetingGetParams's query parameters as `url.Values`.

type MeetingListParams

type MeetingListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit   param.Opt[int64]         `query:"limit,omitzero" json:"-"`
	ICalUid MeetingListParamsICalUid `query:"i_cal_uid,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MeetingListParams) URLQuery

func (r MeetingListParams) URLQuery() (v url.Values, err error)

URLQuery serializes MeetingListParams's query parameters as `url.Values`.

type MeetingListParamsICalUid

type MeetingListParamsICalUid struct {
	Eq param.Opt[string] `query:"eq,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (MeetingListParamsICalUid) URLQuery

func (r MeetingListParamsICalUid) URLQuery() (v url.Values, err error)

URLQuery serializes MeetingListParamsICalUid's query parameters as `url.Values`.

type MeetingPointer

type MeetingPointer struct {
	ID   string           `json:"id" api:"required"`
	Type constant.Meeting `json:"type" default:"meeting"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MeetingPointer) RawJSON

func (r MeetingPointer) RawJSON() string

Returns the unmodified JSON received from the API

func (MeetingPointer) ToParam

func (r MeetingPointer) ToParam() MeetingPointerParam

ToParam converts this MeetingPointer to a MeetingPointerParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with MeetingPointerParam.Overrides()

func (*MeetingPointer) UnmarshalJSON

func (r *MeetingPointer) UnmarshalJSON(data []byte) error

type MeetingPointerParam

type MeetingPointerParam struct {
	ID string `json:"id" api:"required"`
	// This field can be elided, and will marshal its zero value as "meeting".
	Type constant.Meeting `json:"type" default:"meeting"`
	// contains filtered or unexported fields
}

The properties ID, Type are required.

func (MeetingPointerParam) MarshalJSON

func (r MeetingPointerParam) MarshalJSON() (data []byte, err error)

func (*MeetingPointerParam) UnmarshalJSON

func (r *MeetingPointerParam) UnmarshalJSON(data []byte) error

type MeetingService

type MeetingService struct {
	Options []option.RequestOption
}

Manage your meetings, files, and notes

MeetingService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewMeetingService method instead.

func NewMeetingService

func NewMeetingService(opts ...option.RequestOption) (r MeetingService)

NewMeetingService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*MeetingService) Get

func (r *MeetingService) Get(ctx context.Context, id string, query MeetingGetParams, opts ...option.RequestOption) (res *Meeting, err error)

Retrieves the details of an existing meeting.

func (*MeetingService) List

Returns a list of meetings.

func (*MeetingService) ListAutoPaging

Returns a list of meetings.

func (*MeetingService) Update

func (r *MeetingService) Update(ctx context.Context, id string, body MeetingUpdateParams, opts ...option.RequestOption) (res *Meeting, err error)

Adds a transcript, recording, or tags to an existing meeting.

type MeetingTranscript

type MeetingTranscript struct {
	Cues []MeetingTranscriptCue `json:"cues" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Cues        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MeetingTranscript) RawJSON

func (r MeetingTranscript) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeetingTranscript) UnmarshalJSON

func (r *MeetingTranscript) UnmarshalJSON(data []byte) error

type MeetingTranscriptCue

type MeetingTranscriptCue struct {
	From    float64                  `json:"from" api:"required"`
	Speaker MeetingTranscriptSpeaker `json:"speaker" api:"required"`
	Text    string                   `json:"text" api:"required"`
	To      float64                  `json:"to" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		From        respjson.Field
		Speaker     respjson.Field
		Text        respjson.Field
		To          respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MeetingTranscriptCue) RawJSON

func (r MeetingTranscriptCue) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeetingTranscriptCue) UnmarshalJSON

func (r *MeetingTranscriptCue) UnmarshalJSON(data []byte) error

type MeetingTranscriptSpeaker

type MeetingTranscriptSpeaker struct {
	AttendeeID string `json:"attendee_id"`
	Label      string `json:"label"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AttendeeID  respjson.Field
		Label       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MeetingTranscriptSpeaker) RawJSON

func (r MeetingTranscriptSpeaker) RawJSON() string

Returns the unmodified JSON received from the API

func (*MeetingTranscriptSpeaker) UnmarshalJSON

func (r *MeetingTranscriptSpeaker) UnmarshalJSON(data []byte) error

type MeetingUpdateParams

type MeetingUpdateParams struct {
	// A video recording of the meeting.
	Recording MeetingUpdateParamsRecording `json:"recording,omitzero"`
	// Optional list of tag pointers to assign to the meeting. If omitted, existing
	// tags are unchanged. Pass an empty array to clear tags.
	Tags []shared.TagPointerParam `json:"tags,omitzero"`
	// The meeting transcript.
	Transcript MeetingUpdateParamsTranscript `json:"transcript,omitzero"`
	// contains filtered or unexported fields
}

func (MeetingUpdateParams) MarshalJSON

func (r MeetingUpdateParams) MarshalJSON() (data []byte, err error)

func (*MeetingUpdateParams) UnmarshalJSON

func (r *MeetingUpdateParams) UnmarshalJSON(data []byte) error

type MeetingUpdateParamsRecording

type MeetingUpdateParamsRecording struct {
	// The content type of the recording. Note that only `video/mp4` is supported at
	// this time.
	//
	// Any of "video/mp4".
	ContentType string `json:"content_type,omitzero" api:"required"`
	// The unique identifier for the recording from the provider's system.
	ProviderID string `json:"provider_id" api:"required"`
	// The URL pointing to the recording.
	URL string `json:"url" api:"required" format:"uri"`
	// contains filtered or unexported fields
}

A video recording of the meeting.

The properties ContentType, ProviderID, URL are required.

func (MeetingUpdateParamsRecording) MarshalJSON

func (r MeetingUpdateParamsRecording) MarshalJSON() (data []byte, err error)

func (*MeetingUpdateParamsRecording) UnmarshalJSON

func (r *MeetingUpdateParamsRecording) UnmarshalJSON(data []byte) error

type MeetingUpdateParamsTranscript

type MeetingUpdateParamsTranscript struct {
	// A list of cues that identify the text spoken in specific time slices of the
	// meeting.
	Cues []MeetingUpdateParamsTranscriptCue `json:"cues,omitzero" api:"required"`
	// Identifies the source of the transcript.
	Provider string `json:"provider" api:"required"`
	// The unique identifier for the transcript from the provider's system.
	ProviderID string `json:"provider_id" api:"required"`
	// contains filtered or unexported fields
}

The meeting transcript.

The properties Cues, Provider, ProviderID are required.

func (MeetingUpdateParamsTranscript) MarshalJSON

func (r MeetingUpdateParamsTranscript) MarshalJSON() (data []byte, err error)

func (*MeetingUpdateParamsTranscript) UnmarshalJSON

func (r *MeetingUpdateParamsTranscript) UnmarshalJSON(data []byte) error

type MeetingUpdateParamsTranscriptCue

type MeetingUpdateParamsTranscriptCue struct {
	// The start time of the slice, in fractional seconds from the start of the
	// meeting.
	From float64 `json:"from" api:"required"`
	// The name of the person speaking.
	Speaker string `json:"speaker" api:"required"`
	// The text spoken during the slice.
	Text string `json:"text" api:"required"`
	// The end time of the slice, in fractional seconds from the start of the meeting.
	To float64 `json:"to" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating a `MeetingTranscriptCue` object to capture the text spoken in a specific time slice.

The properties From, Speaker, Text, To are required.

func (MeetingUpdateParamsTranscriptCue) MarshalJSON

func (r MeetingUpdateParamsTranscriptCue) MarshalJSON() (data []byte, err error)

func (*MeetingUpdateParamsTranscriptCue) UnmarshalJSON

func (r *MeetingUpdateParamsTranscriptCue) UnmarshalJSON(data []byte) error

type MessageAttachment

type MessageAttachment struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// A temporary, signed URL to download the file content. The URL expires after one
	// hour.
	DownloadURL string `json:"download_url" api:"required" format:"uri"`
	// The original name of the uploaded file, including its extension.
	Filename string `json:"filename" api:"required"`
	// The size of the file in bytes.
	Size int64 `json:"size" api:"required"`
	// String representing the object’s type. Always `message_attachment` for this
	// object.
	Type constant.MessageAttachment `json:"type" default:"message_attachment"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		CreatedAt   respjson.Field
		DownloadURL respjson.Field
		Filename    respjson.Field
		Size        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Attachment object represents a file attached to a message. You can download the file content via the `download_url`.

func (MessageAttachment) RawJSON

func (r MessageAttachment) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessageAttachment) UnmarshalJSON

func (r *MessageAttachment) UnmarshalJSON(data []byte) error

type MessagePointer

type MessagePointer struct {
	ID   string           `json:"id" api:"required"`
	Type constant.Message `json:"type" default:"message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (MessagePointer) RawJSON

func (r MessagePointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*MessagePointer) UnmarshalJSON

func (r *MessagePointer) UnmarshalJSON(data []byte) error

type MonetaryField

type MonetaryField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality MonetaryFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The default currency for the field, as a 3-letter ISO 4217 code (e.g., `USD`,
	// `EUR`, `GBP`).
	DefaultUnit   string                   `json:"default_unit" api:"required"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind MonetaryFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Deal Value").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `deal_value`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/number/monetary` for this field.
	Type constant.FieldNumberMonetary `json:"type" default:"field/number/monetary"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultUnit   respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores monetary amounts with currency information.

func (MonetaryField) RawJSON

func (r MonetaryField) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonetaryField) UnmarshalJSON

func (r *MonetaryField) UnmarshalJSON(data []byte) error

type MonetaryFieldCardinality

type MonetaryFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	MonetaryFieldCardinalityOne  MonetaryFieldCardinality = "one"
	MonetaryFieldCardinalityMany MonetaryFieldCardinality = "many"
)

type MonetaryFieldKind

type MonetaryFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	MonetaryFieldKindSystem  MonetaryFieldKind = "system"
	MonetaryFieldKindInverse MonetaryFieldKind = "inverse"
	MonetaryFieldKindCustom  MonetaryFieldKind = "custom"
)

type MonetaryValue

type MonetaryValue struct {
	// A monetary amount is composed of the amount in the smallest unit of a currency
	// and an ISO currency code.
	Data MonetaryValueData            `json:"data" api:"required"`
	Type constant.ValueNumberMonetary `json:"type" default:"value/number/monetary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Monetary or currency value

func (MonetaryValue) RawJSON

func (r MonetaryValue) RawJSON() string

Returns the unmodified JSON received from the API

func (MonetaryValue) ToParam

func (r MonetaryValue) ToParam() MonetaryValueParam

ToParam converts this MonetaryValue to a MonetaryValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with MonetaryValueParam.Overrides()

func (*MonetaryValue) UnmarshalJSON

func (r *MonetaryValue) UnmarshalJSON(data []byte) error

type MonetaryValueData

type MonetaryValueData struct {
	// The 3-letter ISO 4217 currency code
	Currency string `json:"currency" api:"required"`
	// The amount in the minor units of the currency. For example, $10 (10 USD) would
	// be 1000. Minor units conversion depends on the currency.
	InMinorUnits int64 `json:"in_minor_units" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Currency     respjson.Field
		InMinorUnits respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A monetary amount is composed of the amount in the smallest unit of a currency and an ISO currency code.

func (MonetaryValueData) RawJSON

func (r MonetaryValueData) RawJSON() string

Returns the unmodified JSON received from the API

func (*MonetaryValueData) UnmarshalJSON

func (r *MonetaryValueData) UnmarshalJSON(data []byte) error

type MonetaryValueDataParam

type MonetaryValueDataParam struct {
	// The 3-letter ISO 4217 currency code
	Currency string `json:"currency" api:"required"`
	// The amount in the minor units of the currency. For example, $10 (10 USD) would
	// be 1000. Minor units conversion depends on the currency.
	InMinorUnits int64 `json:"in_minor_units" api:"required"`
	// contains filtered or unexported fields
}

A monetary amount is composed of the amount in the smallest unit of a currency and an ISO currency code.

The properties Currency, InMinorUnits are required.

func (MonetaryValueDataParam) MarshalJSON

func (r MonetaryValueDataParam) MarshalJSON() (data []byte, err error)

func (*MonetaryValueDataParam) UnmarshalJSON

func (r *MonetaryValueDataParam) UnmarshalJSON(data []byte) error

type MonetaryValueParam

type MonetaryValueParam struct {
	// A monetary amount is composed of the amount in the smallest unit of a currency
	// and an ISO currency code.
	Data MonetaryValueDataParam `json:"data,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/number/monetary".
	Type constant.ValueNumberMonetary `json:"type" default:"value/number/monetary"`
	// contains filtered or unexported fields
}

Monetary or currency value

The properties Data, Type are required.

func (MonetaryValueParam) MarshalJSON

func (r MonetaryValueParam) MarshalJSON() (data []byte, err error)

func (*MonetaryValueParam) UnmarshalJSON

func (r *MonetaryValueParam) UnmarshalJSON(data []byte) error

type MoonbaseFile

type MoonbaseFile struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// A list of items this file is associated with.
	Associations []ItemPointer `json:"associations" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// A temporary, signed URL to download the file content. The URL expires after one
	// hour.
	DownloadURL string `json:"download_url" api:"required" format:"uri"`
	// The original filename of the uploaded file.
	Filename string `json:"filename" api:"required"`
	// The display name of the file.
	Name string `json:"name" api:"required"`
	// The size of the file in bytes.
	Size float64 `json:"size" api:"required"`
	// String representing the object’s type. Always `file` for this object.
	Type constant.File `json:"type" default:"file"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Associations respjson.Field
		CreatedAt    respjson.Field
		DownloadURL  respjson.Field
		Filename     respjson.Field
		Name         respjson.Field
		Size         respjson.Field
		Type         respjson.Field
		UpdatedAt    respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The File object represents a file that has been uploaded to your library.

func (MoonbaseFile) RawJSON

func (r MoonbaseFile) RawJSON() string

Returns the unmodified JSON received from the API

func (*MoonbaseFile) UnmarshalJSON

func (r *MoonbaseFile) UnmarshalJSON(data []byte) error

type MultiLineTextField

type MultiLineTextField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality MultiLineTextFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind MultiLineTextFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Description").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `description`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/text/multi_line` for this field.
	Type constant.FieldTextMultiLine `json:"type" default:"field/text/multi_line"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores multiple lines of text with line breaks preserved.

func (MultiLineTextField) RawJSON

func (r MultiLineTextField) RawJSON() string

Returns the unmodified JSON received from the API

func (*MultiLineTextField) UnmarshalJSON

func (r *MultiLineTextField) UnmarshalJSON(data []byte) error

type MultiLineTextFieldCardinality

type MultiLineTextFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	MultiLineTextFieldCardinalityOne  MultiLineTextFieldCardinality = "one"
	MultiLineTextFieldCardinalityMany MultiLineTextFieldCardinality = "many"
)

type MultiLineTextFieldKind

type MultiLineTextFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	MultiLineTextFieldKindSystem  MultiLineTextFieldKind = "system"
	MultiLineTextFieldKindInverse MultiLineTextFieldKind = "inverse"
	MultiLineTextFieldKindCustom  MultiLineTextFieldKind = "custom"
)

type MultiLineTextValue

type MultiLineTextValue struct {
	// Text which may contain line breaks, can be up to 65,536 characters long. Do not
	// use markdown formatting, just plain text.
	Data string                      `json:"data" api:"required"`
	Type constant.ValueTextMultiLine `json:"type" default:"value/text/multi_line"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Multiple lines of text

func (MultiLineTextValue) RawJSON

func (r MultiLineTextValue) RawJSON() string

Returns the unmodified JSON received from the API

func (MultiLineTextValue) ToParam

ToParam converts this MultiLineTextValue to a MultiLineTextValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with MultiLineTextValueParam.Overrides()

func (*MultiLineTextValue) UnmarshalJSON

func (r *MultiLineTextValue) UnmarshalJSON(data []byte) error

type MultiLineTextValueParam

type MultiLineTextValueParam struct {
	// Text which may contain line breaks, can be up to 65,536 characters long. Do not
	// use markdown formatting, just plain text.
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/text/multi_line".
	Type constant.ValueTextMultiLine `json:"type" default:"value/text/multi_line"`
	// contains filtered or unexported fields
}

Multiple lines of text

The properties Data, Type are required.

func (MultiLineTextValueParam) MarshalJSON

func (r MultiLineTextValueParam) MarshalJSON() (data []byte, err error)

func (*MultiLineTextValueParam) UnmarshalJSON

func (r *MultiLineTextValueParam) UnmarshalJSON(data []byte) error

type Note

type Note struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// A list of items, meetings or calls this note is associated with.
	Associations []NoteAssociationPointerUnion `json:"associations" api:"required"`
	// The main content of the note.
	Body shared.FormattedText `json:"body" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The current lock version of the note for optimistic concurrency control.
	LockVersion int64 `json:"lock_version" api:"required"`
	// String representing the object’s type. Always `note` for this object.
	Type constant.Note `json:"type" default:"note"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Creator ItemPointer `json:"creator" api:"nullable"`
	// A short, system-generated summary of the note's content.
	Summary string `json:"summary"`
	// An optional title for the note.
	Title string `json:"title"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Associations respjson.Field
		Body         respjson.Field
		CreatedAt    respjson.Field
		LockVersion  respjson.Field
		Type         respjson.Field
		UpdatedAt    respjson.Field
		Creator      respjson.Field
		Summary      respjson.Field
		Title        respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Note object represents a block of text content, often used for meeting notes or summaries.

func (Note) RawJSON

func (r Note) RawJSON() string

Returns the unmodified JSON received from the API

func (*Note) UnmarshalJSON

func (r *Note) UnmarshalJSON(data []byte) error

type NoteAssociationParamPointerUnion

type NoteAssociationParamPointerUnion struct {
	OfCall    *CallPointerParam    `json:",omitzero,inline"`
	OfItem    *ItemPointerParam    `json:",omitzero,inline"`
	OfMeeting *MeetingPointerParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func NoteAssociationParamPointerOfCall

func NoteAssociationParamPointerOfCall(id string) NoteAssociationParamPointerUnion

func NoteAssociationParamPointerOfItem

func NoteAssociationParamPointerOfItem(id string) NoteAssociationParamPointerUnion

func NoteAssociationParamPointerOfMeeting

func NoteAssociationParamPointerOfMeeting(id string) NoteAssociationParamPointerUnion

func (NoteAssociationParamPointerUnion) GetID

Returns a pointer to the underlying variant's property, if present.

func (NoteAssociationParamPointerUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (NoteAssociationParamPointerUnion) MarshalJSON

func (u NoteAssociationParamPointerUnion) MarshalJSON() ([]byte, error)

func (*NoteAssociationParamPointerUnion) UnmarshalJSON

func (u *NoteAssociationParamPointerUnion) UnmarshalJSON(data []byte) error

type NoteAssociationPointerUnion

type NoteAssociationPointerUnion struct {
	ID string `json:"id"`
	// Any of "call", "item", "meeting".
	Type string `json:"type"`
	// This field is from variant [ItemPointer].
	Collection CollectionPointer `json:"collection"`
	JSON       struct {
		ID         respjson.Field
		Type       respjson.Field
		Collection respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

NoteAssociationPointerUnion contains all possible properties and values from CallPointer, ItemPointer, MeetingPointer.

Use the NoteAssociationPointerUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (NoteAssociationPointerUnion) AsAny

func (u NoteAssociationPointerUnion) AsAny() anyNoteAssociationPointer

Use the following switch statement to find the correct variant

switch variant := NoteAssociationPointerUnion.AsAny().(type) {
case moonbase.CallPointer:
case moonbase.ItemPointer:
case moonbase.MeetingPointer:
default:
  fmt.Errorf("no variant present")
}

func (NoteAssociationPointerUnion) AsCall

func (NoteAssociationPointerUnion) AsItem

func (NoteAssociationPointerUnion) AsMeeting

func (u NoteAssociationPointerUnion) AsMeeting() (v MeetingPointer)

func (NoteAssociationPointerUnion) RawJSON

func (u NoteAssociationPointerUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*NoteAssociationPointerUnion) UnmarshalJSON

func (r *NoteAssociationPointerUnion) UnmarshalJSON(data []byte) error

type NoteListParams

type NoteListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (NoteListParams) URLQuery

func (r NoteListParams) URLQuery() (v url.Values, err error)

URLQuery serializes NoteListParams's query parameters as `url.Values`.

type NoteNewParams

type NoteNewParams struct {
	// The main content of the note.
	Body shared.FormattedTextParam `json:"body,omitzero" api:"required"`
	// Link the Note to Moonbase items (person, organization, deal, task, or an item in
	// a custom collection), meetings, or calls.
	Associations []NoteAssociationParamPointerUnion `json:"associations,omitzero"`
	// contains filtered or unexported fields
}

func (NoteNewParams) MarshalJSON

func (r NoteNewParams) MarshalJSON() (data []byte, err error)

func (*NoteNewParams) UnmarshalJSON

func (r *NoteNewParams) UnmarshalJSON(data []byte) error

type NotePointer

type NotePointer struct {
	ID   string        `json:"id" api:"required"`
	Type constant.Note `json:"type" default:"note"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (NotePointer) RawJSON

func (r NotePointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*NotePointer) UnmarshalJSON

func (r *NotePointer) UnmarshalJSON(data []byte) error

type NoteService

type NoteService struct {
	Options []option.RequestOption
}

Manage your meetings, files, and notes

NoteService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewNoteService method instead.

func NewNoteService

func NewNoteService(opts ...option.RequestOption) (r NoteService)

NewNoteService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*NoteService) Delete

func (r *NoteService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes a note.

func (*NoteService) Get

func (r *NoteService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Note, err error)

Retrieves the details of an existing note.

func (*NoteService) List

func (r *NoteService) List(ctx context.Context, query NoteListParams, opts ...option.RequestOption) (res *pagination.CursorPage[Note], err error)

Returns a list of your notes.

func (*NoteService) ListAutoPaging

Returns a list of your notes.

func (*NoteService) New

func (r *NoteService) New(ctx context.Context, body NoteNewParams, opts ...option.RequestOption) (res *Note, err error)

Create a new note.

func (*NoteService) Update

func (r *NoteService) Update(ctx context.Context, id string, body NoteUpdateParams, opts ...option.RequestOption) (res *Note, err error)

Update an existing note.

type NoteUpdateParams

type NoteUpdateParams struct {
	// The main content of the note.
	Body shared.FormattedTextParam `json:"body,omitzero" api:"required"`
	// The current lock version of the note for optimistic concurrency control.
	LockVersion int64 `json:"lock_version" api:"required"`
	// contains filtered or unexported fields
}

func (NoteUpdateParams) MarshalJSON

func (r NoteUpdateParams) MarshalJSON() (data []byte, err error)

func (*NoteUpdateParams) UnmarshalJSON

func (r *NoteUpdateParams) UnmarshalJSON(data []byte) error

type Organizer

type Organizer struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The email address of the organizer.
	Email string `json:"email" api:"required" format:"email"`
	// String representing the object’s type. Always `meeting_organizer` for this
	// object.
	Type constant.MeetingOrganizer `json:"type" default:"meeting_organizer"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Organization ItemPointer `json:"organization"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Person ItemPointer `json:"person"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Email        respjson.Field
		Type         respjson.Field
		Organization respjson.Field
		Person       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents the organizer of a meeting.

func (Organizer) RawJSON

func (r Organizer) RawJSON() string

Returns the unmodified JSON received from the API

func (*Organizer) UnmarshalJSON

func (r *Organizer) UnmarshalJSON(data []byte) error

type PercentageField

type PercentageField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality PercentageFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind PercentageFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Win Probability").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `win_probability`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/number/percentage` for this field.
	Type constant.FieldNumberPercentage `json:"type" default:"field/number/percentage"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores percentage values as decimal numbers.

func (PercentageField) RawJSON

func (r PercentageField) RawJSON() string

Returns the unmodified JSON received from the API

func (*PercentageField) UnmarshalJSON

func (r *PercentageField) UnmarshalJSON(data []byte) error

type PercentageFieldCardinality

type PercentageFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	PercentageFieldCardinalityOne  PercentageFieldCardinality = "one"
	PercentageFieldCardinalityMany PercentageFieldCardinality = "many"
)

type PercentageFieldKind

type PercentageFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	PercentageFieldKindSystem  PercentageFieldKind = "system"
	PercentageFieldKindInverse PercentageFieldKind = "inverse"
	PercentageFieldKindCustom  PercentageFieldKind = "custom"
)

type PercentageValue

type PercentageValue struct {
	// A floating-point number representing a percentage value, for example 50.21 for
	// 50.21% or -1000 for -1000% etc.
	Data float64                        `json:"data" api:"required"`
	Type constant.ValueNumberPercentage `json:"type" default:"value/number/percentage"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Percentage numeric value

func (PercentageValue) RawJSON

func (r PercentageValue) RawJSON() string

Returns the unmodified JSON received from the API

func (PercentageValue) ToParam

ToParam converts this PercentageValue to a PercentageValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with PercentageValueParam.Overrides()

func (*PercentageValue) UnmarshalJSON

func (r *PercentageValue) UnmarshalJSON(data []byte) error

type PercentageValueParam

type PercentageValueParam struct {
	// A floating-point number representing a percentage value, for example 50.21 for
	// 50.21% or -1000 for -1000% etc.
	Data float64 `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/number/percentage".
	Type constant.ValueNumberPercentage `json:"type" default:"value/number/percentage"`
	// contains filtered or unexported fields
}

Percentage numeric value

The properties Data, Type are required.

func (PercentageValueParam) MarshalJSON

func (r PercentageValueParam) MarshalJSON() (data []byte, err error)

func (*PercentageValueParam) UnmarshalJSON

func (r *PercentageValueParam) UnmarshalJSON(data []byte) error

type Program

type Program struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The current status of the program. Can be `draft`, `published`, `paused`, or
	// `archived`.
	//
	// Any of "draft", "published", "paused", "archived".
	Status ProgramStatus `json:"status" api:"required"`
	// `true` if link clicks are tracked for this program.
	TrackClicks bool `json:"track_clicks" api:"required"`
	// `true` if email opens are tracked for this program.
	TrackOpens bool `json:"track_opens" api:"required"`
	// The sending trigger for the program. Can be `api` for transactional sends or
	// `broadcast` for scheduled sends.
	//
	// Any of "api", "broadcast".
	Trigger ProgramTrigger `json:"trigger" api:"required"`
	// String representing the object’s type. Always `program` for this object.
	Type constant.Program `json:"type" default:"program"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// A `ProgramActivityMetrics` object summarizing engagement for this program.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	ActivityMetrics ProgramActivityMetrics `json:"activity_metrics"`
	// The user-facing name of the program.
	DisplayName string `json:"display_name"`
	// The `ProgramTemplate` used for messages in this program.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	ProgramTemplate *ProgramTemplate `json:"program_template"`
	// For `broadcast` programs, the time the program is scheduled to send, as an ISO
	// 8601 timestamp in UTC.
	ScheduledAt time.Time `json:"scheduled_at" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		CreatedAt       respjson.Field
		Status          respjson.Field
		TrackClicks     respjson.Field
		TrackOpens      respjson.Field
		Trigger         respjson.Field
		Type            respjson.Field
		UpdatedAt       respjson.Field
		ActivityMetrics respjson.Field
		DisplayName     respjson.Field
		ProgramTemplate respjson.Field
		ScheduledAt     respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Program object represents an email campaign. It defines the sending behavior and tracks engagement metrics.

func (Program) RawJSON

func (r Program) RawJSON() string

Returns the unmodified JSON received from the API

func (*Program) UnmarshalJSON

func (r *Program) UnmarshalJSON(data []byte) error

type ProgramActivityMetrics

type ProgramActivityMetrics struct {
	// The number of emails that could not be delivered.
	Bounced int64 `json:"bounced" api:"required"`
	// The number of recipients who clicked at least one link.
	Clicked int64 `json:"clicked" api:"required"`
	// The number of recipients who marked the email as spam.
	Complained int64 `json:"complained" api:"required"`
	// The number of emails that failed to send due to a technical issue.
	Failed int64 `json:"failed" api:"required"`
	// The number of recipients who opened the email.
	Opened int64 `json:"opened" api:"required"`
	// The total number of emails successfully sent.
	Sent int64 `json:"sent" api:"required"`
	// The number of emails blocked by delivery protection rules.
	Shielded int64 `json:"shielded" api:"required"`
	// The number of recipients who unsubscribed.
	Unsubscribed int64 `json:"unsubscribed" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Bounced      respjson.Field
		Clicked      respjson.Field
		Complained   respjson.Field
		Failed       respjson.Field
		Opened       respjson.Field
		Sent         respjson.Field
		Shielded     respjson.Field
		Unsubscribed respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The ProgramActivityMetrics object provides a summary of engagement and delivery statistics for a marketing program.

func (ProgramActivityMetrics) RawJSON

func (r ProgramActivityMetrics) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProgramActivityMetrics) UnmarshalJSON

func (r *ProgramActivityMetrics) UnmarshalJSON(data []byte) error

type ProgramGetParams

type ProgramGetParams struct {
	// Specifies which related objects to include in the response. Valid options are
	// `activity_metrics` and `program_template`.
	//
	// Any of "activity_metrics", "program_template".
	Include []string `query:"include,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProgramGetParams) URLQuery

func (r ProgramGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes ProgramGetParams's query parameters as `url.Values`.

type ProgramListParams

type ProgramListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProgramListParams) URLQuery

func (r ProgramListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ProgramListParams's query parameters as `url.Values`.

type ProgramMessage

type ProgramMessage struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Time at which the message was created and enqueued for sending, as an ISO 8601
	// timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The `ProgramTemplate` used to generate this message.
	ProgramTemplate ProgramTemplate `json:"program_template" api:"required"`
	// String representing the object’s type. Always `program_message` for this object.
	Type constant.ProgramMessage `json:"type" default:"program_message"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID              respjson.Field
		CreatedAt       respjson.Field
		ProgramTemplate respjson.Field
		Type            respjson.Field
		UpdatedAt       respjson.Field
		ExtraFields     map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Represents a single message sent as part of a `Program`.

func (ProgramMessage) RawJSON

func (r ProgramMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProgramMessage) UnmarshalJSON

func (r *ProgramMessage) UnmarshalJSON(data []byte) error

type ProgramMessagePointer

type ProgramMessagePointer struct {
	ID   string                  `json:"id" api:"required"`
	Type constant.ProgramMessage `json:"type" default:"program_message"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProgramMessagePointer) RawJSON

func (r ProgramMessagePointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProgramMessagePointer) UnmarshalJSON

func (r *ProgramMessagePointer) UnmarshalJSON(data []byte) error

type ProgramMessageSendParams

type ProgramMessageSendParams struct {
	// The person to send the message to.
	Person ProgramMessageSendParamsPerson `json:"person,omitzero" api:"required"`
	// The ID of the `ProgramTemplate` to use for sending the message.
	ProgramTemplateID string `json:"program_template_id" api:"required"`
	// Any custom Liquid variables to be interpolated into the message template.
	CustomVariables map[string]any `json:"custom_variables,omitzero"`
	// contains filtered or unexported fields
}

func (ProgramMessageSendParams) MarshalJSON

func (r ProgramMessageSendParams) MarshalJSON() (data []byte, err error)

func (*ProgramMessageSendParams) UnmarshalJSON

func (r *ProgramMessageSendParams) UnmarshalJSON(data []byte) error

type ProgramMessageSendParamsPerson

type ProgramMessageSendParamsPerson struct {
	Email string `json:"email" api:"required" format:"email"`
	// contains filtered or unexported fields
}

The person to send the message to.

The property Email is required.

func (ProgramMessageSendParamsPerson) MarshalJSON

func (r ProgramMessageSendParamsPerson) MarshalJSON() (data []byte, err error)

func (*ProgramMessageSendParamsPerson) UnmarshalJSON

func (r *ProgramMessageSendParamsPerson) UnmarshalJSON(data []byte) error

type ProgramMessageService

type ProgramMessageService struct {
	Options []option.RequestOption
}

Manage your marketing campaigns and forms

ProgramMessageService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProgramMessageService method instead.

func NewProgramMessageService

func NewProgramMessageService(opts ...option.RequestOption) (r ProgramMessageService)

NewProgramMessageService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProgramMessageService) Send

Sends a message using a program template.

type ProgramPointer

type ProgramPointer struct {
	ID   string           `json:"id" api:"required"`
	Type constant.Program `json:"type" default:"program"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProgramPointer) RawJSON

func (r ProgramPointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProgramPointer) UnmarshalJSON

func (r *ProgramPointer) UnmarshalJSON(data []byte) error

type ProgramService

type ProgramService struct {
	Options []option.RequestOption
}

Manage your marketing campaigns and forms

ProgramService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProgramService method instead.

func NewProgramService

func NewProgramService(opts ...option.RequestOption) (r ProgramService)

NewProgramService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProgramService) Get

func (r *ProgramService) Get(ctx context.Context, id string, query ProgramGetParams, opts ...option.RequestOption) (res *Program, err error)

Retrieves the details of an existing program.

func (*ProgramService) List

Returns a list of your marketing programs.

func (*ProgramService) ListAutoPaging

Returns a list of your marketing programs.

type ProgramStatus

type ProgramStatus string

The current status of the program. Can be `draft`, `published`, `paused`, or `archived`.

const (
	ProgramStatusDraft     ProgramStatus = "draft"
	ProgramStatusPublished ProgramStatus = "published"
	ProgramStatusPaused    ProgramStatus = "paused"
	ProgramStatusArchived  ProgramStatus = "archived"
)

type ProgramTemplate

type ProgramTemplate struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The body content of the email, which can include Liquid variables.
	Body shared.FormattedText `json:"body" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The subject line of the email, which can include Liquid variables.
	Subject string `json:"subject" api:"required"`
	// String representing the object’s type. Always `program_template` for this
	// object.
	Type constant.ProgramTemplate `json:"type" default:"program_template"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The `Program` that uses this template.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Program *Program `json:"program"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Body        respjson.Field
		CreatedAt   respjson.Field
		Subject     respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		Program     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The ProgramTemplate object defines the content of a message sent by a `Program`, including support for Liquid templating.

func (ProgramTemplate) RawJSON

func (r ProgramTemplate) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProgramTemplate) UnmarshalJSON

func (r *ProgramTemplate) UnmarshalJSON(data []byte) error

type ProgramTemplateGetParams

type ProgramTemplateGetParams struct {
	// Specifies which related objects to include in the response. Valid option is
	// `program`.
	//
	// Any of "program".
	Include []string `query:"include,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProgramTemplateGetParams) URLQuery

func (r ProgramTemplateGetParams) URLQuery() (v url.Values, err error)

URLQuery serializes ProgramTemplateGetParams's query parameters as `url.Values`.

type ProgramTemplateListParams

type ProgramTemplateListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// Specifies which related objects to include in the response. Valid option is
	// `program`.
	//
	// Any of "program".
	Include []string `query:"include,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProgramTemplateListParams) URLQuery

func (r ProgramTemplateListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ProgramTemplateListParams's query parameters as `url.Values`.

type ProgramTemplatePointer

type ProgramTemplatePointer struct {
	ID   string                   `json:"id" api:"required"`
	Type constant.ProgramTemplate `json:"type" default:"program_template"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ProgramTemplatePointer) RawJSON

func (r ProgramTemplatePointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*ProgramTemplatePointer) UnmarshalJSON

func (r *ProgramTemplatePointer) UnmarshalJSON(data []byte) error

type ProgramTemplateService

type ProgramTemplateService struct {
	Options []option.RequestOption
}

Manage your marketing campaigns and forms

ProgramTemplateService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewProgramTemplateService method instead.

func NewProgramTemplateService

func NewProgramTemplateService(opts ...option.RequestOption) (r ProgramTemplateService)

NewProgramTemplateService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ProgramTemplateService) Get

Retrieves the details of an existing program template.

func (*ProgramTemplateService) List

Returns a list of your program templates.

func (*ProgramTemplateService) ListAutoPaging

Returns a list of your program templates.

type ProgramTrigger

type ProgramTrigger string

The sending trigger for the program. Can be `api` for transactional sends or `broadcast` for scheduled sends.

const (
	ProgramTriggerAPI       ProgramTrigger = "api"
	ProgramTriggerBroadcast ProgramTrigger = "broadcast"
)

type RelationField

type RelationField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The set of collections that are valid targets for this relation.
	AllowedCollections []CollectionPointer `json:"allowed_collections" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality RelationFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind RelationFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Account").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `account`).
	Ref string `json:"ref" api:"required"`
	// The type of relationship. Can be `one_way` for simple references or `two_way`
	// for bidirectional relationships.
	//
	// Any of "one_way", "two_way".
	RelationType RelationFieldRelationType `json:"relation_type" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/relation` for this field.
	Type constant.FieldRelation `json:"type" default:"field/relation"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// The name given to auto-created reverse fields on target collections. Only
	// present on `two_way` source fields.
	ReverseFieldName string `json:"reverse_field_name"`
	// A list of reverse fields created on each target collection. Only present on
	// `two_way` source fields.
	ReverseFields []FieldPointer `json:"reverse_fields"`
	// A reference to the source field that manages this reverse field. Only present on
	// reverse (contingent) fields.
	SourceField FieldPointer `json:"source_field"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		AllowedCollections respjson.Field
		Cardinality        respjson.Field
		CreatedAt          respjson.Field
		DefaultValues      respjson.Field
		Kind               respjson.Field
		Name               respjson.Field
		Readonly           respjson.Field
		Ref                respjson.Field
		RelationType       respjson.Field
		Required           respjson.Field
		Type               respjson.Field
		Unique             respjson.Field
		UpdatedAt          respjson.Field
		Description        respjson.Field
		ReverseFieldName   respjson.Field
		ReverseFields      respjson.Field
		SourceField        respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that creates a link between items in different collections, enabling cross-collection relationships.

func (RelationField) RawJSON

func (r RelationField) RawJSON() string

Returns the unmodified JSON received from the API

func (*RelationField) UnmarshalJSON

func (r *RelationField) UnmarshalJSON(data []byte) error

type RelationFieldCardinality

type RelationFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	RelationFieldCardinalityOne  RelationFieldCardinality = "one"
	RelationFieldCardinalityMany RelationFieldCardinality = "many"
)

type RelationFieldDefaultValueParamUnion

type RelationFieldDefaultValueParamUnion struct {
	OfValueRelation *RelationValueParam `json:",omitzero,inline"`
	OfCurrentMember *CurrentMemberParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func RelationFieldDefaultValueParamOfValueRelation

func RelationFieldDefaultValueParamOfValueRelation(data ItemPointerParam) RelationFieldDefaultValueParamUnion

func (RelationFieldDefaultValueParamUnion) GetData

Returns a pointer to the underlying variant's property, if present.

func (RelationFieldDefaultValueParamUnion) GetType

Returns a pointer to the underlying variant's property, if present.

func (RelationFieldDefaultValueParamUnion) MarshalJSON

func (u RelationFieldDefaultValueParamUnion) MarshalJSON() ([]byte, error)

func (*RelationFieldDefaultValueParamUnion) UnmarshalJSON

func (u *RelationFieldDefaultValueParamUnion) UnmarshalJSON(data []byte) error

type RelationFieldKind

type RelationFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	RelationFieldKindSystem  RelationFieldKind = "system"
	RelationFieldKindInverse RelationFieldKind = "inverse"
	RelationFieldKindCustom  RelationFieldKind = "custom"
)

type RelationFieldRelationType

type RelationFieldRelationType string

The type of relationship. Can be `one_way` for simple references or `two_way` for bidirectional relationships.

const (
	RelationFieldRelationTypeOneWay RelationFieldRelationType = "one_way"
	RelationFieldRelationTypeTwoWay RelationFieldRelationType = "two_way"
)

type RelationValue

type RelationValue struct {
	// A reference to another Moonbase item.
	Data ItemPointer            `json:"data" api:"required"`
	Type constant.ValueRelation `json:"type" default:"value/relation"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Related item reference

func (RelationValue) RawJSON

func (r RelationValue) RawJSON() string

Returns the unmodified JSON received from the API

func (*RelationValue) UnmarshalJSON

func (r *RelationValue) UnmarshalJSON(data []byte) error

type RelationValueParam

type RelationValueParam struct {
	// A reference to another Moonbase item.
	Data ItemPointerParam `json:"data,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as "value/relation".
	Type constant.ValueRelation `json:"type" default:"value/relation"`
	// contains filtered or unexported fields
}

Related item reference

The properties Data, Type are required.

func (RelationValueParam) MarshalJSON

func (r RelationValueParam) MarshalJSON() (data []byte, err error)

func (*RelationValueParam) UnmarshalJSON

func (r *RelationValueParam) UnmarshalJSON(data []byte) error

type SearchParams

type SearchParams struct {
	// The search text to match against items and files.
	Query string `query:"query" api:"required" json:"-"`
	// contains filtered or unexported fields
}

func (SearchParams) URLQuery

func (r SearchParams) URLQuery() (v url.Values, err error)

URLQuery serializes SearchParams's query parameters as `url.Values`.

type SearchResponse

type SearchResponse struct {
	Data []SearchResponseData `json:"data" api:"required"`
	Type constant.List        `json:"type" default:"list"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A list of search results.

func (SearchResponse) RawJSON

func (r SearchResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*SearchResponse) UnmarshalJSON

func (r *SearchResponse) UnmarshalJSON(data []byte) error

type SearchResponseData

type SearchResponseData struct {
	// An Item represents a single record or row within a Collection. It holds a set of
	// `values` corresponding to the Collection's `fields`.
	Data SearchResponseDataDataUnion `json:"data" api:"required"`
	Type constant.SearchResult       `json:"type" default:"search_result"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A search result entry.

func (SearchResponseData) RawJSON

func (r SearchResponseData) RawJSON() string

Returns the unmodified JSON received from the API

func (*SearchResponseData) UnmarshalJSON

func (r *SearchResponseData) UnmarshalJSON(data []byte) error

type SearchResponseDataDataUnion

type SearchResponseDataDataUnion struct {
	ID string `json:"id"`
	// This field is from variant [Item].
	Collection CollectionPointer `json:"collection"`
	// Any of "item", "file".
	Type string `json:"type"`
	// This field is from variant [Item].
	Values map[string]FieldValueUnion `json:"values"`
	// This field is from variant [MoonbaseFile].
	Associations []ItemPointer `json:"associations"`
	// This field is from variant [MoonbaseFile].
	CreatedAt time.Time `json:"created_at"`
	// This field is from variant [MoonbaseFile].
	DownloadURL string `json:"download_url"`
	// This field is from variant [MoonbaseFile].
	Filename string `json:"filename"`
	// This field is from variant [MoonbaseFile].
	Name string `json:"name"`
	// This field is from variant [MoonbaseFile].
	Size float64 `json:"size"`
	// This field is from variant [MoonbaseFile].
	UpdatedAt time.Time `json:"updated_at"`
	JSON      struct {
		ID           respjson.Field
		Collection   respjson.Field
		Type         respjson.Field
		Values       respjson.Field
		Associations respjson.Field
		CreatedAt    respjson.Field
		DownloadURL  respjson.Field
		Filename     respjson.Field
		Name         respjson.Field
		Size         respjson.Field
		UpdatedAt    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

SearchResponseDataDataUnion contains all possible properties and values from Item, MoonbaseFile.

Use the SearchResponseDataDataUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (SearchResponseDataDataUnion) AsAny

func (u SearchResponseDataDataUnion) AsAny() anySearchResponseDataData

Use the following switch statement to find the correct variant

switch variant := SearchResponseDataDataUnion.AsAny().(type) {
case moonbase.Item:
case moonbase.MoonbaseFile:
default:
  fmt.Errorf("no variant present")
}

func (SearchResponseDataDataUnion) AsFile

func (SearchResponseDataDataUnion) AsItem

func (u SearchResponseDataDataUnion) AsItem() (v Item)

func (SearchResponseDataDataUnion) RawJSON

func (u SearchResponseDataDataUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*SearchResponseDataDataUnion) UnmarshalJSON

func (r *SearchResponseDataDataUnion) UnmarshalJSON(data []byte) error

type SingleLineTextField

type SingleLineTextField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality SingleLineTextFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind SingleLineTextFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Company Name").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `company_name`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/text/single_line` for this field.
	Type constant.FieldTextSingleLine `json:"type" default:"field/text/single_line"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores a single line of text without line breaks.

func (SingleLineTextField) RawJSON

func (r SingleLineTextField) RawJSON() string

Returns the unmodified JSON received from the API

func (*SingleLineTextField) UnmarshalJSON

func (r *SingleLineTextField) UnmarshalJSON(data []byte) error

type SingleLineTextFieldCardinality

type SingleLineTextFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	SingleLineTextFieldCardinalityOne  SingleLineTextFieldCardinality = "one"
	SingleLineTextFieldCardinalityMany SingleLineTextFieldCardinality = "many"
)

type SingleLineTextFieldKind

type SingleLineTextFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	SingleLineTextFieldKindSystem  SingleLineTextFieldKind = "system"
	SingleLineTextFieldKindInverse SingleLineTextFieldKind = "inverse"
	SingleLineTextFieldKindCustom  SingleLineTextFieldKind = "custom"
)

type SingleLineTextValue

type SingleLineTextValue struct {
	// A single line of text, up to 1024 characters long. It should not contain line
	// breaks.
	Data string                       `json:"data" api:"required"`
	Type constant.ValueTextSingleLine `json:"type" default:"value/text/single_line"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A single line of text

func (SingleLineTextValue) RawJSON

func (r SingleLineTextValue) RawJSON() string

Returns the unmodified JSON received from the API

func (SingleLineTextValue) ToParam

ToParam converts this SingleLineTextValue to a SingleLineTextValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with SingleLineTextValueParam.Overrides()

func (*SingleLineTextValue) UnmarshalJSON

func (r *SingleLineTextValue) UnmarshalJSON(data []byte) error

type SingleLineTextValueParam

type SingleLineTextValueParam struct {
	// A single line of text, up to 1024 characters long. It should not contain line
	// breaks.
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/text/single_line".
	Type constant.ValueTextSingleLine `json:"type" default:"value/text/single_line"`
	// contains filtered or unexported fields
}

A single line of text

The properties Data, Type are required.

func (SingleLineTextValueParam) MarshalJSON

func (r SingleLineTextValueParam) MarshalJSON() (data []byte, err error)

func (*SingleLineTextValueParam) UnmarshalJSON

func (r *SingleLineTextValueParam) UnmarshalJSON(data []byte) error

type SlackMessage

type SlackMessage struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Structured content that can be rendered in multiple formats, currently
	// supporting Markdown.
	Body shared.FormattedText `json:"body" api:"required"`
	// `true` if the message appears to be part of a bulk mailing.
	Bulk bool `json:"bulk" api:"required"`
	// The time the message was received, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// `true` if the message is a draft that has not been sent.
	Draft bool `json:"draft" api:"required"`
	// The current lock version of the message for optimistic concurrency control.
	LockVersion int64 `json:"lock_version" api:"required"`
	// `true` if the message is classified as spam.
	Spam bool `json:"spam" api:"required"`
	// The subject line of the message (for messages received from Slack, this is a
	// snippet of the message; for messages sent to Slack, it can be set, but is not
	// sent to Slack).
	Subject string `json:"subject" api:"required"`
	// `true` if the message is in the trash.
	Trash bool `json:"trash" api:"required"`
	// String representing the object’s type. Always `slack_message` for this object.
	Type constant.SlackMessage `json:"type" default:"slack_message"`
	// `true` if the message has not been read.
	Unread bool `json:"unread" api:"required"`
	// A list of `SlackMessageAddress` objects associated with the message (sender and
	// recipients).
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Addresses []SlackMessageAddressUnion `json:"addresses"`
	// A list of `Attachment` objects on the message.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Attachments []MessageAttachment `json:"attachments"`
	// The `Conversation` thread this message is part of.
	//
	// **Note:** Only present when requested using the `include` query parameter.
	Conversation *InboxConversation `json:"conversation"`
	// A concise, system-generated summary of the message content.
	Summary string `json:"summary"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Body         respjson.Field
		Bulk         respjson.Field
		CreatedAt    respjson.Field
		Draft        respjson.Field
		LockVersion  respjson.Field
		Spam         respjson.Field
		Subject      respjson.Field
		Trash        respjson.Field
		Type         respjson.Field
		Unread       respjson.Field
		Addresses    respjson.Field
		Attachments  respjson.Field
		Conversation respjson.Field
		Summary      respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The Slack Message object represents a single Slack post within a `Conversation`.

func (SlackMessage) RawJSON

func (r SlackMessage) RawJSON() string

Returns the unmodified JSON received from the API

func (*SlackMessage) UnmarshalJSON

func (r *SlackMessage) UnmarshalJSON(data []byte) error

type SlackMessageAddressParams

type SlackMessageAddressParams struct {
	// The Slack channel ID.
	ProviderID string `json:"provider_id" api:"required"`
	// The channel name name.
	Name param.Opt[string] `json:"name,omitzero"`
	// This field can be elided, and will marshal its zero value as "slack_channel".
	Type constant.SlackChannel `json:"type" default:"slack_channel"`
	// contains filtered or unexported fields
}

The properties ProviderID, Type are required.

func (SlackMessageAddressParams) MarshalJSON

func (r SlackMessageAddressParams) MarshalJSON() (data []byte, err error)

func (*SlackMessageAddressParams) UnmarshalJSON

func (r *SlackMessageAddressParams) UnmarshalJSON(data []byte) error

type SlackMessageAddressSlackMessageChannelAddress

type SlackMessageAddressSlackMessageChannelAddress struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The Slack Channel ID.
	ProviderID string `json:"provider_id" api:"required"`
	// The role of the address in the message. Can be `from`, `reply_to`, `to`, `cc`,
	// or `bcc`.
	//
	// Any of "from", "to", "cc", "bcc".
	Role string `json:"role" api:"required"`
	// String representing the object’s type. Always `slack_message_channel_address`
	// for this object.
	Type constant.SlackMessageChannelAddress `json:"type" default:"slack_message_channel_address"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Organization ItemPointer `json:"organization"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Person ItemPointer `json:"person"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		ProviderID   respjson.Field
		Role         respjson.Field
		Type         respjson.Field
		Organization respjson.Field
		Person       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The SlackMessageChannelAddress object represents a Slack channels address on a message. It contains a Slack Channel ID and can be linked to a person and an organization in your collections.

func (SlackMessageAddressSlackMessageChannelAddress) RawJSON

Returns the unmodified JSON received from the API

func (*SlackMessageAddressSlackMessageChannelAddress) UnmarshalJSON

func (r *SlackMessageAddressSlackMessageChannelAddress) UnmarshalJSON(data []byte) error

type SlackMessageAddressSlackMessageUserAddress

type SlackMessageAddressSlackMessageUserAddress struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The Slack User ID
	ProviderID string `json:"provider_id" api:"required"`
	// The role of the address in the message. Can be `from`, `reply_to`, `to`, `cc`,
	// or `bcc`.
	//
	// Any of "from", "to", "cc", "bcc".
	Role string `json:"role" api:"required"`
	// String representing the object’s type. Always `slack_message_user_address` for
	// this object.
	Type constant.SlackMessageUserAddress `json:"type" default:"slack_message_user_address"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Organization ItemPointer `json:"organization"`
	// A reference to an `Item` within a specific `Collection`, providing the context
	// needed to locate the item.
	Person ItemPointer `json:"person"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		ProviderID   respjson.Field
		Role         respjson.Field
		Type         respjson.Field
		Organization respjson.Field
		Person       respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The SlackMessageUserAddress object represents a Slack user address on a message. It contains a Slack User ID and can be linked to a person and an organization in your collections.

func (SlackMessageAddressSlackMessageUserAddress) RawJSON

Returns the unmodified JSON received from the API

func (*SlackMessageAddressSlackMessageUserAddress) UnmarshalJSON

func (r *SlackMessageAddressSlackMessageUserAddress) UnmarshalJSON(data []byte) error

type SlackMessageAddressUnion

type SlackMessageAddressUnion struct {
	ID         string `json:"id"`
	ProviderID string `json:"provider_id"`
	Role       string `json:"role"`
	// Any of "slack_message_channel_address", "slack_message_user_address".
	Type string `json:"type"`
	// This field is from variant [SlackMessageAddressSlackMessageChannelAddress].
	Organization ItemPointer `json:"organization"`
	// This field is from variant [SlackMessageAddressSlackMessageChannelAddress].
	Person ItemPointer `json:"person"`
	JSON   struct {
		ID           respjson.Field
		ProviderID   respjson.Field
		Role         respjson.Field
		Type         respjson.Field
		Organization respjson.Field
		Person       respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

SlackMessageAddressUnion contains all possible properties and values from SlackMessageAddressSlackMessageChannelAddress, SlackMessageAddressSlackMessageUserAddress.

Use the SlackMessageAddressUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (SlackMessageAddressUnion) AsAny

func (u SlackMessageAddressUnion) AsAny() anySlackMessageAddress

Use the following switch statement to find the correct variant

switch variant := SlackMessageAddressUnion.AsAny().(type) {
case moonbase.SlackMessageAddressSlackMessageChannelAddress:
case moonbase.SlackMessageAddressSlackMessageUserAddress:
default:
  fmt.Errorf("no variant present")
}

func (SlackMessageAddressUnion) AsSlackMessageChannelAddress

func (u SlackMessageAddressUnion) AsSlackMessageChannelAddress() (v SlackMessageAddressSlackMessageChannelAddress)

func (SlackMessageAddressUnion) AsSlackMessageUserAddress

func (u SlackMessageAddressUnion) AsSlackMessageUserAddress() (v SlackMessageAddressSlackMessageUserAddress)

func (SlackMessageAddressUnion) RawJSON

func (u SlackMessageAddressUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*SlackMessageAddressUnion) UnmarshalJSON

func (r *SlackMessageAddressUnion) UnmarshalJSON(data []byte) error

type SocialLinkedInField

type SocialLinkedInField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality SocialLinkedInFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind SocialLinkedInFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "LinkedIn Profile").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `linkedin_profile`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/uri/social_linked_in` for this field.
	Type constant.FieldUriSocialLinkedIn `json:"type" default:"field/uri/social_linked_in"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores LinkedIn profile information.

func (SocialLinkedInField) RawJSON

func (r SocialLinkedInField) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialLinkedInField) UnmarshalJSON

func (r *SocialLinkedInField) UnmarshalJSON(data []byte) error

type SocialLinkedInFieldCardinality

type SocialLinkedInFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	SocialLinkedInFieldCardinalityOne  SocialLinkedInFieldCardinality = "one"
	SocialLinkedInFieldCardinalityMany SocialLinkedInFieldCardinality = "many"
)

type SocialLinkedInFieldKind

type SocialLinkedInFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	SocialLinkedInFieldKindSystem  SocialLinkedInFieldKind = "system"
	SocialLinkedInFieldKindInverse SocialLinkedInFieldKind = "inverse"
	SocialLinkedInFieldKindCustom  SocialLinkedInFieldKind = "custom"
)

type SocialLinkedInValue

type SocialLinkedInValue struct {
	// The social media profile for the LinkedIn platform
	Data SocialLinkedInValueData         `json:"data" api:"required"`
	Type constant.ValueUriSocialLinkedIn `json:"type" default:"value/uri/social_linked_in"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The social media profile for the LinkedIn platform

func (SocialLinkedInValue) RawJSON

func (r SocialLinkedInValue) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialLinkedInValue) UnmarshalJSON

func (r *SocialLinkedInValue) UnmarshalJSON(data []byte) error

type SocialLinkedInValueData

type SocialLinkedInValueData struct {
	// The full URL to the LinkedIn profile.
	URL string `json:"url" api:"required" format:"uri"`
	// The LinkedIn username, including the prefix 'company/' for company pages or
	// 'in/' for personal profiles.
	Username string `json:"username" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Username    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The social media profile for the LinkedIn platform

func (SocialLinkedInValueData) RawJSON

func (r SocialLinkedInValueData) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialLinkedInValueData) UnmarshalJSON

func (r *SocialLinkedInValueData) UnmarshalJSON(data []byte) error

type SocialLinkedInValueParam

type SocialLinkedInValueParam struct {
	// The social media profile for the LinkedIn platform
	Data SocialProfileLinkedInParam `json:"data,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/uri/social_linked_in".
	Type constant.ValueUriSocialLinkedIn `json:"type" default:"value/uri/social_linked_in"`
	// contains filtered or unexported fields
}

The social media profile for the LinkedIn platform

The properties Data, Type are required.

func (SocialLinkedInValueParam) MarshalJSON

func (r SocialLinkedInValueParam) MarshalJSON() (data []byte, err error)

func (*SocialLinkedInValueParam) UnmarshalJSON

func (r *SocialLinkedInValueParam) UnmarshalJSON(data []byte) error

type SocialProfileLinkedInParam

type SocialProfileLinkedInParam struct {
	// The full URL to the LinkedIn profile.
	URL param.Opt[string] `json:"url,omitzero" format:"uri"`
	// The LinkedIn username, including the prefix 'company/' for company pages or
	// 'in/' for personal profiles.
	Username param.Opt[string] `json:"username,omitzero"`
	// contains filtered or unexported fields
}

Social media profile information including both the full URL and extracted username.

func (SocialProfileLinkedInParam) MarshalJSON

func (r SocialProfileLinkedInParam) MarshalJSON() (data []byte, err error)

func (*SocialProfileLinkedInParam) UnmarshalJSON

func (r *SocialProfileLinkedInParam) UnmarshalJSON(data []byte) error

type SocialProfileXParam

type SocialProfileXParam struct {
	// The full URL to the X profile, starting with 'https://x.com/'
	URL param.Opt[string] `json:"url,omitzero" format:"uri"`
	// The X username, up to 15 characters long, containing only lowercase letters
	// (a-z), uppercase letters (A-Z), numbers (0-9), and underscores (\_). Does not
	// include the '@' symbol prefix.
	Username param.Opt[string] `json:"username,omitzero"`
	// contains filtered or unexported fields
}

Social media profile information including both the full URL and extracted username.

func (SocialProfileXParam) MarshalJSON

func (r SocialProfileXParam) MarshalJSON() (data []byte, err error)

func (*SocialProfileXParam) UnmarshalJSON

func (r *SocialProfileXParam) UnmarshalJSON(data []byte) error

type SocialXField

type SocialXField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality SocialXFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind SocialXFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "X Profile").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `x_profile`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/uri/social_x` for this field.
	Type constant.FieldUriSocialX `json:"type" default:"field/uri/social_x"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores X (formerly Twitter) profile information.

func (SocialXField) RawJSON

func (r SocialXField) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialXField) UnmarshalJSON

func (r *SocialXField) UnmarshalJSON(data []byte) error

type SocialXFieldCardinality

type SocialXFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	SocialXFieldCardinalityOne  SocialXFieldCardinality = "one"
	SocialXFieldCardinalityMany SocialXFieldCardinality = "many"
)

type SocialXFieldKind

type SocialXFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	SocialXFieldKindSystem  SocialXFieldKind = "system"
	SocialXFieldKindInverse SocialXFieldKind = "inverse"
	SocialXFieldKindCustom  SocialXFieldKind = "custom"
)

type SocialXValue

type SocialXValue struct {
	// Social media profile information including both the full URL and extracted
	// username.
	Data SocialXValueData         `json:"data" api:"required"`
	Type constant.ValueUriSocialX `json:"type" default:"value/uri/social_x"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The social media profile for the X (formerly Twitter) platform

func (SocialXValue) RawJSON

func (r SocialXValue) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialXValue) UnmarshalJSON

func (r *SocialXValue) UnmarshalJSON(data []byte) error

type SocialXValueData

type SocialXValueData struct {
	// The full URL to the X profile, starting with 'https://x.com/'
	URL string `json:"url" api:"required" format:"uri"`
	// The X username, up to 15 characters long, containing only lowercase letters
	// (a-z), uppercase letters (A-Z), numbers (0-9), and underscores (\_). Does not
	// include the '@' symbol prefix.
	Username string `json:"username" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		URL         respjson.Field
		Username    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Social media profile information including both the full URL and extracted username.

func (SocialXValueData) RawJSON

func (r SocialXValueData) RawJSON() string

Returns the unmodified JSON received from the API

func (*SocialXValueData) UnmarshalJSON

func (r *SocialXValueData) UnmarshalJSON(data []byte) error

type SocialXValueParam

type SocialXValueParam struct {
	// Social media profile information including both the full URL and extracted
	// username.
	Data SocialProfileXParam `json:"data,omitzero" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/uri/social_x".
	Type constant.ValueUriSocialX `json:"type" default:"value/uri/social_x"`
	// contains filtered or unexported fields
}

The social media profile for the X (formerly Twitter) platform

The properties Data, Type are required.

func (SocialXValueParam) MarshalJSON

func (r SocialXValueParam) MarshalJSON() (data []byte, err error)

func (*SocialXValueParam) UnmarshalJSON

func (r *SocialXValueParam) UnmarshalJSON(data []byte) error

type StageField

type StageField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality StageFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// The `Funnel` object that defines the available stages for this field.
	Funnel Funnel `json:"funnel" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind StageFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Sales Stage").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `sales_stage`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/stage` for this field.
	Type constant.FieldStage `json:"type" default:"field/stage"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Funnel        respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that tracks an item's position in a funnel or pipeline workflow.

func (StageField) RawJSON

func (r StageField) RawJSON() string

Returns the unmodified JSON received from the API

func (*StageField) UnmarshalJSON

func (r *StageField) UnmarshalJSON(data []byte) error

type StageFieldCardinality

type StageFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	StageFieldCardinalityOne  StageFieldCardinality = "one"
	StageFieldCardinalityMany StageFieldCardinality = "many"
)

type StageFieldCreateParams

type StageFieldCreateParams struct {
	// The funnel that defines the available stages for this field.
	Funnel FunnelPointerParam `json:"funnel,omitzero" api:"required"`
	// The human-readable name for the field.
	Name string `json:"name" api:"required"`
	// An optional description of the field's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// If `true`, items must have a value for this field. Defaults to `false`.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items. Defaults to `false`.
	Unique param.Opt[bool] `json:"unique,omitzero"`
	// Whether the field holds a single value (`one`) or multiple values (`many`).
	// Defaults to `one`.
	//
	// Any of "one", "many".
	Cardinality   StageFieldCreateParamsCardinality `json:"cardinality,omitzero"`
	DefaultValues []FunnelStepValueParam            `json:"default_values,omitzero"`
	// The field type. Must be `field/stage`.
	//
	// This field can be elided, and will marshal its zero value as "field/stage".
	Type constant.FieldStage `json:"type" default:"field/stage"`
	// contains filtered or unexported fields
}

Parameters for creating a stage field.

The properties Funnel, Name, Type are required.

func (StageFieldCreateParams) MarshalJSON

func (r StageFieldCreateParams) MarshalJSON() (data []byte, err error)

func (*StageFieldCreateParams) UnmarshalJSON

func (r *StageFieldCreateParams) UnmarshalJSON(data []byte) error

type StageFieldCreateParamsCardinality

type StageFieldCreateParamsCardinality string

Whether the field holds a single value (`one`) or multiple values (`many`). Defaults to `one`.

const (
	StageFieldCreateParamsCardinalityOne  StageFieldCreateParamsCardinality = "one"
	StageFieldCreateParamsCardinalityMany StageFieldCreateParamsCardinality = "many"
)

type StageFieldKind

type StageFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	StageFieldKindSystem  StageFieldKind = "system"
	StageFieldKindInverse StageFieldKind = "inverse"
	StageFieldKindCustom  StageFieldKind = "custom"
)

type StageFieldUpdateParams

type StageFieldUpdateParams struct {
	// An updated description, or `null` to clear it.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name for the field.
	Name param.Opt[string] `json:"name,omitzero"`
	// If `true`, items must have a value for this field.
	Required param.Opt[bool] `json:"required,omitzero"`
	// If `true`, values must be unique across all items.
	Unique        param.Opt[bool]        `json:"unique,omitzero"`
	DefaultValues []FunnelStepValueParam `json:"default_values,omitzero"`
	// Updated cardinality: `one` or `many`.
	//
	// Any of "one", "many".
	Cardinality StageFieldUpdateParamsCardinality `json:"cardinality,omitzero"`
	// A new funnel to use for this field, or omit to keep the current funnel.
	Funnel FunnelPointerParam `json:"funnel,omitzero"`
	// The field type. Must be `field/stage`.
	//
	// This field can be elided, and will marshal its zero value as "field/stage".
	Type constant.FieldStage `json:"type" default:"field/stage"`
	// contains filtered or unexported fields
}

Parameters for updating a stage field.

The property Type is required.

func (StageFieldUpdateParams) MarshalJSON

func (r StageFieldUpdateParams) MarshalJSON() (data []byte, err error)

func (*StageFieldUpdateParams) UnmarshalJSON

func (r *StageFieldUpdateParams) UnmarshalJSON(data []byte) error

type StageFieldUpdateParamsCardinality

type StageFieldUpdateParamsCardinality string

Updated cardinality: `one` or `many`.

const (
	StageFieldUpdateParamsCardinalityOne  StageFieldUpdateParamsCardinality = "one"
	StageFieldUpdateParamsCardinalityMany StageFieldUpdateParamsCardinality = "many"
)

type Subscription

type Subscription struct {
	// The type of event that will trigger notifications to the endpoint (e.g.,
	// `activity/item_created`).
	//
	// Any of "activity/call_occurred", "activity/form_submitted",
	// "activity/inbox_message_sent", "activity/item_created",
	// "activity/item_mentioned", "activity/item_merged", "activity/file_created",
	// "activity/meeting_held", "activity/meeting_scheduled", "activity/note_created",
	// "activity/program_message_bounced", "activity/program_message_clicked",
	// "activity/program_message_complained", "activity/program_message_failed",
	// "activity/program_message_opened", "activity/program_message_sent",
	// "activity/program_message_shielded", "activity/program_message_unsubscribed".
	EventType SubscriptionEventType `json:"event_type" api:"required"`
	// String representing the object’s type. Always `webhook_subscription` for this
	// object.
	Type constant.WebhookSubscription `json:"type" default:"webhook_subscription"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EventType   respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Webhook Subscription defines which event type should be sent to a specific webhook endpoint.

func (Subscription) RawJSON

func (r Subscription) RawJSON() string

Returns the unmodified JSON received from the API

func (*Subscription) UnmarshalJSON

func (r *Subscription) UnmarshalJSON(data []byte) error

type SubscriptionEventType

type SubscriptionEventType string

The type of event that will trigger notifications to the endpoint (e.g., `activity/item_created`).

const (
	SubscriptionEventTypeActivityCallOccurred               SubscriptionEventType = "activity/call_occurred"
	SubscriptionEventTypeActivityFormSubmitted              SubscriptionEventType = "activity/form_submitted"
	SubscriptionEventTypeActivityInboxMessageSent           SubscriptionEventType = "activity/inbox_message_sent"
	SubscriptionEventTypeActivityItemCreated                SubscriptionEventType = "activity/item_created"
	SubscriptionEventTypeActivityItemMentioned              SubscriptionEventType = "activity/item_mentioned"
	SubscriptionEventTypeActivityItemMerged                 SubscriptionEventType = "activity/item_merged"
	SubscriptionEventTypeActivityFileCreated                SubscriptionEventType = "activity/file_created"
	SubscriptionEventTypeActivityMeetingHeld                SubscriptionEventType = "activity/meeting_held"
	SubscriptionEventTypeActivityMeetingScheduled           SubscriptionEventType = "activity/meeting_scheduled"
	SubscriptionEventTypeActivityNoteCreated                SubscriptionEventType = "activity/note_created"
	SubscriptionEventTypeActivityProgramMessageBounced      SubscriptionEventType = "activity/program_message_bounced"
	SubscriptionEventTypeActivityProgramMessageClicked      SubscriptionEventType = "activity/program_message_clicked"
	SubscriptionEventTypeActivityProgramMessageComplained   SubscriptionEventType = "activity/program_message_complained"
	SubscriptionEventTypeActivityProgramMessageFailed       SubscriptionEventType = "activity/program_message_failed"
	SubscriptionEventTypeActivityProgramMessageOpened       SubscriptionEventType = "activity/program_message_opened"
	SubscriptionEventTypeActivityProgramMessageSent         SubscriptionEventType = "activity/program_message_sent"
	SubscriptionEventTypeActivityProgramMessageShielded     SubscriptionEventType = "activity/program_message_shielded"
	SubscriptionEventTypeActivityProgramMessageUnsubscribed SubscriptionEventType = "activity/program_message_unsubscribed"
)

type Tag

type Tag = shared.Tag

A Tag is a label that can be applied to supported resources (such as conversations, calls, and meetings) for organization and filtering.

This is an alias to an internal type.

type TagColor

type TagColor = shared.TagColor

The color for the tag.

This is an alias to an internal type.

type TagPointerParam

type TagPointerParam = shared.TagPointerParam

A lightweight reference to a `Tag` used in request bodies.

This is an alias to an internal type.

type Tagset

type Tagset struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Where a tagset is available (`calls`, `meetings`, or `inbox` with an inbox ID).
	Associations []TagsetAssociationUnion `json:"associations" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The name of the tagset.
	Name string `json:"name" api:"required"`
	// A list of `Tag` objects belonging to this tagset.
	Tags []shared.Tag `json:"tags" api:"required"`
	// String representing the object’s type. Always `tagset` for this object.
	Type constant.Tagset `json:"type" default:"tagset"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional description of the tagset's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID           respjson.Field
		Associations respjson.Field
		CreatedAt    respjson.Field
		Name         respjson.Field
		Tags         respjson.Field
		Type         respjson.Field
		UpdatedAt    respjson.Field
		Description  respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A Tagset is a collection of `Tag` objects whose tags can be applied to conversations, calls, and meetings.

func (Tagset) RawJSON

func (r Tagset) RawJSON() string

Returns the unmodified JSON received from the API

func (*Tagset) UnmarshalJSON

func (r *Tagset) UnmarshalJSON(data []byte) error

type TagsetAssociationCalls

type TagsetAssociationCalls struct {
	// String representing the association type. Always `calls` for call tagset
	// associations.
	Type constant.Calls `json:"type" default:"calls"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Makes this tagset available for calls.

func (TagsetAssociationCalls) RawJSON

func (r TagsetAssociationCalls) RawJSON() string

Returns the unmodified JSON received from the API

func (*TagsetAssociationCalls) UnmarshalJSON

func (r *TagsetAssociationCalls) UnmarshalJSON(data []byte) error

type TagsetAssociationCallsParam

type TagsetAssociationCallsParam struct {
	// String representing the association type. Always `calls` for call tagset
	// associations.
	Type constant.Calls `json:"type" default:"calls"`
	// contains filtered or unexported fields
}

Makes this tagset available for calls.

This struct has a constant value, construct it with NewTagsetAssociationCallsParam.

func NewTagsetAssociationCallsParam

func NewTagsetAssociationCallsParam() TagsetAssociationCallsParam

func (TagsetAssociationCallsParam) MarshalJSON

func (r TagsetAssociationCallsParam) MarshalJSON() (data []byte, err error)

func (*TagsetAssociationCallsParam) UnmarshalJSON

func (r *TagsetAssociationCallsParam) UnmarshalJSON(data []byte) error

type TagsetAssociationInbox

type TagsetAssociationInbox struct {
	// Unique identifier of the inbox this tagset is assigned to.
	ID string `json:"id" api:"required"`
	// String representing the association type. Always `inbox` for inbox tagset
	// associations.
	Type constant.Inbox `json:"type" default:"inbox"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Makes this tagset available in an inbox.

func (TagsetAssociationInbox) RawJSON

func (r TagsetAssociationInbox) RawJSON() string

Returns the unmodified JSON received from the API

func (*TagsetAssociationInbox) UnmarshalJSON

func (r *TagsetAssociationInbox) UnmarshalJSON(data []byte) error

type TagsetAssociationInboxParam

type TagsetAssociationInboxParam struct {
	// Unique identifier of the inbox this tagset is assigned to.
	ID string `json:"id" api:"required"`
	// String representing the association type. Always `inbox` for inbox tagset
	// associations.
	//
	// This field can be elided, and will marshal its zero value as "inbox".
	Type constant.Inbox `json:"type" default:"inbox"`
	// contains filtered or unexported fields
}

Makes this tagset available in an inbox.

The properties ID, Type are required.

func (TagsetAssociationInboxParam) MarshalJSON

func (r TagsetAssociationInboxParam) MarshalJSON() (data []byte, err error)

func (*TagsetAssociationInboxParam) UnmarshalJSON

func (r *TagsetAssociationInboxParam) UnmarshalJSON(data []byte) error

type TagsetAssociationMeetings

type TagsetAssociationMeetings struct {
	// String representing the association type. Always `meetings` for meeting tagset
	// associations.
	Type constant.Meetings `json:"type" default:"meetings"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Makes this tagset available for meetings.

func (TagsetAssociationMeetings) RawJSON

func (r TagsetAssociationMeetings) RawJSON() string

Returns the unmodified JSON received from the API

func (*TagsetAssociationMeetings) UnmarshalJSON

func (r *TagsetAssociationMeetings) UnmarshalJSON(data []byte) error

type TagsetAssociationMeetingsParam

type TagsetAssociationMeetingsParam struct {
	// String representing the association type. Always `meetings` for meeting tagset
	// associations.
	Type constant.Meetings `json:"type" default:"meetings"`
	// contains filtered or unexported fields
}

Makes this tagset available for meetings.

This struct has a constant value, construct it with NewTagsetAssociationMeetingsParam.

func NewTagsetAssociationMeetingsParam

func NewTagsetAssociationMeetingsParam() TagsetAssociationMeetingsParam

func (TagsetAssociationMeetingsParam) MarshalJSON

func (r TagsetAssociationMeetingsParam) MarshalJSON() (data []byte, err error)

func (*TagsetAssociationMeetingsParam) UnmarshalJSON

func (r *TagsetAssociationMeetingsParam) UnmarshalJSON(data []byte) error

type TagsetAssociationUnion

type TagsetAssociationUnion struct {
	// Any of "calls", "meetings", "inbox".
	Type string `json:"type"`
	// This field is from variant [TagsetAssociationInbox].
	ID   string `json:"id"`
	JSON struct {
		Type respjson.Field
		ID   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

TagsetAssociationUnion contains all possible properties and values from TagsetAssociationCalls, TagsetAssociationMeetings, TagsetAssociationInbox.

Use the TagsetAssociationUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (TagsetAssociationUnion) AsAny

func (u TagsetAssociationUnion) AsAny() anyTagsetAssociation

Use the following switch statement to find the correct variant

switch variant := TagsetAssociationUnion.AsAny().(type) {
case moonbase.TagsetAssociationCalls:
case moonbase.TagsetAssociationMeetings:
case moonbase.TagsetAssociationInbox:
default:
  fmt.Errorf("no variant present")
}

func (TagsetAssociationUnion) AsCalls

func (TagsetAssociationUnion) AsInbox

func (TagsetAssociationUnion) AsMeetings

func (TagsetAssociationUnion) RawJSON

func (u TagsetAssociationUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (TagsetAssociationUnion) ToParam

ToParam converts this TagsetAssociationUnion to a TagsetAssociationUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with TagsetAssociationUnionParam.Overrides()

func (*TagsetAssociationUnion) UnmarshalJSON

func (r *TagsetAssociationUnion) UnmarshalJSON(data []byte) error

type TagsetAssociationUnionParam

type TagsetAssociationUnionParam struct {
	OfCalls    *TagsetAssociationCallsParam    `json:",omitzero,inline"`
	OfMeetings *TagsetAssociationMeetingsParam `json:",omitzero,inline"`
	OfInbox    *TagsetAssociationInboxParam    `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func TagsetAssociationParamOfInbox

func TagsetAssociationParamOfInbox(id string) TagsetAssociationUnionParam

func (TagsetAssociationUnionParam) GetID

Returns a pointer to the underlying variant's property, if present.

func (TagsetAssociationUnionParam) GetType

func (u TagsetAssociationUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (TagsetAssociationUnionParam) MarshalJSON

func (u TagsetAssociationUnionParam) MarshalJSON() ([]byte, error)

func (*TagsetAssociationUnionParam) UnmarshalJSON

func (u *TagsetAssociationUnionParam) UnmarshalJSON(data []byte) error

type TagsetListParams

type TagsetListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (TagsetListParams) URLQuery

func (r TagsetListParams) URLQuery() (v url.Values, err error)

URLQuery serializes TagsetListParams's query parameters as `url.Values`.

type TagsetNewParams

type TagsetNewParams struct {
	// The name of the tagset.
	Name string `json:"name" api:"required"`
	// An optional description of the tagset's purpose.
	Description param.Opt[string] `json:"description,omitzero"`
	// Optional list of associations for this tagset. Include `{type: "calls"}`,
	// `{type: "meetings"}`, or `{type: "inbox", id}`.
	Associations []TagsetAssociationUnionParam `json:"associations,omitzero"`
	// Optional list of tags to create with this tagset. Tags are ordered by their
	// position in the list.
	Tags []TagsetNewParamsTag `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (TagsetNewParams) MarshalJSON

func (r TagsetNewParams) MarshalJSON() (data []byte, err error)

func (*TagsetNewParams) UnmarshalJSON

func (r *TagsetNewParams) UnmarshalJSON(data []byte) error

type TagsetNewParamsTag

type TagsetNewParamsTag struct {
	// The color for the tag.
	//
	// Any of "amber", "blue", "cyan", "emerald", "fuchsia", "green", "indigo", "lime",
	// "lunar", "orange", "pink", "purple", "red", "rose", "sky", "teal", "violet",
	// "yellow".
	Color string `json:"color,omitzero" api:"required"`
	// The name of the tag.
	Name string `json:"name" api:"required"`
	// Existing tag identifier. Include to update an existing tag, omit to create a new
	// tag.
	ID param.Opt[string] `json:"id,omitzero"`
	// contains filtered or unexported fields
}

Parameters for creating or updating a tag within a tagset.

The properties Color, Name are required.

func (TagsetNewParamsTag) MarshalJSON

func (r TagsetNewParamsTag) MarshalJSON() (data []byte, err error)

func (*TagsetNewParamsTag) UnmarshalJSON

func (r *TagsetNewParamsTag) UnmarshalJSON(data []byte) error

type TagsetPointer

type TagsetPointer struct {
	ID   string          `json:"id" api:"required"`
	Type constant.Tagset `json:"type" default:"tagset"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (TagsetPointer) RawJSON

func (r TagsetPointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*TagsetPointer) UnmarshalJSON

func (r *TagsetPointer) UnmarshalJSON(data []byte) error

type TagsetService

type TagsetService struct {
	Options []option.RequestOption
}

Manage your meetings, files, and notes

TagsetService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewTagsetService method instead.

func NewTagsetService

func NewTagsetService(opts ...option.RequestOption) (r TagsetService)

NewTagsetService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*TagsetService) Delete

func (r *TagsetService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes a tagset.

func (*TagsetService) Get

func (r *TagsetService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Tagset, err error)

Retrieves the details of an existing tagset.

func (*TagsetService) List

Returns a list of your tagsets.

func (*TagsetService) ListAutoPaging

Returns a list of your tagsets.

func (*TagsetService) New

func (r *TagsetService) New(ctx context.Context, body TagsetNewParams, opts ...option.RequestOption) (res *Tagset, err error)

Create a new tagset.

func (*TagsetService) Update

func (r *TagsetService) Update(ctx context.Context, id string, body TagsetUpdateParams, opts ...option.RequestOption) (res *Tagset, err error)

Updates an existing tagset.

type TagsetUpdateParams

type TagsetUpdateParams struct {
	// An updated description of the tagset.
	Description param.Opt[string] `json:"description,omitzero"`
	// The new name of the tagset.
	Name param.Opt[string] `json:"name,omitzero"`
	// Optional full list of associations for this tagset. If provided, it replaces all
	// existing associations. An empty array clears all associations, and omitting it
	// preserves existing associations.
	Associations []TagsetAssociationUnionParam `json:"associations,omitzero"`
	// Optional full list of tags for this tagset. If provided, tags are ordered by
	// array position.
	Tags []TagsetUpdateParamsTag `json:"tags,omitzero"`
	// contains filtered or unexported fields
}

func (TagsetUpdateParams) MarshalJSON

func (r TagsetUpdateParams) MarshalJSON() (data []byte, err error)

func (*TagsetUpdateParams) UnmarshalJSON

func (r *TagsetUpdateParams) UnmarshalJSON(data []byte) error

type TagsetUpdateParamsTag

type TagsetUpdateParamsTag struct {
	// The color for the tag.
	//
	// Any of "amber", "blue", "cyan", "emerald", "fuchsia", "green", "indigo", "lime",
	// "lunar", "orange", "pink", "purple", "red", "rose", "sky", "teal", "violet",
	// "yellow".
	Color string `json:"color,omitzero" api:"required"`
	// The name of the tag.
	Name string `json:"name" api:"required"`
	// Existing tag identifier. Include to update an existing tag, omit to create a new
	// tag.
	ID param.Opt[string] `json:"id,omitzero"`
	// contains filtered or unexported fields
}

Parameters for creating or updating a tag within a tagset.

The properties Color, Name are required.

func (TagsetUpdateParamsTag) MarshalJSON

func (r TagsetUpdateParamsTag) MarshalJSON() (data []byte, err error)

func (*TagsetUpdateParamsTag) UnmarshalJSON

func (r *TagsetUpdateParamsTag) UnmarshalJSON(data []byte) error

type TelephoneNumber

type TelephoneNumber struct {
	// A telephone number in strictly formatted E.164 format. Do not include spaces,
	// dashes, or parentheses etc.
	Data string                        `json:"data" api:"required"`
	Type constant.ValueTelephoneNumber `json:"type" default:"value/telephone_number"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Telephone number value

func (TelephoneNumber) RawJSON

func (r TelephoneNumber) RawJSON() string

Returns the unmodified JSON received from the API

func (TelephoneNumber) ToParam

ToParam converts this TelephoneNumber to a TelephoneNumberParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with TelephoneNumberParam.Overrides()

func (*TelephoneNumber) UnmarshalJSON

func (r *TelephoneNumber) UnmarshalJSON(data []byte) error

type TelephoneNumberField

type TelephoneNumberField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality TelephoneNumberFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind TelephoneNumberFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Phone").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `phone`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/telephone_number` for this field.
	Type constant.FieldTelephoneNumber `json:"type" default:"field/telephone_number"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores phone numbers in E.164 format.

func (TelephoneNumberField) RawJSON

func (r TelephoneNumberField) RawJSON() string

Returns the unmodified JSON received from the API

func (*TelephoneNumberField) UnmarshalJSON

func (r *TelephoneNumberField) UnmarshalJSON(data []byte) error

type TelephoneNumberFieldCardinality

type TelephoneNumberFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	TelephoneNumberFieldCardinalityOne  TelephoneNumberFieldCardinality = "one"
	TelephoneNumberFieldCardinalityMany TelephoneNumberFieldCardinality = "many"
)

type TelephoneNumberFieldKind

type TelephoneNumberFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	TelephoneNumberFieldKindSystem  TelephoneNumberFieldKind = "system"
	TelephoneNumberFieldKindInverse TelephoneNumberFieldKind = "inverse"
	TelephoneNumberFieldKindCustom  TelephoneNumberFieldKind = "custom"
)

type TelephoneNumberParam

type TelephoneNumberParam struct {
	// A telephone number in strictly formatted E.164 format. Do not include spaces,
	// dashes, or parentheses etc.
	Data string `json:"data" api:"required"`
	// This field can be elided, and will marshal its zero value as
	// "value/telephone_number".
	Type constant.ValueTelephoneNumber `json:"type" default:"value/telephone_number"`
	// contains filtered or unexported fields
}

Telephone number value

The properties Data, Type are required.

func (TelephoneNumberParam) MarshalJSON

func (r TelephoneNumberParam) MarshalJSON() (data []byte, err error)

func (*TelephoneNumberParam) UnmarshalJSON

func (r *TelephoneNumberParam) UnmarshalJSON(data []byte) error

type URLField

type URLField struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// Specifies whether the field can hold a single value (`one`) or multiple values
	// (`many`).
	//
	// Any of "one", "many".
	Cardinality URLFieldCardinality `json:"cardinality" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt     time.Time                `json:"created_at" api:"required" format:"date-time"`
	DefaultValues []FieldDefaultValueUnion `json:"default_values" api:"required"`
	// `system` fields are managed by Moonbase, `inverse` fields are the reverse side
	// of a two-way relation, and `custom` fields are user-created.
	//
	// Any of "system", "inverse", "custom".
	Kind URLFieldKind `json:"kind" api:"required"`
	// The human-readable name of the field (e.g., "Website").
	Name string `json:"name" api:"required"`
	// If `true`, the value of this field is system-managed and cannot be updated via
	// the API.
	Readonly bool `json:"readonly" api:"required"`
	// A unique, stable, machine-readable identifier for the field within its
	// collection (e.g., `website`).
	Ref string `json:"ref" api:"required"`
	// If `true`, this field must have a value.
	Required bool `json:"required" api:"required"`
	// The data type of the field. Always `field/uri/url` for this field.
	Type constant.FieldUriURL `json:"type" default:"field/uri/url"`
	// If `true`, values for this field must be unique across all items in the
	// collection.
	Unique bool `json:"unique" api:"required"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// An optional, longer-form description of the field's purpose.
	Description string `json:"description"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID            respjson.Field
		Cardinality   respjson.Field
		CreatedAt     respjson.Field
		DefaultValues respjson.Field
		Kind          respjson.Field
		Name          respjson.Field
		Readonly      respjson.Field
		Ref           respjson.Field
		Required      respjson.Field
		Type          respjson.Field
		Unique        respjson.Field
		UpdatedAt     respjson.Field
		Description   respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A field that stores and validates web URLs.

func (URLField) RawJSON

func (r URLField) RawJSON() string

Returns the unmodified JSON received from the API

func (*URLField) UnmarshalJSON

func (r *URLField) UnmarshalJSON(data []byte) error

type URLFieldCardinality

type URLFieldCardinality string

Specifies whether the field can hold a single value (`one`) or multiple values (`many`).

const (
	URLFieldCardinalityOne  URLFieldCardinality = "one"
	URLFieldCardinalityMany URLFieldCardinality = "many"
)

type URLFieldKind

type URLFieldKind string

`system` fields are managed by Moonbase, `inverse` fields are the reverse side of a two-way relation, and `custom` fields are user-created.

const (
	URLFieldKindSystem  URLFieldKind = "system"
	URLFieldKindInverse URLFieldKind = "inverse"
	URLFieldKindCustom  URLFieldKind = "custom"
)

type URLValue

type URLValue struct {
	// A valid URL, conforming to RFC 3986, up to 8,192 characters long. It should
	// include the protocol, for example 'https://' or 'mailto:support@moonbase.ai'
	// etc.
	Data string               `json:"data" api:"required" format:"uri"`
	Type constant.ValueUriURL `json:"type" default:"value/uri/url"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Data        respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

URL or web address

func (URLValue) RawJSON

func (r URLValue) RawJSON() string

Returns the unmodified JSON received from the API

func (URLValue) ToParam

func (r URLValue) ToParam() URLValueParam

ToParam converts this URLValue to a URLValueParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with URLValueParam.Overrides()

func (*URLValue) UnmarshalJSON

func (r *URLValue) UnmarshalJSON(data []byte) error

type URLValueParam

type URLValueParam struct {
	// A valid URL, conforming to RFC 3986, up to 8,192 characters long. It should
	// include the protocol, for example 'https://' or 'mailto:support@moonbase.ai'
	// etc.
	Data string `json:"data" api:"required" format:"uri"`
	// This field can be elided, and will marshal its zero value as "value/uri/url".
	Type constant.ValueUriURL `json:"type" default:"value/uri/url"`
	// contains filtered or unexported fields
}

URL or web address

The properties Data, Type are required.

func (URLValueParam) MarshalJSON

func (r URLValueParam) MarshalJSON() (data []byte, err error)

func (*URLValueParam) UnmarshalJSON

func (r *URLValueParam) UnmarshalJSON(data []byte) error

type Unsubscribe

type Unsubscribe struct {
	CreatedAt time.Time            `json:"created_at" api:"required" format:"date-time"`
	Email     string               `json:"email" api:"required" format:"email"`
	Type      constant.Unsubscribe `json:"type" default:"unsubscribe"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreatedAt   respjson.Field
		Email       respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A record of an unsubscribed email address.

func (Unsubscribe) RawJSON

func (r Unsubscribe) RawJSON() string

Returns the unmodified JSON received from the API

func (*Unsubscribe) UnmarshalJSON

func (r *Unsubscribe) UnmarshalJSON(data []byte) error

type UnsubscribeListParams

type UnsubscribeListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (UnsubscribeListParams) URLQuery

func (r UnsubscribeListParams) URLQuery() (v url.Values, err error)

URLQuery serializes UnsubscribeListParams's query parameters as `url.Values`.

type UnsubscribeNewParams

type UnsubscribeNewParams struct {
	Email string `json:"email" api:"required"`
	// contains filtered or unexported fields
}

func (UnsubscribeNewParams) MarshalJSON

func (r UnsubscribeNewParams) MarshalJSON() (data []byte, err error)

func (*UnsubscribeNewParams) UnmarshalJSON

func (r *UnsubscribeNewParams) UnmarshalJSON(data []byte) error

type UnsubscribePointer

type UnsubscribePointer struct {
	ID   string               `json:"id" api:"required"`
	Type constant.Unsubscribe `json:"type" default:"unsubscribe"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Type        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UnsubscribePointer) RawJSON

func (r UnsubscribePointer) RawJSON() string

Returns the unmodified JSON received from the API

func (*UnsubscribePointer) UnmarshalJSON

func (r *UnsubscribePointer) UnmarshalJSON(data []byte) error

type UnsubscribeService

type UnsubscribeService struct {
	Options []option.RequestOption
}

Manage your marketing campaigns and forms

UnsubscribeService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewUnsubscribeService method instead.

func NewUnsubscribeService

func NewUnsubscribeService(opts ...option.RequestOption) (r UnsubscribeService)

NewUnsubscribeService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*UnsubscribeService) Delete

func (r *UnsubscribeService) Delete(ctx context.Context, email string, opts ...option.RequestOption) (err error)

Permanently deletes an unsubscribe by email address.

func (*UnsubscribeService) List

Returns a list of unsubscribes.

func (*UnsubscribeService) ListAutoPaging

Returns a list of unsubscribes.

func (*UnsubscribeService) New

Create a new unsubscribe.

type ValueParamUnion

type ValueParamUnion struct {
	OfValueTextSingleLine        *SingleLineTextValueParam `json:",omitzero,inline"`
	OfValueTextMultiLine         *MultiLineTextValueParam  `json:",omitzero,inline"`
	OfValueIdentifier            *IdentifierValueParam     `json:",omitzero,inline"`
	OfValueNumberUnitlessInteger *IntegerValueParam        `json:",omitzero,inline"`
	OfValueNumberUnitlessFloat   *FloatValueParam          `json:",omitzero,inline"`
	OfValueNumberMonetary        *MonetaryValueParam       `json:",omitzero,inline"`
	OfValueNumberPercentage      *PercentageValueParam     `json:",omitzero,inline"`
	OfValueBoolean               *BooleanValueParam        `json:",omitzero,inline"`
	OfValueEmail                 *EmailValueParam          `json:",omitzero,inline"`
	OfValueUriURL                *URLValueParam            `json:",omitzero,inline"`
	OfValueUriDomain             *DomainValueParam         `json:",omitzero,inline"`
	OfValueUriSocialX            *SocialXValueParam        `json:",omitzero,inline"`
	OfValueUriSocialLinkedIn     *SocialLinkedInValueParam `json:",omitzero,inline"`
	OfValueTelephoneNumber       *TelephoneNumberParam     `json:",omitzero,inline"`
	OfValueGeo                   *GeoValueParam            `json:",omitzero,inline"`
	OfValueDate                  *DateValueParam           `json:",omitzero,inline"`
	OfValueDatetime              *DatetimeValueParam       `json:",omitzero,inline"`
	OfValueChoice                *ChoiceValueParam         `json:",omitzero,inline"`
	OfValueFunnelStep            *FunnelStepValueParam     `json:",omitzero,inline"`
	OfValueRelation              *RelationValueParam       `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func ValueParamOfValueBoolean

func ValueParamOfValueBoolean(data bool) ValueParamUnion

func ValueParamOfValueDate

func ValueParamOfValueDate(data time.Time) ValueParamUnion

func ValueParamOfValueDatetime

func ValueParamOfValueDatetime(data time.Time) ValueParamUnion

func ValueParamOfValueEmail

func ValueParamOfValueEmail(data string) ValueParamUnion

func ValueParamOfValueFunnelStep

func ValueParamOfValueFunnelStep(data FunnelStepPointerParam) ValueParamUnion

func ValueParamOfValueGeo

func ValueParamOfValueGeo(data string) ValueParamUnion

func ValueParamOfValueIdentifier

func ValueParamOfValueIdentifier(data string) ValueParamUnion

func ValueParamOfValueNumberMonetary

func ValueParamOfValueNumberMonetary(data MonetaryValueDataParam) ValueParamUnion

func ValueParamOfValueNumberPercentage

func ValueParamOfValueNumberPercentage(data float64) ValueParamUnion

func ValueParamOfValueNumberUnitlessFloat

func ValueParamOfValueNumberUnitlessFloat(data float64) ValueParamUnion

func ValueParamOfValueNumberUnitlessInteger

func ValueParamOfValueNumberUnitlessInteger(data int64) ValueParamUnion

func ValueParamOfValueRelation

func ValueParamOfValueRelation(data ItemPointerParam) ValueParamUnion

func ValueParamOfValueTelephoneNumber

func ValueParamOfValueTelephoneNumber(data string) ValueParamUnion

func ValueParamOfValueTextMultiLine

func ValueParamOfValueTextMultiLine(data string) ValueParamUnion

func ValueParamOfValueTextSingleLine

func ValueParamOfValueTextSingleLine(data string) ValueParamUnion

func ValueParamOfValueUriDomain

func ValueParamOfValueUriDomain(data string) ValueParamUnion

func ValueParamOfValueUriSocialLinkedIn

func ValueParamOfValueUriSocialLinkedIn(data SocialProfileLinkedInParam) ValueParamUnion

func ValueParamOfValueUriSocialX

func ValueParamOfValueUriSocialX(data SocialProfileXParam) ValueParamUnion

func ValueParamOfValueUriURL

func ValueParamOfValueUriURL(data string) ValueParamUnion

func (ValueParamUnion) GetData

func (u ValueParamUnion) GetData() (res valueParamUnionData)

Returns a subunion which exports methods to access subproperties

Or use AsAny() to get the underlying value

func (ValueParamUnion) GetType

func (u ValueParamUnion) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ValueParamUnion) MarshalJSON

func (u ValueParamUnion) MarshalJSON() ([]byte, error)

func (*ValueParamUnion) UnmarshalJSON

func (u *ValueParamUnion) UnmarshalJSON(data []byte) error

type ValueUnion

type ValueUnion struct {
	// This field is a union of [string], [string], [string], [int64], [float64],
	// [MonetaryValueData], [float64], [bool], [string], [string], [string],
	// [SocialXValueData], [SocialLinkedInValueData], [string], [string], [time.Time],
	// [time.Time], [ChoiceFieldOption], [FunnelStep], [ItemPointer]
	Data ValueUnionData `json:"data"`
	// Any of "value/text/single_line", "value/text/multi_line", "value/identifier",
	// "value/number/unitless_integer", "value/number/unitless_float",
	// "value/number/monetary", "value/number/percentage", "value/boolean",
	// "value/email", "value/uri/url", "value/uri/domain", "value/uri/social_x",
	// "value/uri/social_linked_in", "value/telephone_number", "value/geo",
	// "value/date", "value/datetime", "value/choice", "value/funnel_step",
	// "value/relation".
	Type string `json:"type"`
	JSON struct {
		Data respjson.Field
		Type respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ValueUnion contains all possible properties and values from SingleLineTextValue, MultiLineTextValue, IdentifierValue, IntegerValue, FloatValue, MonetaryValue, PercentageValue, BooleanValue, EmailValue, URLValue, DomainValue, SocialXValue, SocialLinkedInValue, TelephoneNumber, GeoValue, DateValue, DatetimeValue, ChoiceValue, FunnelStepValue, RelationValue.

Use the ValueUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ValueUnion) AsAny

func (u ValueUnion) AsAny() anyValue

Use the following switch statement to find the correct variant

switch variant := ValueUnion.AsAny().(type) {
case moonbase.SingleLineTextValue:
case moonbase.MultiLineTextValue:
case moonbase.IdentifierValue:
case moonbase.IntegerValue:
case moonbase.FloatValue:
case moonbase.MonetaryValue:
case moonbase.PercentageValue:
case moonbase.BooleanValue:
case moonbase.EmailValue:
case moonbase.URLValue:
case moonbase.DomainValue:
case moonbase.SocialXValue:
case moonbase.SocialLinkedInValue:
case moonbase.TelephoneNumber:
case moonbase.GeoValue:
case moonbase.DateValue:
case moonbase.DatetimeValue:
case moonbase.ChoiceValue:
case moonbase.FunnelStepValue:
case moonbase.RelationValue:
default:
  fmt.Errorf("no variant present")
}

func (ValueUnion) AsValueBoolean

func (u ValueUnion) AsValueBoolean() (v BooleanValue)

func (ValueUnion) AsValueChoice

func (u ValueUnion) AsValueChoice() (v ChoiceValue)

func (ValueUnion) AsValueDate

func (u ValueUnion) AsValueDate() (v DateValue)

func (ValueUnion) AsValueDatetime

func (u ValueUnion) AsValueDatetime() (v DatetimeValue)

func (ValueUnion) AsValueEmail

func (u ValueUnion) AsValueEmail() (v EmailValue)

func (ValueUnion) AsValueFunnelStep

func (u ValueUnion) AsValueFunnelStep() (v FunnelStepValue)

func (ValueUnion) AsValueGeo

func (u ValueUnion) AsValueGeo() (v GeoValue)

func (ValueUnion) AsValueIdentifier

func (u ValueUnion) AsValueIdentifier() (v IdentifierValue)

func (ValueUnion) AsValueNumberMonetary

func (u ValueUnion) AsValueNumberMonetary() (v MonetaryValue)

func (ValueUnion) AsValueNumberPercentage

func (u ValueUnion) AsValueNumberPercentage() (v PercentageValue)

func (ValueUnion) AsValueNumberUnitlessFloat

func (u ValueUnion) AsValueNumberUnitlessFloat() (v FloatValue)

func (ValueUnion) AsValueNumberUnitlessInteger

func (u ValueUnion) AsValueNumberUnitlessInteger() (v IntegerValue)

func (ValueUnion) AsValueRelation

func (u ValueUnion) AsValueRelation() (v RelationValue)

func (ValueUnion) AsValueTelephoneNumber

func (u ValueUnion) AsValueTelephoneNumber() (v TelephoneNumber)

func (ValueUnion) AsValueTextMultiLine

func (u ValueUnion) AsValueTextMultiLine() (v MultiLineTextValue)

func (ValueUnion) AsValueTextSingleLine

func (u ValueUnion) AsValueTextSingleLine() (v SingleLineTextValue)

func (ValueUnion) AsValueUriDomain

func (u ValueUnion) AsValueUriDomain() (v DomainValue)

func (ValueUnion) AsValueUriSocialLinkedIn

func (u ValueUnion) AsValueUriSocialLinkedIn() (v SocialLinkedInValue)

func (ValueUnion) AsValueUriSocialX

func (u ValueUnion) AsValueUriSocialX() (v SocialXValue)

func (ValueUnion) AsValueUriURL

func (u ValueUnion) AsValueUriURL() (v URLValue)

func (ValueUnion) RawJSON

func (u ValueUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ValueUnion) UnmarshalJSON

func (r *ValueUnion) UnmarshalJSON(data []byte) error

type ValueUnionData

type ValueUnionData struct {
	// This field will be present if the value is a [string] instead of an object.
	OfString string `json:",inline"`
	// This field will be present if the value is a [int64] instead of an object.
	OfInt int64 `json:",inline"`
	// This field will be present if the value is a [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [bool] instead of an object.
	OfBool bool `json:",inline"`
	// This field will be present if the value is a [time.Time] instead of an object.
	OfTime time.Time `json:",inline"`
	// This field is from variant [MonetaryValueData].
	Currency string `json:"currency"`
	// This field is from variant [MonetaryValueData].
	InMinorUnits int64  `json:"in_minor_units"`
	URL          string `json:"url"`
	Username     string `json:"username"`
	ID           string `json:"id"`
	Color        string `json:"color"`
	Name         string `json:"name"`
	Type         string `json:"type"`
	// This field is from variant [FunnelStep].
	StepType FunnelStepStepType `json:"step_type"`
	// This field is from variant [ItemPointer].
	Collection CollectionPointer `json:"collection"`
	JSON       struct {
		OfString     respjson.Field
		OfInt        respjson.Field
		OfFloat      respjson.Field
		OfBool       respjson.Field
		OfTime       respjson.Field
		Currency     respjson.Field
		InMinorUnits respjson.Field
		URL          respjson.Field
		Username     respjson.Field
		ID           respjson.Field
		Color        respjson.Field
		Name         respjson.Field
		Type         respjson.Field
		StepType     respjson.Field
		Collection   respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ValueUnionData is an implicit subunion of ValueUnion. ValueUnionData provides convenient access to the sub-properties of the union.

For type safety it is recommended to directly use a variant of the ValueUnion.

If the underlying value is not a json object, one of the following properties will be valid: OfString OfInt OfFloat OfBool OfTime]

func (*ValueUnionData) UnmarshalJSON

func (r *ValueUnionData) UnmarshalJSON(data []byte) error

type View

type View struct {
	// Unique identifier for the object.
	ID string `json:"id" api:"required"`
	// The metrics computed over the view's items.
	Aggregates []ViewAggregateUnion `json:"aggregates" api:"required"`
	// The `Collection` this view belongs to.
	Collection CollectionPointer `json:"collection" api:"required"`
	// Time at which the object was created, as an ISO 8601 timestamp in UTC.
	CreatedAt time.Time `json:"created_at" api:"required" format:"date-time"`
	// The view's columns, in display order.
	Fields []ViewField `json:"fields" api:"required"`
	// Return only items that match the filter conditions. Complex filters can be
	// created by nesting filters inside of `AND`, `OR`, and `NOT` filters.
	Filter ItemsFilterUnion `json:"filter" api:"required"`
	// Fields whose values group the view's items. Empty when the view is not grouped.
	Groups []string `json:"groups" api:"required"`
	// The name of the view.
	Name string `json:"name" api:"required"`
	// Filters limiting which related items the view's relation columns show.
	RelationValueFilters []ViewRelationValueFilter `json:"relation_value_filters" api:"required"`
	// Sort items returned by the specified fields. Empty when the view has no sort.
	Sort []string `json:"sort" api:"required"`
	// String representing the object’s type. Always `view` for this object.
	Type constant.View `json:"type" default:"view"`
	// Time at which the object was last updated, as an ISO 8601 timestamp in UTC.
	UpdatedAt time.Time `json:"updated_at" api:"required" format:"date-time"`
	// The type of view, such as `table` or `board`.
	//
	// Any of "table", "board".
	ViewType ViewViewType `json:"view_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                   respjson.Field
		Aggregates           respjson.Field
		Collection           respjson.Field
		CreatedAt            respjson.Field
		Fields               respjson.Field
		Filter               respjson.Field
		Groups               respjson.Field
		Name                 respjson.Field
		RelationValueFilters respjson.Field
		Sort                 respjson.Field
		Type                 respjson.Field
		UpdatedAt            respjson.Field
		ViewType             respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A View represents a saved configuration for displaying items in a collection, including filters and sorting rules.

func (View) RawJSON

func (r View) RawJSON() string

Returns the unmodified JSON received from the API

func (*View) UnmarshalJSON

func (r *View) UnmarshalJSON(data []byte) error

type ViewAggregateFieldStatistic

type ViewAggregateFieldStatistic struct {
	// The statistic to compute. Scalar statistics (sum, mean, max, min) require a
	// number field as `value`.
	//
	// Any of "count", "sum", "mean", "max", "min", "filled_percentage".
	Statistic ViewAggregateFieldStatisticStatistic `json:"statistic" api:"required"`
	Type      constant.FieldStatistic              `json:"type" default:"field_statistic"`
	// The field whose values the statistic is computed over.
	Value string `json:"value" api:"required"`
	// An optional field whose values bucket the statistic.
	Group string `json:"group"`
	// An optional percentage field used to weight the statistic. Only supported for
	// scalar statistics.
	Weight string `json:"weight"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Statistic   respjson.Field
		Type        respjson.Field
		Value       respjson.Field
		Group       respjson.Field
		Weight      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Computes a statistic over the values of a field.

func (ViewAggregateFieldStatistic) RawJSON

func (r ViewAggregateFieldStatistic) RawJSON() string

Returns the unmodified JSON received from the API

func (ViewAggregateFieldStatistic) ToParam

ToParam converts this ViewAggregateFieldStatistic to a ViewAggregateFieldStatisticParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ViewAggregateFieldStatisticParam.Overrides()

func (*ViewAggregateFieldStatistic) UnmarshalJSON

func (r *ViewAggregateFieldStatistic) UnmarshalJSON(data []byte) error

type ViewAggregateFieldStatisticParam

type ViewAggregateFieldStatisticParam struct {
	// The statistic to compute. Scalar statistics (sum, mean, max, min) require a
	// number field as `value`.
	//
	// Any of "count", "sum", "mean", "max", "min", "filled_percentage".
	Statistic ViewAggregateFieldStatisticStatistic `json:"statistic,omitzero" api:"required"`
	// The field whose values the statistic is computed over.
	Value string `json:"value" api:"required"`
	// An optional field whose values bucket the statistic.
	Group param.Opt[string] `json:"group,omitzero"`
	// An optional percentage field used to weight the statistic. Only supported for
	// scalar statistics.
	Weight param.Opt[string] `json:"weight,omitzero"`
	// This field can be elided, and will marshal its zero value as "field_statistic".
	Type constant.FieldStatistic `json:"type" default:"field_statistic"`
	// contains filtered or unexported fields
}

Computes a statistic over the values of a field.

The properties Statistic, Type, Value are required.

func (ViewAggregateFieldStatisticParam) MarshalJSON

func (r ViewAggregateFieldStatisticParam) MarshalJSON() (data []byte, err error)

func (*ViewAggregateFieldStatisticParam) UnmarshalJSON

func (r *ViewAggregateFieldStatisticParam) UnmarshalJSON(data []byte) error

type ViewAggregateFieldStatisticStatistic

type ViewAggregateFieldStatisticStatistic string

The statistic to compute. Scalar statistics (sum, mean, max, min) require a number field as `value`.

const (
	ViewAggregateFieldStatisticStatisticCount            ViewAggregateFieldStatisticStatistic = "count"
	ViewAggregateFieldStatisticStatisticSum              ViewAggregateFieldStatisticStatistic = "sum"
	ViewAggregateFieldStatisticStatisticMean             ViewAggregateFieldStatisticStatistic = "mean"
	ViewAggregateFieldStatisticStatisticMax              ViewAggregateFieldStatisticStatistic = "max"
	ViewAggregateFieldStatisticStatisticMin              ViewAggregateFieldStatisticStatistic = "min"
	ViewAggregateFieldStatisticStatisticFilledPercentage ViewAggregateFieldStatisticStatistic = "filled_percentage"
)

type ViewAggregateItemCount

type ViewAggregateItemCount struct {
	Type constant.ItemCount `json:"type" default:"item_count"`
	// An optional field whose values bucket the counts.
	Group string `json:"group"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Type        respjson.Field
		Group       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Counts the view's items.

func (ViewAggregateItemCount) RawJSON

func (r ViewAggregateItemCount) RawJSON() string

Returns the unmodified JSON received from the API

func (ViewAggregateItemCount) ToParam

ToParam converts this ViewAggregateItemCount to a ViewAggregateItemCountParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ViewAggregateItemCountParam.Overrides()

func (*ViewAggregateItemCount) UnmarshalJSON

func (r *ViewAggregateItemCount) UnmarshalJSON(data []byte) error

type ViewAggregateItemCountParam

type ViewAggregateItemCountParam struct {
	// An optional field whose values bucket the counts.
	Group param.Opt[string] `json:"group,omitzero"`
	// This field can be elided, and will marshal its zero value as "item_count".
	Type constant.ItemCount `json:"type" default:"item_count"`
	// contains filtered or unexported fields
}

Counts the view's items.

The property Type is required.

func (ViewAggregateItemCountParam) MarshalJSON

func (r ViewAggregateItemCountParam) MarshalJSON() (data []byte, err error)

func (*ViewAggregateItemCountParam) UnmarshalJSON

func (r *ViewAggregateItemCountParam) UnmarshalJSON(data []byte) error

type ViewAggregateUnion

type ViewAggregateUnion struct {
	// Any of "item_count", "field_statistic".
	Type  string `json:"type"`
	Group string `json:"group"`
	// This field is from variant [ViewAggregateFieldStatistic].
	Statistic ViewAggregateFieldStatisticStatistic `json:"statistic"`
	// This field is from variant [ViewAggregateFieldStatistic].
	Value string `json:"value"`
	// This field is from variant [ViewAggregateFieldStatistic].
	Weight string `json:"weight"`
	JSON   struct {
		Type      respjson.Field
		Group     respjson.Field
		Statistic respjson.Field
		Value     respjson.Field
		Weight    respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ViewAggregateUnion contains all possible properties and values from ViewAggregateItemCount, ViewAggregateFieldStatistic.

Use the ViewAggregateUnion.AsAny method to switch on the variant.

Use the methods beginning with 'As' to cast the union to one of its variants.

func (ViewAggregateUnion) AsAny

func (u ViewAggregateUnion) AsAny() anyViewAggregate

Use the following switch statement to find the correct variant

switch variant := ViewAggregateUnion.AsAny().(type) {
case moonbase.ViewAggregateItemCount:
case moonbase.ViewAggregateFieldStatistic:
default:
  fmt.Errorf("no variant present")
}

func (ViewAggregateUnion) AsFieldStatistic

func (u ViewAggregateUnion) AsFieldStatistic() (v ViewAggregateFieldStatistic)

func (ViewAggregateUnion) AsItemCount

func (u ViewAggregateUnion) AsItemCount() (v ViewAggregateItemCount)

func (ViewAggregateUnion) RawJSON

func (u ViewAggregateUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (ViewAggregateUnion) ToParam

ToParam converts this ViewAggregateUnion to a ViewAggregateUnionParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ViewAggregateUnionParam.Overrides()

func (*ViewAggregateUnion) UnmarshalJSON

func (r *ViewAggregateUnion) UnmarshalJSON(data []byte) error

type ViewAggregateUnionParam

type ViewAggregateUnionParam struct {
	OfItemCount      *ViewAggregateItemCountParam      `json:",omitzero,inline"`
	OfFieldStatistic *ViewAggregateFieldStatisticParam `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func ViewAggregateParamOfFieldStatistic

func ViewAggregateParamOfFieldStatistic(statistic ViewAggregateFieldStatisticStatistic, value string) ViewAggregateUnionParam

func (ViewAggregateUnionParam) GetGroup

func (u ViewAggregateUnionParam) GetGroup() *string

Returns a pointer to the underlying variant's property, if present.

func (ViewAggregateUnionParam) GetStatistic

func (u ViewAggregateUnionParam) GetStatistic() *string

Returns a pointer to the underlying variant's property, if present.

func (ViewAggregateUnionParam) GetType

func (u ViewAggregateUnionParam) GetType() *string

Returns a pointer to the underlying variant's property, if present.

func (ViewAggregateUnionParam) GetValue

func (u ViewAggregateUnionParam) GetValue() *string

Returns a pointer to the underlying variant's property, if present.

func (ViewAggregateUnionParam) GetWeight

func (u ViewAggregateUnionParam) GetWeight() *string

Returns a pointer to the underlying variant's property, if present.

func (ViewAggregateUnionParam) MarshalJSON

func (u ViewAggregateUnionParam) MarshalJSON() ([]byte, error)

func (*ViewAggregateUnionParam) UnmarshalJSON

func (u *ViewAggregateUnionParam) UnmarshalJSON(data []byte) error

type ViewField

type ViewField struct {
	// The field shown in this column.
	Field string `json:"field" api:"required"`
	// Which fields of the related item to show, relative to the related collection.
	// Omitted means the related collection's default display fields.
	DisplayFields []string `json:"display_fields"`
	// Whether the column is pinned.
	IsPinned bool `json:"is_pinned"`
	// Whether the column wraps its content.
	IsWrapped bool `json:"is_wrapped"`
	// The column width: a number of pixels, or `fit` (size to content), or `flex`
	// (fill available space).
	Size ViewFieldSizeUnion `json:"size"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Field         respjson.Field
		DisplayFields respjson.Field
		IsPinned      respjson.Field
		IsWrapped     respjson.Field
		Size          respjson.Field
		ExtraFields   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A column of the view.

func (ViewField) RawJSON

func (r ViewField) RawJSON() string

Returns the unmodified JSON received from the API

func (ViewField) ToParam

func (r ViewField) ToParam() ViewFieldParam

ToParam converts this ViewField to a ViewFieldParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ViewFieldParam.Overrides()

func (*ViewField) UnmarshalJSON

func (r *ViewField) UnmarshalJSON(data []byte) error

type ViewFieldParam

type ViewFieldParam struct {
	// The field shown in this column.
	Field string `json:"field" api:"required"`
	// Whether the column is pinned.
	IsPinned param.Opt[bool] `json:"is_pinned,omitzero"`
	// Whether the column wraps its content.
	IsWrapped param.Opt[bool] `json:"is_wrapped,omitzero"`
	// Which fields of the related item to show, relative to the related collection.
	// Omitted means the related collection's default display fields.
	DisplayFields []string `json:"display_fields,omitzero"`
	// The column width: a number of pixels, or `fit` (size to content), or `flex`
	// (fill available space).
	Size ViewFieldSizeUnionParam `json:"size,omitzero"`
	// contains filtered or unexported fields
}

A column of the view.

The property Field is required.

func (ViewFieldParam) MarshalJSON

func (r ViewFieldParam) MarshalJSON() (data []byte, err error)

func (*ViewFieldParam) UnmarshalJSON

func (r *ViewFieldParam) UnmarshalJSON(data []byte) error

type ViewFieldSizeString

type ViewFieldSizeString string
const (
	ViewFieldSizeStringFit  ViewFieldSizeString = "fit"
	ViewFieldSizeStringFlex ViewFieldSizeString = "flex"
)

type ViewFieldSizeUnion

type ViewFieldSizeUnion struct {
	// This field will be present if the value is a [float64] instead of an object.
	OfFloat float64 `json:",inline"`
	// This field will be present if the value is a [string] instead of an object.
	OfViewFieldSizeString string `json:",inline"`
	JSON                  struct {
		OfFloat               respjson.Field
		OfViewFieldSizeString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

ViewFieldSizeUnion contains all possible properties and values from [float64], [string].

Use the methods beginning with 'As' to cast the union to one of its variants.

If the underlying value is not a json object, one of the following properties will be valid: OfFloat OfViewFieldSizeString]

func (ViewFieldSizeUnion) AsFloat

func (u ViewFieldSizeUnion) AsFloat() (v float64)

func (ViewFieldSizeUnion) AsViewFieldSizeString

func (u ViewFieldSizeUnion) AsViewFieldSizeString() (v string)

func (ViewFieldSizeUnion) RawJSON

func (u ViewFieldSizeUnion) RawJSON() string

Returns the unmodified JSON received from the API

func (*ViewFieldSizeUnion) UnmarshalJSON

func (r *ViewFieldSizeUnion) UnmarshalJSON(data []byte) error

type ViewFieldSizeUnionParam

type ViewFieldSizeUnionParam struct {
	OfFloat param.Opt[float64] `json:",omitzero,inline"`
	// Check if union is this variant with
	// !param.IsOmitted(union.OfViewFieldSizeString)
	OfViewFieldSizeString param.Opt[string] `json:",omitzero,inline"`
	// contains filtered or unexported fields
}

Only one field can be non-zero.

Use param.IsOmitted to confirm if a field is set.

func (ViewFieldSizeUnionParam) MarshalJSON

func (u ViewFieldSizeUnionParam) MarshalJSON() ([]byte, error)

func (*ViewFieldSizeUnionParam) UnmarshalJSON

func (u *ViewFieldSizeUnionParam) UnmarshalJSON(data []byte) error

type ViewItemListParams

type ViewItemListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ViewItemListParams) URLQuery

func (r ViewItemListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ViewItemListParams's query parameters as `url.Values`.

type ViewItemService

type ViewItemService struct {
	Options []option.RequestOption
}

Manage your collections and items

ViewItemService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewViewItemService method instead.

func NewViewItemService

func NewViewItemService(opts ...option.RequestOption) (r ViewItemService)

NewViewItemService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ViewItemService) List

Returns a list of items that are part of the specified view.

func (*ViewItemService) ListAutoPaging

Returns a list of items that are part of the specified view.

type ViewListParams

type ViewListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ViewListParams) URLQuery

func (r ViewListParams) URLQuery() (v url.Values, err error)

URLQuery serializes ViewListParams's query parameters as `url.Values`.

type ViewListResponse

type ViewListResponse struct {
	ID string `json:"id" api:"required"`
	// A lightweight reference to a `Collection`, containing the minimal information
	// needed to identify it.
	Collection CollectionPointer `json:"collection" api:"required"`
	CreatedAt  time.Time         `json:"created_at" api:"required" format:"date-time"`
	Name       string            `json:"name" api:"required"`
	Type       constant.View     `json:"type" default:"view"`
	UpdatedAt  time.Time         `json:"updated_at" api:"required" format:"date-time"`
	// Any of "table", "board".
	ViewType ViewListResponseViewType `json:"view_type" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Collection  respjson.Field
		CreatedAt   respjson.Field
		Name        respjson.Field
		Type        respjson.Field
		UpdatedAt   respjson.Field
		ViewType    respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (ViewListResponse) RawJSON

func (r ViewListResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*ViewListResponse) UnmarshalJSON

func (r *ViewListResponse) UnmarshalJSON(data []byte) error

type ViewListResponseViewType

type ViewListResponseViewType string
const (
	ViewListResponseViewTypeTable ViewListResponseViewType = "table"
	ViewListResponseViewTypeBoard ViewListResponseViewType = "board"
)

type ViewNewParams

type ViewNewParams struct {
	// A pointer to the `Collection` the view belongs to.
	Collection ViewNewParamsCollection `json:"collection,omitzero" api:"required"`
	// The view's columns, in display order.
	Fields []ViewFieldParam `json:"fields,omitzero" api:"required"`
	// The name of the view.
	Name string `json:"name" api:"required"`
	// The type of view, `table` or `board`.
	//
	// Any of "table", "board".
	ViewType ViewNewParamsViewType `json:"view_type,omitzero" api:"required"`
	// The metrics computed over the view's items.
	Aggregates []ViewAggregateUnionParam `json:"aggregates,omitzero"`
	// The filter applied to the view's items.
	Filter ItemsFilterUnionParam `json:"filter,omitzero"`
	// Fields whose values group the view's items.
	Groups []string `json:"groups,omitzero"`
	// Filters limiting which related items the view's relation columns show.
	RelationValueFilters []ViewRelationValueFilterParam `json:"relation_value_filters,omitzero"`
	// Sort items returned by the specified fields.
	Sort []string `json:"sort,omitzero"`
	// contains filtered or unexported fields
}

func (ViewNewParams) MarshalJSON

func (r ViewNewParams) MarshalJSON() (data []byte, err error)

func (*ViewNewParams) UnmarshalJSON

func (r *ViewNewParams) UnmarshalJSON(data []byte) error

type ViewNewParamsCollection

type ViewNewParamsCollection struct {
	// Unique identifier of the collection.
	ID param.Opt[string] `json:"id,omitzero"`
	// The stable, machine-readable reference identifier of the collection.
	Ref param.Opt[string] `json:"ref,omitzero"`
	// String representing the object’s type. Always `collection` for this object.
	//
	// This field can be elided, and will marshal its zero value as "collection".
	Type constant.Collection `json:"type" default:"collection"`
	// contains filtered or unexported fields
}

A pointer to the `Collection` the view belongs to.

The property Type is required.

func (ViewNewParamsCollection) MarshalJSON

func (r ViewNewParamsCollection) MarshalJSON() (data []byte, err error)

func (*ViewNewParamsCollection) UnmarshalJSON

func (r *ViewNewParamsCollection) UnmarshalJSON(data []byte) error

type ViewNewParamsViewType

type ViewNewParamsViewType string

The type of view, `table` or `board`.

const (
	ViewNewParamsViewTypeTable ViewNewParamsViewType = "table"
	ViewNewParamsViewTypeBoard ViewNewParamsViewType = "board"
)

type ViewRelationValueFilter

type ViewRelationValueFilter struct {
	// The relation column whose related items are filtered.
	Field string `json:"field" api:"required"`
	// The filter the related items must match. Field paths are relative to the related
	// collection.
	Filter ItemsFilterUnion `json:"filter" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Field       respjson.Field
		Filter      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Limits which related items a relation column shows: only related items matching `filter` appear.

func (ViewRelationValueFilter) RawJSON

func (r ViewRelationValueFilter) RawJSON() string

Returns the unmodified JSON received from the API

func (ViewRelationValueFilter) ToParam

ToParam converts this ViewRelationValueFilter to a ViewRelationValueFilterParam.

Warning: the fields of the param type will not be present. ToParam should only be used at the last possible moment before sending a request. Test for this with ViewRelationValueFilterParam.Overrides()

func (*ViewRelationValueFilter) UnmarshalJSON

func (r *ViewRelationValueFilter) UnmarshalJSON(data []byte) error

type ViewRelationValueFilterParam

type ViewRelationValueFilterParam struct {
	// The relation column whose related items are filtered.
	Field string `json:"field" api:"required"`
	// The filter the related items must match. Field paths are relative to the related
	// collection.
	Filter ItemsFilterUnionParam `json:"filter,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Limits which related items a relation column shows: only related items matching `filter` appear.

The properties Field, Filter are required.

func (ViewRelationValueFilterParam) MarshalJSON

func (r ViewRelationValueFilterParam) MarshalJSON() (data []byte, err error)

func (*ViewRelationValueFilterParam) UnmarshalJSON

func (r *ViewRelationValueFilterParam) UnmarshalJSON(data []byte) error

type ViewService

type ViewService struct {
	Options []option.RequestOption
	// Manage your collections and items
	Items ViewItemService
}

Manage your collections and items

ViewService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewViewService method instead.

func NewViewService

func NewViewService(opts ...option.RequestOption) (r ViewService)

NewViewService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*ViewService) Delete

func (r *ViewService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes a view. The default view of a collection cannot be deleted.

func (*ViewService) Get

func (r *ViewService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *View, err error)

Retrieves the details of an existing view.

func (*ViewService) List

Returns a list of views.

func (*ViewService) ListAutoPaging

Returns a list of views.

func (*ViewService) New

func (r *ViewService) New(ctx context.Context, body ViewNewParams, opts ...option.RequestOption) (res *View, err error)

Creates a new view in a collection.

func (*ViewService) Update

func (r *ViewService) Update(ctx context.Context, id string, body ViewUpdateParams, opts ...option.RequestOption) (res *View, err error)

Updates a view. The change applies to the shared view that everyone in the workspace sees.

type ViewUpdateParams

type ViewUpdateParams struct {
	// The name of the view.
	Name param.Opt[string] `json:"name,omitzero"`
	// The metrics computed over the view's items. An empty array clears them.
	Aggregates []ViewAggregateUnionParam `json:"aggregates,omitzero"`
	// The view's columns, in display order. If provided, it must contain at least one
	// column.
	Fields []ViewFieldParam `json:"fields,omitzero"`
	// Return only items that match the filter conditions. Complex filters can be
	// created by nesting filters inside of `AND`, `OR`, and `NOT` filters.
	Filter ItemsFilterUnionParam `json:"filter,omitzero"`
	// Fields whose values group the view's items. An empty array clears the grouping.
	Groups []string `json:"groups,omitzero"`
	// Filters limiting which related items the view's relation columns show. An empty
	// array clears them.
	RelationValueFilters []ViewRelationValueFilterParam `json:"relation_value_filters,omitzero"`
	// Sort items returned by the specified fields. An empty array clears the sort.
	Sort []string `json:"sort,omitzero"`
	// The type of view, `table` or `board`.
	//
	// Any of "table", "board".
	ViewType ViewUpdateParamsViewType `json:"view_type,omitzero"`
	// contains filtered or unexported fields
}

func (ViewUpdateParams) MarshalJSON

func (r ViewUpdateParams) MarshalJSON() (data []byte, err error)

func (*ViewUpdateParams) UnmarshalJSON

func (r *ViewUpdateParams) UnmarshalJSON(data []byte) error

type ViewUpdateParamsViewType

type ViewUpdateParamsViewType string

The type of view, `table` or `board`.

const (
	ViewUpdateParamsViewTypeTable ViewUpdateParamsViewType = "table"
	ViewUpdateParamsViewTypeBoard ViewUpdateParamsViewType = "board"
)

type ViewViewType

type ViewViewType string

The type of view, such as `table` or `board`.

const (
	ViewViewTypeTable ViewViewType = "table"
	ViewViewTypeBoard ViewViewType = "board"
)

type WebhookEndpointListParams

type WebhookEndpointListParams struct {
	// When specified, returns results starting immediately after the item identified
	// by this cursor. Use the cursor value from the previous response's metadata to
	// fetch the next page of results.
	After param.Opt[string] `query:"after,omitzero" json:"-"`
	// When specified, returns results starting immediately before the item identified
	// by this cursor. Use the cursor value from the response's metadata to fetch the
	// previous page of results.
	Before param.Opt[string] `query:"before,omitzero" json:"-"`
	// Maximum number of items to return per page. Must be between 1 and 100. Defaults
	// to 20 if not specified.
	Limit param.Opt[int64] `query:"limit,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (WebhookEndpointListParams) URLQuery

func (r WebhookEndpointListParams) URLQuery() (v url.Values, err error)

URLQuery serializes WebhookEndpointListParams's query parameters as `url.Values`.

type WebhookEndpointNewParams

type WebhookEndpointNewParams struct {
	// Indicates whether the endpoint is enabled.
	//
	// Any of "disabled", "enabled".
	Status WebhookEndpointNewParamsStatus `json:"status,omitzero" api:"required"`
	// The HTTPS URL where webhook events will be sent.
	URL string `json:"url" api:"required"`
	// An array of event types that this endpoint should receive notifications for.
	Subscriptions []WebhookEndpointNewParamsSubscription `json:"subscriptions,omitzero"`
	// contains filtered or unexported fields
}

func (WebhookEndpointNewParams) MarshalJSON

func (r WebhookEndpointNewParams) MarshalJSON() (data []byte, err error)

func (*WebhookEndpointNewParams) UnmarshalJSON

func (r *WebhookEndpointNewParams) UnmarshalJSON(data []byte) error

type WebhookEndpointNewParamsStatus

type WebhookEndpointNewParamsStatus string

Indicates whether the endpoint is enabled.

const (
	WebhookEndpointNewParamsStatusDisabled WebhookEndpointNewParamsStatus = "disabled"
	WebhookEndpointNewParamsStatusEnabled  WebhookEndpointNewParamsStatus = "enabled"
)

type WebhookEndpointNewParamsSubscription

type WebhookEndpointNewParamsSubscription struct {
	// The type of event that will trigger notifications to the endpoint (e.g.,
	// `activity/item_created`).
	//
	// Any of "activity/call_occurred", "activity/form_submitted",
	// "activity/inbox_message_sent", "activity/item_created",
	// "activity/item_mentioned", "activity/item_merged", "activity/file_created",
	// "activity/meeting_held", "activity/meeting_scheduled", "activity/note_created",
	// "activity/program_message_bounced", "activity/program_message_clicked",
	// "activity/program_message_complained", "activity/program_message_failed",
	// "activity/program_message_opened", "activity/program_message_sent",
	// "activity/program_message_shielded", "activity/program_message_unsubscribed".
	EventType string `json:"event_type,omitzero" api:"required"`
	// contains filtered or unexported fields
}

Parameters for creating a webhook subscription.

The property EventType is required.

func (WebhookEndpointNewParamsSubscription) MarshalJSON

func (r WebhookEndpointNewParamsSubscription) MarshalJSON() (data []byte, err error)

func (*WebhookEndpointNewParamsSubscription) UnmarshalJSON

func (r *WebhookEndpointNewParamsSubscription) UnmarshalJSON(data []byte) error

type WebhookEndpointService

type WebhookEndpointService struct {
	Options []option.RequestOption
}

WebhookEndpointService contains methods and other services that help with interacting with the Moonbase API.

Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewWebhookEndpointService method instead.

func NewWebhookEndpointService

func NewWebhookEndpointService(opts ...option.RequestOption) (r WebhookEndpointService)

NewWebhookEndpointService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.

func (*WebhookEndpointService) Delete

func (r *WebhookEndpointService) Delete(ctx context.Context, id string, opts ...option.RequestOption) (err error)

Permanently deletes an endpoint.

func (*WebhookEndpointService) Get

func (r *WebhookEndpointService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *Endpoint, err error)

Retrieves the details of an existing endpoint.

func (*WebhookEndpointService) List

Returns a list of endpoints.

func (*WebhookEndpointService) ListAutoPaging

Returns a list of endpoints.

func (*WebhookEndpointService) New

Create a new endpoint.

func (*WebhookEndpointService) Update

Updates an endpoint.

type WebhookEndpointUpdateParams

type WebhookEndpointUpdateParams struct {
	// The HTTPS URL where webhook events will be sent.
	URL param.Opt[string] `json:"url,omitzero"`
	// Indicates whether the endpoint is enabled.
	//
	// Any of "disabled", "enabled".
	Status WebhookEndpointUpdateParamsStatus `json:"status,omitzero"`
	// An array of event types that this endpoint should receive notifications for.
	Subscriptions []WebhookEndpointUpdateParamsSubscription `json:"subscriptions,omitzero"`
	// contains filtered or unexported fields
}

func (WebhookEndpointUpdateParams) MarshalJSON

func (r WebhookEndpointUpdateParams) MarshalJSON() (data []byte, err error)

func (*WebhookEndpointUpdateParams) UnmarshalJSON

func (r *WebhookEndpointUpdateParams) UnmarshalJSON(data []byte) error

type WebhookEndpointUpdateParamsStatus

type WebhookEndpointUpdateParamsStatus string

Indicates whether the endpoint is enabled.

const (
	WebhookEndpointUpdateParamsStatusDisabled WebhookEndpointUpdateParamsStatus = "disabled"
	WebhookEndpointUpdateParamsStatusEnabled  WebhookEndpointUpdateParamsStatus = "enabled"
)

type WebhookEndpointUpdateParamsSubscription

type WebhookEndpointUpdateParamsSubscription struct {
	// The type of event that will trigger notifications to the endpoint (e.g.,
	// `activity/item_created`).
	//
	// Any of "activity/call_occurred", "activity/form_submitted",
	// "activity/inbox_message_sent", "activity/item_created",
	// "activity/item_mentioned", "activity/item_merged", "activity/file_created",
	// "activity/meeting_held", "activity/meeting_scheduled", "activity/note_created",
	// "activity/program_message_bounced", "activity/program_message_clicked",
	// "activity/program_message_complained", "activity/program_message_failed",
	// "activity/program_message_opened", "activity/program_message_sent",
	// "activity/program_message_shielded", "activity/program_message_unsubscribed".
	EventType string `json:"event_type,omitzero" api:"required"`
	// Unique identifier for the object.
	ID param.Opt[string] `json:"id,omitzero"`
	// contains filtered or unexported fields
}

Parameters for updating a webhook subscription.

The property EventType is required.

func (WebhookEndpointUpdateParamsSubscription) MarshalJSON

func (r WebhookEndpointUpdateParamsSubscription) MarshalJSON() (data []byte, err error)

func (*WebhookEndpointUpdateParamsSubscription) UnmarshalJSON

func (r *WebhookEndpointUpdateParamsSubscription) UnmarshalJSON(data []byte) error

Directories

Path Synopsis
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
Package json implements encoding and decoding of JSON as defined in RFC 7159.
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.22, and used by the Go 1.24 encoding/json package.
packages

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL