llamacloudadmin

package module
v0.0.0-...-f375d88 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2026 License: MIT Imports: 20 Imported by: 0

README

Llama Cloud Admin Go API Library

Go Reference

The Llama Cloud Admin Go library provides convenient access to the LlamaCloud organization and project administration REST API — /api/v2/organizations, /api/v2/projects, /api/v2/invites, and the /api/v1/admin/* operator endpoints — from applications written in Go.

This surface is not covered by the product API reference on developers.llamaindex.ai, which documents Parse/Extract/Index and a separate Go SDK (llama-parse-go). See api.md for the full method list.

It is generated with Stainless.

Installation

import (
	"github.com/run-llama/llamacloud-admin-go" // imported as llamacloudadmin
)

To install or update the SDK:

go get github.com/run-llama/llamacloud-admin-go@main

This SDK is distributed from GitHub only. It is not published to a module registry and has no tagged releases, so @main — or an explicit commit SHA — is how you select a version.

Authentication

Authenticate with a LLAMA_CLOUD_API_KEY belonging to an organization admin. On a self-hosted or BYOC deployment, use a key belonging to the deployment's global admin. The client reads it from the environment by default, or accepts it via option.WithAPIKey.

Base URL

The client defaults to https://api.cloud.llamaindex.ai. Self-hosted and BYOC deployments must point it at their own host with option.WithBaseURL, or set LLAMA_CLOUD_ADMIN_BASE_URL.

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/run-llama/llamacloud-admin-go"
	"github.com/run-llama/llamacloud-admin-go/option"
)

func main() {
	client := llamacloudadmin.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("LLAMA_CLOUD_API_KEY")
	)
	organizationMembers, err := client.Organizations.Users.ListMembers(context.TODO(), "my-organization-id")
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", organizationMembers)
}

Request fields

The llamacloudadmin 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, llamacloudadmin.String(string), llamacloudadmin.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 := llamacloudadmin.ExampleParams{
	ID:   "id_xxx",                      // required property
	Name: llamacloudadmin.String("..."), // optional property

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

	Origin: llamacloudadmin.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[llamacloudadmin.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 := llamacloudadmin.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Organizations.List(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.Organizations.ListAutoPaging(context.TODO(), llamacloudadmin.OrganizationListParams{
	PageSize: llamacloudadmin.Int(20),
})
// Automatically fetches more pages as needed.
for iter.Next() {
	organization := iter.Current()
	fmt.Printf("%+v\n", organization)
}
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.:

page, err := client.Organizations.List(context.TODO(), llamacloudadmin.OrganizationListParams{
	PageSize: llamacloudadmin.Int(20),
})
for page != nil {
	for _, organization := range page.Items {
		fmt.Printf("%+v\n", organization)
	}
	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 *llamacloudadmin.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.Organizations.List(context.TODO(), llamacloudadmin.OrganizationListParams{})
if err != nil {
	var apierr *llamacloudadmin.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 "/api/v2/organizations": 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.Organizations.List(
	ctx,
	llamacloudadmin.OrganizationListParams{},
	// 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 llamacloudadmin.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.

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 := llamacloudadmin.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Organizations.List(
	context.TODO(),
	llamacloudadmin.OrganizationListParams{},
	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
page, err := client.Organizations.List(
	context.TODO(),
	llamacloudadmin.OrganizationListParams{},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", page)

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.WithQuery() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: llamacloudadmin.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, end.Sub(start))

    return res, err
}

client := llamacloudadmin.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.

Versioning

This SDK is distributed from this GitHub repository only. It is not published to a module registry and has no tags, releases, or changelog. Pin to a specific commit SHA for a reproducible build:

go get github.com/run-llama/llamacloud-admin-go@<commit-sha>

The method surface tracks the LlamaCloud admin API and may change between commits.

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

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

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 (LLAMA_CLOUD_API_KEY, LLAMA_CLOUD_ADMIN_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 AdminGetFilestoresInfoResponse

type AdminGetFilestoresInfoResponse struct {
	// Any of "missing_buckets", "missing_credentials", "ok".
	Status             AdminGetFilestoresInfoResponseStatus `json:"status" api:"required"`
	AvailableBuckets   map[string]string                    `json:"available_buckets"`
	UnavailableBuckets map[string]string                    `json:"unavailable_buckets"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status             respjson.Field
		AvailableBuckets   respjson.Field
		UnavailableBuckets respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AdminGetFilestoresInfoResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AdminGetFilestoresInfoResponse) UnmarshalJSON

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

type AdminGetFilestoresInfoResponseStatus

type AdminGetFilestoresInfoResponseStatus string
const (
	AdminGetFilestoresInfoResponseStatusMissingBuckets     AdminGetFilestoresInfoResponseStatus = "missing_buckets"
	AdminGetFilestoresInfoResponseStatusMissingCredentials AdminGetFilestoresInfoResponseStatus = "missing_credentials"
	AdminGetFilestoresInfoResponseStatusOk                 AdminGetFilestoresInfoResponseStatus = "ok"
)

type AdminGetLicenseInfoParams

type AdminGetLicenseInfoParams struct {
	// Whether to include scopes in the response
	IncludeScopes param.Opt[bool] `query:"include_scopes,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AdminGetLicenseInfoParams) URLQuery

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

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

type AdminGetLicenseInfoResponse

type AdminGetLicenseInfoResponse struct {
	// License expiration date
	ExpiresAt time.Time `json:"expires_at" api:"required" format:"date-time"`
	// License validation status
	Status string `json:"status" api:"required"`
	// License message
	Message string `json:"message" api:"nullable"`
	// License scopes
	Scopes []string `json:"scopes" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt   respjson.Field
		Status      respjson.Field
		Message     respjson.Field
		Scopes      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AdminGetLicenseInfoResponse) RawJSON

func (r AdminGetLicenseInfoResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AdminGetLicenseInfoResponse) UnmarshalJSON

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

type AdminGetLlamaextractFeaturesResponse

type AdminGetLlamaextractFeaturesResponse struct {
	AvailableModes   []AdminGetLlamaextractFeaturesResponseAvailableMode  `json:"available_modes" api:"required"`
	SchemaGeneration AdminGetLlamaextractFeaturesResponseSchemaGeneration `json:"schema_generation" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AvailableModes   respjson.Field
		SchemaGeneration respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AdminGetLlamaextractFeaturesResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AdminGetLlamaextractFeaturesResponse) UnmarshalJSON

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

type AdminGetLlamaextractFeaturesResponseAvailableMode

type AdminGetLlamaextractFeaturesResponseAvailableMode struct {
	Mode      string `json:"mode" api:"required"`
	ParseMode string `json:"parse_mode" api:"required"`
	// Any of "available", "unavailable".
	Status                 string   `json:"status" api:"required"`
	AvailableExtractModels []string `json:"available_extract_models"`
	AvailableParseModels   []string `json:"available_parse_models"`
	MissingExtractModels   []string `json:"missing_extract_models"`
	MissingParseModels     []string `json:"missing_parse_models"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Mode                   respjson.Field
		ParseMode              respjson.Field
		Status                 respjson.Field
		AvailableExtractModels respjson.Field
		AvailableParseModels   respjson.Field
		MissingExtractModels   respjson.Field
		MissingParseModels     respjson.Field
		ExtraFields            map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AdminGetLlamaextractFeaturesResponseAvailableMode) RawJSON

Returns the unmodified JSON received from the API

func (*AdminGetLlamaextractFeaturesResponseAvailableMode) UnmarshalJSON

type AdminGetLlamaextractFeaturesResponseSchemaGeneration

type AdminGetLlamaextractFeaturesResponseSchemaGeneration struct {
	Model string `json:"model" api:"required"`
	// Any of "available", "unavailable".
	Status string `json:"status" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Model       respjson.Field
		Status      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AdminGetLlamaextractFeaturesResponseSchemaGeneration) RawJSON

Returns the unmodified JSON received from the API

func (*AdminGetLlamaextractFeaturesResponseSchemaGeneration) UnmarshalJSON

type AdminGetLlmsInfoResponse

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

func (AdminGetLlmsInfoResponse) RawJSON

func (r AdminGetLlmsInfoResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AdminGetLlmsInfoResponse) UnmarshalJSON

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

type AdminGetLlmsInfoResponseLlmInfo

type AdminGetLlmsInfoResponseLlmInfo struct {
	InternalModelName string    `json:"internal_model_name" api:"required"`
	Valid             bool      `json:"valid" api:"required"`
	ErrorMessage      string    `json:"error_message" api:"nullable"`
	LastValidated     time.Time `json:"last_validated" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		InternalModelName respjson.Field
		Valid             respjson.Field
		ErrorMessage      respjson.Field
		LastValidated     respjson.Field
		ExtraFields       map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (AdminGetLlmsInfoResponseLlmInfo) RawJSON

Returns the unmodified JSON received from the API

func (*AdminGetLlmsInfoResponseLlmInfo) UnmarshalJSON

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

type AdminGetOcrStatusResponse

type AdminGetOcrStatusResponse struct {
	// Any of "degraded", "ok", "unavailable".
	Status         AdminGetOcrStatusResponseStatus `json:"status" api:"required"`
	Device         string                          `json:"device"`
	ErrorMessage   string                          `json:"error_message" api:"nullable"`
	GPUAvailable   bool                            `json:"gpu_available"`
	GPUDeviceCount int64                           `json:"gpu_device_count" api:"nullable"`
	GPUDeviceName  string                          `json:"gpu_device_name" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Status         respjson.Field
		Device         respjson.Field
		ErrorMessage   respjson.Field
		GPUAvailable   respjson.Field
		GPUDeviceCount respjson.Field
		GPUDeviceName  respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response model for OCR service health/GPU status.

func (AdminGetOcrStatusResponse) RawJSON

func (r AdminGetOcrStatusResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*AdminGetOcrStatusResponse) UnmarshalJSON

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

type AdminGetOcrStatusResponseStatus

type AdminGetOcrStatusResponseStatus string
const (
	AdminGetOcrStatusResponseStatusDegraded    AdminGetOcrStatusResponseStatus = "degraded"
	AdminGetOcrStatusResponseStatusOk          AdminGetOcrStatusResponseStatus = "ok"
	AdminGetOcrStatusResponseStatusUnavailable AdminGetOcrStatusResponseStatus = "unavailable"
)

type AdminService

type AdminService struct {
	Users        AdminUserService
	UsageMetrics AdminUsageMetricService
	// contains filtered or unexported fields
}

AdminService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewAdminService method instead.

func NewAdminService

func NewAdminService(opts ...option.RequestOption) (r AdminService)

NewAdminService 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 (*AdminService) GetFilestoresInfo

func (r *AdminService) GetFilestoresInfo(ctx context.Context, opts ...option.RequestOption) (res *AdminGetFilestoresInfoResponse, err error)

Get File Store Info

func (*AdminService) GetLicenseInfo

Get License Info

func (*AdminService) GetLlamaextractFeatures

func (r *AdminService) GetLlamaextractFeatures(ctx context.Context, opts ...option.RequestOption) (res *AdminGetLlamaextractFeaturesResponse, err error)

Get LlamaExtract feature availability based on available models.

func (*AdminService) GetLlmsInfo

func (r *AdminService) GetLlmsInfo(ctx context.Context, opts ...option.RequestOption) (res *AdminGetLlmsInfoResponse, err error)

Get Llm Info

func (*AdminService) GetOcrStatus

func (r *AdminService) GetOcrStatus(ctx context.Context, opts ...option.RequestOption) (res *AdminGetOcrStatusResponse, err error)

Get OCR service health status including GPU availability.

type AdminUsageMetricAggregateParams

type AdminUsageMetricAggregateParams struct {
	// Inclusive lower bound on the day (YYYY-MM-DD, UTC)
	DayOnOrAfter string `query:"day_on_or_after" api:"required" json:"-"`
	// Inclusive upper bound on the day (YYYY-MM-DD, UTC)
	DayOnOrBefore string `query:"day_on_or_before" api:"required" json:"-"`
	// Dimensions to group by: day, organization_id, project_id, event_type, user_id
	GroupBy []string `query:"group_by,omitzero" api:"required" json:"-"`
	// Filter by organization ID
	OrganizationID param.Opt[string] `query:"organization_id,omitzero" json:"-"`
	// Filter by project ID
	ProjectID param.Opt[string] `query:"project_id,omitzero" json:"-"`
	// Filter by user ID
	UserID param.Opt[string] `query:"user_id,omitzero" json:"-"`
	// Filter by event types
	//
	// Any of "audio_seconds_parsed", "chart_parsing_agentic",
	// "chart_parsing_efficient", "chart_parsing_plus", "chat_message_sent",
	// "confidence_score_high", "directory_count_snapshot",
	// "directory_file_count_snapshot", "directory_files_exported",
	// "directory_files_ingested", "directory_pages_exported", "extraction_num_pages",
	// "form_parsing_pages", "image_classified", "index_retrieve_query",
	// "layout_aware_chart_extraction", "layout_aware_parsing", "layout_extracted",
	// "pages_classified", "pages_embedded", "pages_indexed", "pages_parsed",
	// "pages_split", "pages_verified", "precise_bbox_extraction", "set_total_indexes",
	// "set_total_pages_indexed", "spreadsheet_regions_extracted", "stored_file_count",
	// "stored_file_mb".
	EventTypes []string `query:"event_types,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (AdminUsageMetricAggregateParams) URLQuery

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

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

type AdminUsageMetricAggregateResponse

type AdminUsageMetricAggregateResponse struct {
	// The aggregation buckets, ordered by total credits descending
	Buckets []AdminUsageMetricAggregateResponseBucket `json:"buckets" api:"required"`
	// The dimensions the metrics were grouped by
	//
	// Any of "day", "event_type", "organization_id", "project_id", "user_id".
	GroupBy []string `json:"group_by" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Buckets     respjson.Field
		GroupBy     respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response containing usage metrics aggregated by one or more dimensions.

func (AdminUsageMetricAggregateResponse) RawJSON

Returns the unmodified JSON received from the API

func (*AdminUsageMetricAggregateResponse) UnmarshalJSON

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

type AdminUsageMetricAggregateResponseBucket

type AdminUsageMetricAggregateResponseBucket struct {
	// The dimension values that define this bucket
	Dimensions map[string]string `json:"dimensions" api:"required"`
	// Number of metric rows in this bucket
	MetricCount int64 `json:"metric_count" api:"required"`
	// Total credits consumed by metrics in this bucket
	TotalCredits AdminUsageMetricAggregateResponseBucketTotalCreditsUnion `json:"total_credits" api:"required"`
	// Total of the metric `value` field in this bucket
	TotalValue int64 `json:"total_value" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Dimensions   respjson.Field
		MetricCount  respjson.Field
		TotalCredits respjson.Field
		TotalValue   respjson.Field
		ExtraFields  map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A single aggregation bucket grouped by the requested dimensions.

func (AdminUsageMetricAggregateResponseBucket) RawJSON

Returns the unmodified JSON received from the API

func (*AdminUsageMetricAggregateResponseBucket) UnmarshalJSON

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

type AdminUsageMetricAggregateResponseBucketTotalCreditsUnion

type AdminUsageMetricAggregateResponseBucketTotalCreditsUnion 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.
	OfString string `json:",inline"`
	JSON     struct {
		OfFloat  respjson.Field
		OfString respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

AdminUsageMetricAggregateResponseBucketTotalCreditsUnion 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 OfString]

func (AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) AsFloat

func (AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) AsString

func (AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) RawJSON

Returns the unmodified JSON received from the API

func (*AdminUsageMetricAggregateResponseBucketTotalCreditsUnion) UnmarshalJSON

type AdminUsageMetricService

type AdminUsageMetricService struct {
	// contains filtered or unexported fields
}

AdminUsageMetricService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewAdminUsageMetricService method instead.

func NewAdminUsageMetricService

func NewAdminUsageMetricService(opts ...option.RequestOption) (r AdminUsageMetricService)

NewAdminUsageMetricService 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 (*AdminUsageMetricService) Aggregate

Aggregate usage metrics by one or more dimensions, reporting total credits used. Global admin only.

A date range is required, which bounds the scan via the `day`-leading index. Supplying `organization_id` narrows it further via the `(organization_id, day)` index.

Supported `group_by` dimensions: `day`, `organization_id`, `project_id`, `event_type`, `user_id`. Buckets are ordered by total credits descending.

type AdminUserService

type AdminUserService struct {
	// contains filtered or unexported fields
}

AdminUserService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewAdminUserService method instead.

func NewAdminUserService

func NewAdminUserService(opts ...option.RequestOption) (r AdminUserService)

NewAdminUserService 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 (*AdminUserService) GetClaims

func (r *AdminUserService) GetClaims(ctx context.Context, userID string, opts ...option.RequestOption) (res *UserClaims, err error)

Get a user's resolved custom claims.

Claims that have not been explicitly set fall back to their system default. Returns 404 if the user does not exist.

Global admin only.

func (*AdminUserService) UpdateClaims

func (r *AdminUserService) UpdateClaims(ctx context.Context, userID string, body AdminUserUpdateClaimsParams, opts ...option.RequestOption) (res *UserClaims, err error)

Additively update a user's custom claims.

Claims in `set_claims` are added or overwritten; claims named in `remove_claims` are reset to their system default. Claims not referenced by either field are left unchanged, so a single claim can be changed without resending the full set. Returns the user's resolved claims after the update.

Returns 404 if the user does not exist.

Global admin only.

type AdminUserUpdateClaimsParams

type AdminUserUpdateClaimsParams struct {
	// Names of claims to reset to their system default.
	//
	// Any of "allow_org_deletion", "allowed_org_creation", "api_datasource_access",
	// "maximum_org_creation".
	RemoveClaims []string `json:"remove_claims,omitzero"`
	// A partial set of custom claims for additive updates.
	//
	// Every field is optional. Only the claims explicitly provided in a request are
	// added or overwritten; claims left unset are not touched, so callers can change a
	// single claim without resending the full claim set.
	SetClaims AdminUserUpdateClaimsParamsSetClaims `json:"set_claims,omitzero"`
	// contains filtered or unexported fields
}

func (AdminUserUpdateClaimsParams) MarshalJSON

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

func (*AdminUserUpdateClaimsParams) UnmarshalJSON

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

type AdminUserUpdateClaimsParamsSetClaims

type AdminUserUpdateClaimsParamsSetClaims struct {
	// Whether the user is allowed to delete organizations.
	AllowOrgDeletion param.Opt[bool] `json:"allow_org_deletion,omitzero"`
	// Whether the user is allowed to create organizations.
	AllowedOrgCreation param.Opt[bool] `json:"allowed_org_creation,omitzero"`
	// Whether the user is allowed to access API data sources.
	APIDatasourceAccess param.Opt[bool] `json:"api_datasource_access,omitzero"`
	// Cap on how many organizations this user may create. None means unlimited. Only
	// enforced when allowed_org_creation is True.
	MaximumOrgCreation param.Opt[int64] `json:"maximum_org_creation,omitzero"`
	// contains filtered or unexported fields
}

A partial set of custom claims for additive updates.

Every field is optional. Only the claims explicitly provided in a request are added or overwritten; claims left unset are not touched, so callers can change a single claim without resending the full claim set.

func (AdminUserUpdateClaimsParamsSetClaims) MarshalJSON

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

func (*AdminUserUpdateClaimsParamsSetClaims) UnmarshalJSON

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

type Client

type Client struct {
	Organizations OrganizationService
	Projects      ProjectService
	Invites       InviteService
	Admin         AdminService
	// contains filtered or unexported fields
}

Client creates a struct with services and top level methods that help with interacting with the llama-cloud-admin 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 (LLAMA_CLOUD_API_KEY, LLAMA_CLOUD_ADMIN_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.

type CustomClaims

type CustomClaims struct {
	// Whether the user is allowed to delete organizations.
	AllowOrgDeletion bool `json:"allow_org_deletion"`
	// Whether the user is allowed to create organizations.
	AllowedOrgCreation bool `json:"allowed_org_creation"`
	// Whether the user is allowed to access API data sources.
	APIDatasourceAccess bool `json:"api_datasource_access"`
	// Cap on how many organizations this user may create. None means unlimited. Only
	// enforced when allowed_org_creation is True.
	MaximumOrgCreation int64 `json:"maximum_org_creation" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowOrgDeletion    respjson.Field
		AllowedOrgCreation  respjson.Field
		APIDatasourceAccess respjson.Field
		MaximumOrgCreation  respjson.Field
		ExtraFields         map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Custom claims that dictate various limits or allowed behaviors. Currently these claims reside at a per user level. Claims may expand to a per organization level or project in the future.

func (CustomClaims) RawJSON

func (r CustomClaims) RawJSON() string

Returns the unmodified JSON received from the API

func (*CustomClaims) UnmarshalJSON

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

type Error

type Error = apierror.Error

type Invite

type Invite struct {
	// The invite's unique identifier.
	ID string `json:"id" api:"required"`
	// The organization the user is invited to.
	OrganizationID string `json:"organization_id" api:"required"`
	// The organization's display name.
	OrganizationName string `json:"organization_name" api:"required"`
	// The role being granted (e.g. admin, viewer).
	Role string `json:"role" api:"required"`
	// Creation datetime
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Update datetime
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID               respjson.Field
		OrganizationID   respjson.Field
		OrganizationName respjson.Field
		Role             respjson.Field
		CreatedAt        respjson.Field
		UpdatedAt        respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A pending invitation visible to the invitee.

func (Invite) RawJSON

func (r Invite) RawJSON() string

Returns the unmodified JSON received from the API

func (*Invite) UnmarshalJSON

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

type InviteAcceptResponse

type InviteAcceptResponse struct {
	// The organization the user just joined.
	OrganizationID string `json:"organization_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		OrganizationID respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Response for accepting an invitation.

func (InviteAcceptResponse) RawJSON

func (r InviteAcceptResponse) RawJSON() string

Returns the unmodified JSON received from the API

func (*InviteAcceptResponse) UnmarshalJSON

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

type InviteListMineParams

type InviteListMineParams struct {
	PageSize  param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (InviteListMineParams) URLQuery

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

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

type InviteService

type InviteService struct {
	// contains filtered or unexported fields
}

InviteService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewInviteService method instead.

func NewInviteService

func NewInviteService(opts ...option.RequestOption) (r InviteService)

NewInviteService 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 (*InviteService) Accept

func (r *InviteService) Accept(ctx context.Context, inviteID string, opts ...option.RequestOption) (res *InviteAcceptResponse, err error)

Accept a pending invitation. Returns the joined organization id.

func (*InviteService) Decline

func (r *InviteService) Decline(ctx context.Context, inviteID string, opts ...option.RequestOption) (err error)

Decline a pending invitation.

func (*InviteService) ListMine

List the current user's pending invitations, cursor-paginated.

func (*InviteService) ListMineAutoPaging

List the current user's pending invitations, cursor-paginated.

type Organization

type Organization struct {
	// The organization's unique identifier.
	ID string `json:"id" api:"required"`
	// The organization's display name.
	Name string `json:"name" api:"required"`
	// Creation datetime
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Additional organization metadata.
	Metadata map[string]any `json:"metadata"`
	// Update datetime
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		CreatedAt   respjson.Field
		Metadata    respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API response schema for an organization.

func (Organization) RawJSON

func (r Organization) RawJSON() string

Returns the unmodified JSON received from the API

func (*Organization) UnmarshalJSON

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

type OrganizationGetUsageParams

type OrganizationGetUsageParams struct {
	GetCurrentInvoiceTotal param.Opt[bool] `query:"get_current_invoice_total,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (OrganizationGetUsageParams) URLQuery

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

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

type OrganizationListParams

type OrganizationListParams struct {
	Name      param.Opt[string] `query:"name,omitzero" json:"-"`
	PageSize  param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	PageToken param.Opt[string] `query:"page_token,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (OrganizationListParams) URLQuery

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

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

type OrganizationMember

type OrganizationMember struct {
	// Unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// The organization's ID.
	OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
	// The roles of the user in the organization.
	Roles []UserOrganizationRole `json:"roles" api:"required"`
	// Creation datetime
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// The user's email address.
	Email string `json:"email" api:"nullable" format:"email"`
	// The email address of the user who added the user to the organization.
	//
	// Deprecated: deprecated
	InvitedByUserEmail string `json:"invited_by_user_email" api:"nullable" format:"email"`
	// The user ID of the user who added the user to the organization.
	InvitedByUserID string `json:"invited_by_user_id" api:"nullable"`
	// Whether the user's membership is pending account signup.
	Pending bool `json:"pending"`
	// Update datetime
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// The user's ID.
	UserID string `json:"user_id" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID                 respjson.Field
		OrganizationID     respjson.Field
		Roles              respjson.Field
		CreatedAt          respjson.Field
		Email              respjson.Field
		InvitedByUserEmail respjson.Field
		InvitedByUserID    respjson.Field
		Pending            respjson.Field
		UpdatedAt          respjson.Field
		UserID             respjson.Field
		ExtraFields        map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A user's membership in an organization, including roles.

func (OrganizationMember) RawJSON

func (r OrganizationMember) RawJSON() string

Returns the unmodified JSON received from the API

func (*OrganizationMember) UnmarshalJSON

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

type OrganizationNewParams

type OrganizationNewParams struct {
	// The organization's display name.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

func (OrganizationNewParams) MarshalJSON

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

func (*OrganizationNewParams) UnmarshalJSON

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

type OrganizationRoleService

type OrganizationRoleService struct {
	// contains filtered or unexported fields
}

OrganizationRoleService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewOrganizationRoleService method instead.

func NewOrganizationRoleService

func NewOrganizationRoleService(opts ...option.RequestOption) (r OrganizationRoleService)

NewOrganizationRoleService 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 (*OrganizationRoleService) List

func (r *OrganizationRoleService) List(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *[]Role, err error)

List all roles in an organization.

type OrganizationService

type OrganizationService struct {
	Users OrganizationUserService
	Roles OrganizationRoleService
	// contains filtered or unexported fields
}

OrganizationService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewOrganizationService method instead.

func NewOrganizationService

func NewOrganizationService(opts ...option.RequestOption) (r OrganizationService)

NewOrganizationService 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 (*OrganizationService) Delete

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

Delete an organization by ID.

func (*OrganizationService) Get

func (r *OrganizationService) Get(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *Organization, err error)

Get an organization by ID.

func (*OrganizationService) GetUsage

func (r *OrganizationService) GetUsage(ctx context.Context, organizationID string, query OrganizationGetUsageParams, opts ...option.RequestOption) (res *UsageAndPlan, err error)

Get usage for a specific organization.

func (*OrganizationService) List

List organizations the current user can access.

func (*OrganizationService) ListAutoPaging

List organizations the current user can access.

func (*OrganizationService) New

Create a new organization.

func (*OrganizationService) Update

func (r *OrganizationService) Update(ctx context.Context, organizationID string, body OrganizationUpdateParams, opts ...option.RequestOption) (res *Organization, err error)

Update an existing organization.

type OrganizationUpdateParams

type OrganizationUpdateParams struct {
	// The organization's new display name.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

func (OrganizationUpdateParams) MarshalJSON

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

func (*OrganizationUpdateParams) UnmarshalJSON

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

type OrganizationUserAddParams

type OrganizationUserAddParams struct {
	Body []OrganizationUserAddParamsBody
	// contains filtered or unexported fields
}

func (OrganizationUserAddParams) MarshalJSON

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

func (*OrganizationUserAddParams) UnmarshalJSON

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

type OrganizationUserAddParamsBody

type OrganizationUserAddParamsBody struct {
	// The project IDs to add the user to.
	ProjectIDs []string `json:"project_ids,omitzero" api:"required" format:"uuid"`
	// The user's email address.
	Email param.Opt[string] `json:"email,omitzero" format:"email"`
	// The role ID to assign to the user.
	RoleID param.Opt[string] `json:"role_id,omitzero" format:"uuid"`
	// The user's ID.
	UserID param.Opt[string] `json:"user_id,omitzero"`
	// contains filtered or unexported fields
}

Request to add a user to an organization.

The property ProjectIDs is required.

func (OrganizationUserAddParamsBody) MarshalJSON

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

func (*OrganizationUserAddParamsBody) UnmarshalJSON

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

type OrganizationUserAddToProjectParams

type OrganizationUserAddToProjectParams struct {
	OrganizationID string            `path:"organization_id" api:"required" format:"uuid" json:"-"`
	ProjectID      param.Opt[string] `query:"project_id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (OrganizationUserAddToProjectParams) URLQuery

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

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

type OrganizationUserAddToProjectResponse

type OrganizationUserAddToProjectResponse = any

type OrganizationUserAssignRoleParams

type OrganizationUserAssignRoleParams struct {
	// The organization's ID.
	OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
	// The role's ID.
	RoleID string `json:"role_id" api:"required" format:"uuid"`
	// The user's ID.
	UserID string `json:"user_id" api:"required"`
	// contains filtered or unexported fields
}

func (OrganizationUserAssignRoleParams) MarshalJSON

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

func (*OrganizationUserAssignRoleParams) UnmarshalJSON

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

type OrganizationUserDeleteParams

type OrganizationUserDeleteParams struct {
	OrganizationID string `path:"organization_id" api:"required" format:"uuid" json:"-"`
	Body           []string
	// contains filtered or unexported fields
}

func (OrganizationUserDeleteParams) MarshalJSON

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

func (*OrganizationUserDeleteParams) UnmarshalJSON

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

type OrganizationUserListProjectsParams

type OrganizationUserListProjectsParams struct {
	OrganizationID string `path:"organization_id" api:"required" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

type OrganizationUserListProjectsResponse

type OrganizationUserListProjectsResponse struct {
	// Unique identifier
	ID   string `json:"id" api:"required" format:"uuid"`
	Name string `json:"name" api:"required"`
	// The Organization ID the project is under.
	OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
	// Creation datetime
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Whether this project is the default project for the user.
	IsDefault bool `json:"is_default"`
	// Update datetime
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Name           respjson.Field
		OrganizationID respjson.Field
		CreatedAt      respjson.Field
		IsDefault      respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Schema for a project.

func (OrganizationUserListProjectsResponse) RawJSON

Returns the unmodified JSON received from the API

func (*OrganizationUserListProjectsResponse) UnmarshalJSON

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

type OrganizationUserRemoveFromProjectParams

type OrganizationUserRemoveFromProjectParams struct {
	OrganizationID string `path:"organization_id" api:"required" format:"uuid" json:"-"`
	UserID         string `path:"user_id" api:"required" json:"-"`
	// contains filtered or unexported fields
}

type OrganizationUserRemoveFromProjectResponse

type OrganizationUserRemoveFromProjectResponse = any

type OrganizationUserService

type OrganizationUserService struct {
	// contains filtered or unexported fields
}

OrganizationUserService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewOrganizationUserService method instead.

func NewOrganizationUserService

func NewOrganizationUserService(opts ...option.RequestOption) (r OrganizationUserService)

NewOrganizationUserService 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 (*OrganizationUserService) Add

func (r *OrganizationUserService) Add(ctx context.Context, organizationID string, body OrganizationUserAddParams, opts ...option.RequestOption) (res *[]OrganizationMember, err error)

Add a user to an organization.

func (*OrganizationUserService) AddToProject

Add a user to a project.

func (*OrganizationUserService) AssignRole

Assign a role to a user in an organization.

func (*OrganizationUserService) Delete

func (r *OrganizationUserService) Delete(ctx context.Context, memberUserID string, params OrganizationUserDeleteParams, opts ...option.RequestOption) (err error)

Remove users from an organization.

func (*OrganizationUserService) ListMembers

func (r *OrganizationUserService) ListMembers(ctx context.Context, organizationID string, opts ...option.RequestOption) (res *[]OrganizationMember, err error)

Get all users in an organization.

func (*OrganizationUserService) ListProjects

List all projects for a user in an organization.

func (*OrganizationUserService) RemoveFromProject

Remove a user from a project.

type Project

type Project struct {
	// The project's unique identifier.
	ID string `json:"id" api:"required"`
	// The project's display name.
	Name string `json:"name" api:"required"`
	// The organization the project belongs to.
	OrganizationID string `json:"organization_id" api:"required"`
	// Creation datetime
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Whether this project is the default project for its organization.
	IsDefault bool `json:"is_default"`
	// Update datetime
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		Name           respjson.Field
		OrganizationID respjson.Field
		CreatedAt      respjson.Field
		IsDefault      respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

API response schema for a project.

func (Project) RawJSON

func (r Project) RawJSON() string

Returns the unmodified JSON received from the API

func (*Project) UnmarshalJSON

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

type ProjectDeleteParams

type ProjectDeleteParams struct {
	OrganizationID param.Opt[string] `query:"organization_id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ProjectDeleteParams) URLQuery

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

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

type ProjectGetParams

type ProjectGetParams struct {
	OrganizationID param.Opt[string] `query:"organization_id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ProjectGetParams) URLQuery

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

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

type ProjectListParams

type ProjectListParams struct {
	Name           param.Opt[string] `query:"name,omitzero" json:"-"`
	OrganizationID param.Opt[string] `query:"organization_id,omitzero" json:"-"`
	PageSize       param.Opt[int64]  `query:"page_size,omitzero" json:"-"`
	PageToken      param.Opt[string] `query:"page_token,omitzero" json:"-"`
	// contains filtered or unexported fields
}

func (ProjectListParams) URLQuery

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

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

type ProjectNewParams

type ProjectNewParams struct {
	OrganizationID string `query:"organization_id" api:"required" format:"uuid" json:"-"`
	// The project's display name.
	Name string `json:"name" api:"required"`
	// contains filtered or unexported fields
}

func (ProjectNewParams) MarshalJSON

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

func (ProjectNewParams) URLQuery

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

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

func (*ProjectNewParams) UnmarshalJSON

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

type ProjectService

type ProjectService struct {
	// contains filtered or unexported fields
}

ProjectService contains methods and other services that help with interacting with the llama-cloud-admin 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 NewProjectService method instead.

func NewProjectService

func NewProjectService(opts ...option.RequestOption) (r ProjectService)

NewProjectService 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 (*ProjectService) Delete

func (r *ProjectService) Delete(ctx context.Context, projectID string, body ProjectDeleteParams, opts ...option.RequestOption) (err error)

Delete a project by ID.

func (*ProjectService) Get

func (r *ProjectService) Get(ctx context.Context, projectID string, query ProjectGetParams, opts ...option.RequestOption) (res *Project, err error)

Get a project by ID.

func (*ProjectService) List

List projects in an organization. Requires `organization_id` or a project-scoped API key.

func (*ProjectService) ListAutoPaging

List projects in an organization. Requires `organization_id` or a project-scoped API key.

func (*ProjectService) New

func (r *ProjectService) New(ctx context.Context, params ProjectNewParams, opts ...option.RequestOption) (res *Project, err error)

Create a new project in the given organization.

func (*ProjectService) Update

func (r *ProjectService) Update(ctx context.Context, projectID string, params ProjectUpdateParams, opts ...option.RequestOption) (res *Project, err error)

Update an existing project.

type ProjectUpdateParams

type ProjectUpdateParams struct {
	// The project's new display name.
	Name           string            `json:"name" api:"required"`
	OrganizationID param.Opt[string] `query:"organization_id,omitzero" format:"uuid" json:"-"`
	// contains filtered or unexported fields
}

func (ProjectUpdateParams) MarshalJSON

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

func (ProjectUpdateParams) URLQuery

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

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

func (*ProjectUpdateParams) UnmarshalJSON

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

type Role

type Role struct {
	// Unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// A name for the role.
	Name string `json:"name" api:"required"`
	// The actual permissions of the role.
	Permissions []RolePermission `json:"permissions" api:"required"`
	// Creation datetime
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Update datetime
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		Permissions respjson.Field
		CreatedAt   respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Schema for a role.

func (Role) RawJSON

func (r Role) RawJSON() string

Returns the unmodified JSON received from the API

func (*Role) UnmarshalJSON

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

type RolePermission

type RolePermission struct {
	// Unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// Whether the permission is granted or not.
	Access bool `json:"access" api:"required"`
	// A description for the permission.
	Description string `json:"description" api:"required"`
	// A name for the permission.
	Name string `json:"name" api:"required"`
	// Creation datetime
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// Update datetime
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Access      respjson.Field
		Description respjson.Field
		Name        respjson.Field
		CreatedAt   respjson.Field
		UpdatedAt   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Schema for a permission.

func (RolePermission) RawJSON

func (r RolePermission) RawJSON() string

Returns the unmodified JSON received from the API

func (*RolePermission) UnmarshalJSON

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

type UsageAndPlan

type UsageAndPlan struct {
	Plan UsageAndPlanPlan `json:"plan" api:"required"`
	// Account usage totals shown alongside the plan.
	Usage UsageAndPlanUsage `json:"usage" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Plan        respjson.Field
		Usage       respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UsageAndPlan) RawJSON

func (r UsageAndPlan) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsageAndPlan) UnmarshalJSON

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

type UsageAndPlanPlan

type UsageAndPlanPlan struct {
	Limits UsageAndPlanPlanLimits `json:"limits" api:"required"`
	// Any of "enterprise", "enterprise_contract", "enterprise_poc", "free",
	// "free_contract", "free_v1", "free_v2", "llama_parse", "pro", "pro_v1", "pro_v2",
	// "starter_v1", "starter_v2", "unknown", "yc_deal_v1".
	Name string `json:"name" api:"required"`
	// Any of "ANNUAL", "MONTHLY", "QUARTERLY".
	PlanFrequency string `json:"plan_frequency" api:"required"`
	// The ID of the plan in Metronome
	ID string `json:"id" api:"nullable"`
	// The current billing period
	CurrentBillingPeriod UsageAndPlanPlanCurrentBillingPeriod `json:"current_billing_period" api:"nullable"`
	// The date the plan ends on
	EndingBefore time.Time `json:"ending_before" api:"nullable" format:"date-time"`
	// The number of payment failures for this organization
	FailureCount int64 `json:"failure_count"`
	// Whether the organization has a failed payment that requires support contact
	IsPaymentFailed  bool                              `json:"is_payment_failed"`
	RecurringCredits []UsageAndPlanPlanRecurringCredit `json:"recurring_credits" api:"nullable"`
	// The date the plan starts on
	StartingOn time.Time `json:"starting_on" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Limits               respjson.Field
		Name                 respjson.Field
		PlanFrequency        respjson.Field
		ID                   respjson.Field
		CurrentBillingPeriod respjson.Field
		EndingBefore         respjson.Field
		FailureCount         respjson.Field
		IsPaymentFailed      respjson.Field
		RecurringCredits     respjson.Field
		StartingOn           respjson.Field
		ExtraFields          map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UsageAndPlanPlan) RawJSON

func (r UsageAndPlanPlan) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsageAndPlanPlan) UnmarshalJSON

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

type UsageAndPlanPlanCurrentBillingPeriod

type UsageAndPlanPlanCurrentBillingPeriod struct {
	EndDate   time.Time `json:"end_date" api:"required" format:"date-time"`
	StartDate time.Time `json:"start_date" api:"required" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		EndDate     respjson.Field
		StartDate   respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

The current billing period

func (UsageAndPlanPlanCurrentBillingPeriod) RawJSON

Returns the unmodified JSON received from the API

func (*UsageAndPlanPlanCurrentBillingPeriod) UnmarshalJSON

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

type UsageAndPlanPlanLimits

type UsageAndPlanPlanLimits struct {
	// Whether usage is allowed after credit grants are exhausted
	AllowPayAsYouGo               bool  `json:"allow_pay_as_you_go" api:"required"`
	MaxConcurrentIndexJobs        int64 `json:"max_concurrent_index_jobs" api:"required"`
	MaxConcurrentParseJobsOther   int64 `json:"max_concurrent_parse_jobs_other" api:"required"`
	MaxConcurrentParseJobsPremium int64 `json:"max_concurrent_parse_jobs_premium" api:"required"`
	MaxDataSinks                  int64 `json:"max_data_sinks" api:"required"`
	MaxDataSources                int64 `json:"max_data_sources" api:"required"`
	MaxEmbeddingModels            int64 `json:"max_embedding_models" api:"required"`
	MaxExtractionAgents           int64 `json:"max_extraction_agents" api:"required"`
	MaxExtractionJobs             int64 `json:"max_extraction_jobs" api:"required"`
	MaxExtractionRuns             int64 `json:"max_extraction_runs" api:"required"`
	MaxFilesPerIndex              int64 `json:"max_files_per_index" api:"required"`
	MaxIndexes                    int64 `json:"max_indexes" api:"required"`
	MaxMonthlyInvoiceTotalUsd     int64 `json:"max_monthly_invoice_total_usd" api:"required"`
	MaxOrganizations              int64 `json:"max_organizations" api:"required"`
	MaxPagesPerIndex              int64 `json:"max_pages_per_index" api:"required"`
	MaxProjects                   int64 `json:"max_projects" api:"required"`
	MaxPublishedAgents            int64 `json:"max_published_agents" api:"required"`
	MaxReportAgentSessions        int64 `json:"max_report_agent_sessions" api:"required"`
	MaxUsers                      int64 `json:"max_users" api:"required"`
	MfaEnabled                    bool  `json:"mfa_enabled" api:"required"`
	SSOEnabled                    bool  `json:"sso_enabled" api:"required"`
	SubscriptionCostUsd           int64 `json:"subscription_cost_usd" api:"required"`
	MaxDirectories                int64 `json:"max_directories" api:"nullable"`
	MaxDirectoryFilesPerDirectory int64 `json:"max_directory_files_per_directory" api:"nullable"`
	MaxDirectoryIngestFiles       int64 `json:"max_directory_ingest_files" api:"nullable"`
	MaxDirectorySyncPlanActions   int64 `json:"max_directory_sync_plan_actions" api:"nullable"`
	// The amount of USD cents at which a soft alert should be triggered
	SpendingSoftAlertsUsdCents []int64 `json:"spending_soft_alerts_usd_cents" api:"nullable"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		AllowPayAsYouGo               respjson.Field
		MaxConcurrentIndexJobs        respjson.Field
		MaxConcurrentParseJobsOther   respjson.Field
		MaxConcurrentParseJobsPremium respjson.Field
		MaxDataSinks                  respjson.Field
		MaxDataSources                respjson.Field
		MaxEmbeddingModels            respjson.Field
		MaxExtractionAgents           respjson.Field
		MaxExtractionJobs             respjson.Field
		MaxExtractionRuns             respjson.Field
		MaxFilesPerIndex              respjson.Field
		MaxIndexes                    respjson.Field
		MaxMonthlyInvoiceTotalUsd     respjson.Field
		MaxOrganizations              respjson.Field
		MaxPagesPerIndex              respjson.Field
		MaxProjects                   respjson.Field
		MaxPublishedAgents            respjson.Field
		MaxReportAgentSessions        respjson.Field
		MaxUsers                      respjson.Field
		MfaEnabled                    respjson.Field
		SSOEnabled                    respjson.Field
		SubscriptionCostUsd           respjson.Field
		MaxDirectories                respjson.Field
		MaxDirectoryFilesPerDirectory respjson.Field
		MaxDirectoryIngestFiles       respjson.Field
		MaxDirectorySyncPlanActions   respjson.Field
		SpendingSoftAlertsUsdCents    respjson.Field
		ExtraFields                   map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UsageAndPlanPlanLimits) RawJSON

func (r UsageAndPlanPlanLimits) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsageAndPlanPlanLimits) UnmarshalJSON

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

type UsageAndPlanPlanRecurringCredit

type UsageAndPlanPlanRecurringCredit struct {
	CreditAmount int64                                     `json:"credit_amount" api:"required"`
	CreditType   UsageAndPlanPlanRecurringCreditCreditType `json:"credit_type" api:"required"`
	Name         string                                    `json:"name" api:"required"`
	Priority     float64                                   `json:"priority" api:"required"`
	// The ID of the product in Metronome used to represent the credit grant
	ProductID string `json:"product_id" api:"required"`
	// The fraction of the credit that will roll over to the next period, between 0 and
	// 1
	RolloverFraction float64 `json:"rollover_fraction" api:"required"`
	// How many billing periods the credit grant will last for
	PeriodsDuration float64 `json:"periods_duration"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		CreditAmount     respjson.Field
		CreditType       respjson.Field
		Name             respjson.Field
		Priority         respjson.Field
		ProductID        respjson.Field
		RolloverFraction respjson.Field
		PeriodsDuration  respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UsageAndPlanPlanRecurringCredit) RawJSON

Returns the unmodified JSON received from the API

func (*UsageAndPlanPlanRecurringCredit) UnmarshalJSON

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

type UsageAndPlanPlanRecurringCreditCreditType

type UsageAndPlanPlanRecurringCreditCreditType struct {
	ID   string `json:"id" api:"required"`
	Name string `json:"name" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID          respjson.Field
		Name        respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UsageAndPlanPlanRecurringCreditCreditType) RawJSON

Returns the unmodified JSON received from the API

func (*UsageAndPlanPlanRecurringCreditCreditType) UnmarshalJSON

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

type UsageAndPlanUsage

type UsageAndPlanUsage struct {
	// Any of "configured_spend_limit_exceeded", "free_credits_exhausted",
	// "has_spending_alert", "internal_spending_alert", "plan_spend_limit_exceeded",
	// "plan_spend_limit_soft_alert".
	ActiveAlerts                []string                                  `json:"active_alerts"`
	ActiveFreeCreditsUsage      []UsageAndPlanUsageActiveFreeCreditsUsage `json:"active_free_credits_usage"`
	CurrentInvoiceTotalUsdCents int64                                     `json:"current_invoice_total_usd_cents" api:"nullable"`
	TotalExtractionAgents       int64                                     `json:"total_extraction_agents"`
	TotalIndexedPages           int64                                     `json:"total_indexed_pages"`
	TotalIndexes                int64                                     `json:"total_indexes"`
	TotalUsers                  int64                                     `json:"total_users"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ActiveAlerts                respjson.Field
		ActiveFreeCreditsUsage      respjson.Field
		CurrentInvoiceTotalUsdCents respjson.Field
		TotalExtractionAgents       respjson.Field
		TotalIndexedPages           respjson.Field
		TotalIndexes                respjson.Field
		TotalUsers                  respjson.Field
		ExtraFields                 map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Account usage totals shown alongside the plan.

func (UsageAndPlanUsage) RawJSON

func (r UsageAndPlanUsage) RawJSON() string

Returns the unmodified JSON received from the API

func (*UsageAndPlanUsage) UnmarshalJSON

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

type UsageAndPlanUsageActiveFreeCreditsUsage

type UsageAndPlanUsageActiveFreeCreditsUsage struct {
	ExpiresAt        time.Time `json:"expires_at" api:"required" format:"date-time"`
	GrantName        string    `json:"grant_name" api:"required"`
	RemainingBalance int64     `json:"remaining_balance" api:"required"`
	StartingBalance  int64     `json:"starting_balance" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ExpiresAt        respjson.Field
		GrantName        respjson.Field
		RemainingBalance respjson.Field
		StartingBalance  respjson.Field
		ExtraFields      map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

func (UsageAndPlanUsageActiveFreeCreditsUsage) RawJSON

Returns the unmodified JSON received from the API

func (*UsageAndPlanUsageActiveFreeCreditsUsage) UnmarshalJSON

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

type UserClaims

type UserClaims struct {
	// The user's resolved custom claims.
	Claims CustomClaims `json:"claims" api:"required"`
	// The user ID the claims belong to.
	UserID string `json:"user_id" api:"required"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		Claims      respjson.Field
		UserID      respjson.Field
		ExtraFields map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

A user's fully resolved custom claims after applying system defaults.

func (UserClaims) RawJSON

func (r UserClaims) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserClaims) UnmarshalJSON

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

type UserOrganizationRole

type UserOrganizationRole struct {
	// Unique identifier
	ID string `json:"id" api:"required" format:"uuid"`
	// The organization's ID.
	OrganizationID string `json:"organization_id" api:"required" format:"uuid"`
	// The role.
	Role Role `json:"role" api:"required"`
	// The user's ID.
	UserID string `json:"user_id" api:"required"`
	// Creation datetime
	CreatedAt time.Time `json:"created_at" api:"nullable" format:"date-time"`
	// The project ID scope.
	ProjectIDs []string `json:"project_ids" api:"nullable" format:"uuid"`
	// Update datetime
	UpdatedAt time.Time `json:"updated_at" api:"nullable" format:"date-time"`
	// JSON contains metadata for fields, check presence with [respjson.Field.Valid].
	JSON struct {
		ID             respjson.Field
		OrganizationID respjson.Field
		Role           respjson.Field
		UserID         respjson.Field
		CreatedAt      respjson.Field
		ProjectIDs     respjson.Field
		UpdatedAt      respjson.Field
		ExtraFields    map[string]respjson.Field
		// contains filtered or unexported fields
	} `json:"-"`
}

Schema for a user's role in an organization.

func (UserOrganizationRole) RawJSON

func (r UserOrganizationRole) RawJSON() string

Returns the unmodified JSON received from the API

func (*UserOrganizationRole) UnmarshalJSON

func (r *UserOrganizationRole) 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
shared

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL