arcadego

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

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

Go to latest
Published: Jun 20, 2025 License: MIT Imports: 15 Imported by: 0

README

Arcade Go API Library

Go Reference

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

It is generated with Stainless.

Installation

import (
	"github.com/ArcadeAI/arcade-go" // imported as arcadego
)

Or to pin the version:

go get -u 'github.com/ArcadeAI/arcade-go@v0.1.0-alpha.4'

Requirements

This library requires Go 1.18+.

Usage

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

package main

import (
	"context"
	"fmt"

	"github.com/ArcadeAI/arcade-go"
	"github.com/ArcadeAI/arcade-go/option"
)

func main() {
	client := arcadego.NewClient(
		option.WithAPIKey("My API Key"), // defaults to os.LookupEnv("ARCADE_API_KEY")
	)
	executeToolResponse, err := client.Tools.Execute(context.TODO(), arcadego.ToolExecuteParams{
		ExecuteToolRequest: arcadego.ExecuteToolRequestParam{
			ToolName: arcadego.F("tool_name"),
		},
	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", executeToolResponse.ID)
}

Request fields

All request parameters are wrapped in a generic Field type, which we use to distinguish zero values from null or omitted fields.

This prevents accidentally sending a zero value if you forget a required parameter, and enables explicitly sending null, false, '', or 0 on optional parameters. Any field not specified is not sent.

To construct fields with values, use the helpers String(), Int(), Float(), or most commonly, the generic F[T](). To send a null, use Null[T](), and to send a nonconforming value, use Raw[T](any). For example:

params := FooParams{
	Name: arcadego.F("hello"),

	// Explicitly send `"description": null`
	Description: arcadego.Null[string](),

	Point: arcadego.F(arcadego.Point{
		X: arcadego.Int(0),
		Y: arcadego.Int(1),

		// In cases where the API specifies a given type,
		// but you want to send something else, use `Raw`:
		Z: arcadego.Raw[int64](0.01), // sends a float
	}),
}
Response objects

All fields in response structs are value types (not pointers or wrappers).

If a given field is null, not present, or invalid, the corresponding field will simply be its zero value.

All response structs also include a special JSON field, containing more detailed information about each property, which you can use like so:

if res.Name == "" {
	// true if `"name"` is either not present or explicitly null
	res.JSON.Name.IsNull()

	// true if the `"name"` key was not present in the response JSON at all
	res.JSON.Name.IsMissing()

	// When the API returns data that cannot be coerced to the expected type:
	if res.JSON.Name.IsInvalid() {
		raw := res.JSON.Name.Raw()

		legacyName := struct{
			First string `json:"first"`
			Last  string `json:"last"`
		}{}
		json.Unmarshal([]byte(raw), &legacyName)
		name = legacyName.First + " " + legacyName.Last
	}
}

These .JSON structs also include an Extras 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()
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 := arcadego.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.Chat.Completions.New(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"}),
)

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:

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.:

Errors

When the API returns a non-success status code, we return an error with type *arcadego.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.Chat.Completions.New(context.TODO(), arcadego.ChatCompletionNewParams{
	ChatRequest: arcadego.ChatRequestParam{},
})
if err != nil {
	var apierr *arcadego.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 "/v1/chat/completions": 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.Chat.Completions.New(
	ctx,
	arcadego.ChatCompletionNewParams{
		ChatRequest: arcadego.ChatRequestParam{},
	},
	// 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 param.Field[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 arcadego.FileParam(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 := arcadego.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.Chat.Completions.New(
	context.TODO(),
	arcadego.ChatCompletionNewParams{
		ChatRequest: arcadego.ChatRequestParam{},
	},
	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
chatResponse, err := client.Chat.Completions.New(
	context.TODO(),
	arcadego.ChatCompletionNewParams{
		ChatRequest: arcadego.ChatRequestParam{},
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", chatResponse)

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]interface{}

    // 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:   arcadego.F("id_xxxx"),
    Data: arcadego.F(FooNewParamsData{
        FirstName: arcadego.F("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 := arcadego.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 AuthorizationResponseStatusCompleted = shared.AuthorizationResponseStatusCompleted

This is an alias to an internal value.

View Source
const AuthorizationResponseStatusFailed = shared.AuthorizationResponseStatusFailed

This is an alias to an internal value.

View Source
const AuthorizationResponseStatusNotStarted = shared.AuthorizationResponseStatusNotStarted

This is an alias to an internal value.

View Source
const AuthorizationResponseStatusPending = shared.AuthorizationResponseStatusPending

This is an alias to an internal value.

Variables

This section is empty.

Functions

func Bool

func Bool(value bool) param.Field[bool]

Bool is a param field helper which helps specify bools.

func DefaultClientOptions

func DefaultClientOptions() []option.RequestOption

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

func F

func F[T any](value T) param.Field[T]

F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.

func FileParam

func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]

FileParam is a param field helper which helps files with a mime content-type.

func Float

func Float(value float64) param.Field[float64]

Float is a param field helper which helps specify floats.

func Int

func Int(value int64) param.Field[int64]

Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.

func Null

func Null[T any]() param.Field[T]

Null is a param field helper which explicitly sends null to the API.

func Raw

func Raw[T any](value any) param.Field[T]

Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).

func String

func String(value string) param.Field[string]

String is a param field helper which helps specify strings.

Types

type AdminAuthProviderListResponse

type AdminAuthProviderListResponse struct {
	Items      []AuthProviderResponse            `json:"items"`
	Limit      int64                             `json:"limit"`
	Offset     int64                             `json:"offset"`
	PageCount  int64                             `json:"page_count"`
	TotalCount int64                             `json:"total_count"`
	JSON       adminAuthProviderListResponseJSON `json:"-"`
}

func (*AdminAuthProviderListResponse) UnmarshalJSON

func (r *AdminAuthProviderListResponse) UnmarshalJSON(data []byte) (err error)

type AdminAuthProviderNewParams

type AdminAuthProviderNewParams struct {
	AuthProviderCreateRequest AuthProviderCreateRequestParam `json:"auth_provider_create_request,required"`
}

func (AdminAuthProviderNewParams) MarshalJSON

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

type AdminAuthProviderPatchParams

type AdminAuthProviderPatchParams struct {
	AuthProviderUpdateRequest AuthProviderUpdateRequestParam `json:"auth_provider_update_request,required"`
}

func (AdminAuthProviderPatchParams) MarshalJSON

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

type AdminAuthProviderService

type AdminAuthProviderService struct {
	Options []option.RequestOption
}

AdminAuthProviderService contains methods and other services that help with interacting with the Arcade 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 NewAdminAuthProviderService method instead.

func NewAdminAuthProviderService

func NewAdminAuthProviderService(opts ...option.RequestOption) (r *AdminAuthProviderService)

NewAdminAuthProviderService 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 (*AdminAuthProviderService) Delete

Delete a specific auth provider

func (*AdminAuthProviderService) Get

Get the details of a specific auth provider

func (*AdminAuthProviderService) List

List a page of auth providers that are available to the caller

func (*AdminAuthProviderService) New

Create a new auth provider

func (*AdminAuthProviderService) Patch

Patch an existing auth provider

type AdminSecretListResponse

type AdminSecretListResponse struct {
	Items      []SecretResponse            `json:"items"`
	Limit      int64                       `json:"limit"`
	Offset     int64                       `json:"offset"`
	PageCount  int64                       `json:"page_count"`
	TotalCount int64                       `json:"total_count"`
	JSON       adminSecretListResponseJSON `json:"-"`
}

func (*AdminSecretListResponse) UnmarshalJSON

func (r *AdminSecretListResponse) UnmarshalJSON(data []byte) (err error)

type AdminSecretService

type AdminSecretService struct {
	Options []option.RequestOption
}

AdminSecretService contains methods and other services that help with interacting with the Arcade 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 NewAdminSecretService method instead.

func NewAdminSecretService

func NewAdminSecretService(opts ...option.RequestOption) (r *AdminSecretService)

NewAdminSecretService 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 (*AdminSecretService) Delete

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

Delete a secret by its ID

func (*AdminSecretService) List

List all secrets that are visible to the caller

type AdminService

type AdminService struct {
	Options         []option.RequestOption
	UserConnections *AdminUserConnectionService
	AuthProviders   *AdminAuthProviderService
	Secrets         *AdminSecretService
}

AdminService contains methods and other services that help with interacting with the Arcade 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.

type AdminUserConnectionListParams

type AdminUserConnectionListParams struct {
	// Page size
	Limit param.Field[int64] `query:"limit"`
	// Page offset
	Offset   param.Field[int64]                                 `query:"offset"`
	Provider param.Field[AdminUserConnectionListParamsProvider] `query:"provider"`
	User     param.Field[AdminUserConnectionListParamsUser]     `query:"user"`
}

func (AdminUserConnectionListParams) URLQuery

func (r AdminUserConnectionListParams) URLQuery() (v url.Values)

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

type AdminUserConnectionListParamsProvider

type AdminUserConnectionListParamsProvider struct {
	// Provider ID
	ID param.Field[string] `query:"id"`
}

func (AdminUserConnectionListParamsProvider) URLQuery

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

type AdminUserConnectionListParamsUser

type AdminUserConnectionListParamsUser struct {
	// User ID
	ID param.Field[string] `query:"id"`
}

func (AdminUserConnectionListParamsUser) URLQuery

func (r AdminUserConnectionListParamsUser) URLQuery() (v url.Values)

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

type AdminUserConnectionService

type AdminUserConnectionService struct {
	Options []option.RequestOption
}

AdminUserConnectionService contains methods and other services that help with interacting with the Arcade 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 NewAdminUserConnectionService method instead.

func NewAdminUserConnectionService

func NewAdminUserConnectionService(opts ...option.RequestOption) (r *AdminUserConnectionService)

NewAdminUserConnectionService 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 (*AdminUserConnectionService) Delete

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

Delete a user/auth provider connection

func (*AdminUserConnectionService) List

List all auth connections

func (*AdminUserConnectionService) ListAutoPaging

List all auth connections

type AuthAuthorizeParams

type AuthAuthorizeParams struct {
	AuthRequest AuthRequestParam `json:"auth_request,required"`
}

func (AuthAuthorizeParams) MarshalJSON

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

type AuthProviderCreateRequestOauth2AuthorizeRequestParam

type AuthProviderCreateRequestOauth2AuthorizeRequestParam struct {
	Endpoint            param.Field[string]                                                             `json:"endpoint,required"`
	AuthMethod          param.Field[string]                                                             `json:"auth_method"`
	Method              param.Field[string]                                                             `json:"method"`
	Params              param.Field[map[string]string]                                                  `json:"params"`
	RequestContentType  param.Field[AuthProviderCreateRequestOauth2AuthorizeRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderCreateRequestOauth2AuthorizeRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                                  `json:"response_map"`
}

func (AuthProviderCreateRequestOauth2AuthorizeRequestParam) MarshalJSON

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

type AuthProviderCreateRequestOauth2AuthorizeRequestRequestContentType

type AuthProviderCreateRequestOauth2AuthorizeRequestRequestContentType string
const (
	AuthProviderCreateRequestOauth2AuthorizeRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2AuthorizeRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2AuthorizeRequestRequestContentTypeApplicationJson               AuthProviderCreateRequestOauth2AuthorizeRequestRequestContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2AuthorizeRequestRequestContentType) IsKnown

type AuthProviderCreateRequestOauth2AuthorizeRequestResponseContentType

type AuthProviderCreateRequestOauth2AuthorizeRequestResponseContentType string
const (
	AuthProviderCreateRequestOauth2AuthorizeRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2AuthorizeRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2AuthorizeRequestResponseContentTypeApplicationJson               AuthProviderCreateRequestOauth2AuthorizeRequestResponseContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2AuthorizeRequestResponseContentType) IsKnown

type AuthProviderCreateRequestOauth2Param

type AuthProviderCreateRequestOauth2Param struct {
	ClientID                  param.Field[string]                                                        `json:"client_id,required"`
	AuthorizeRequest          param.Field[AuthProviderCreateRequestOauth2AuthorizeRequestParam]          `json:"authorize_request"`
	ClientSecret              param.Field[string]                                                        `json:"client_secret"`
	Pkce                      param.Field[AuthProviderCreateRequestOauth2PkceParam]                      `json:"pkce"`
	RefreshRequest            param.Field[AuthProviderCreateRequestOauth2RefreshRequestParam]            `json:"refresh_request"`
	ScopeDelimiter            param.Field[AuthProviderCreateRequestOauth2ScopeDelimiter]                 `json:"scope_delimiter"`
	TokenIntrospectionRequest param.Field[AuthProviderCreateRequestOauth2TokenIntrospectionRequestParam] `json:"token_introspection_request"`
	TokenRequest              param.Field[AuthProviderCreateRequestOauth2TokenRequestParam]              `json:"token_request"`
	UserInfoRequest           param.Field[AuthProviderCreateRequestOauth2UserInfoRequestParam]           `json:"user_info_request"`
}

func (AuthProviderCreateRequestOauth2Param) MarshalJSON

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

type AuthProviderCreateRequestOauth2PkceParam

type AuthProviderCreateRequestOauth2PkceParam struct {
	CodeChallengeMethod param.Field[string] `json:"code_challenge_method"`
	Enabled             param.Field[bool]   `json:"enabled"`
}

func (AuthProviderCreateRequestOauth2PkceParam) MarshalJSON

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

type AuthProviderCreateRequestOauth2RefreshRequestParam

type AuthProviderCreateRequestOauth2RefreshRequestParam struct {
	Endpoint            param.Field[string]                                                           `json:"endpoint,required"`
	AuthMethod          param.Field[string]                                                           `json:"auth_method"`
	Method              param.Field[string]                                                           `json:"method"`
	Params              param.Field[map[string]string]                                                `json:"params"`
	RequestContentType  param.Field[AuthProviderCreateRequestOauth2RefreshRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderCreateRequestOauth2RefreshRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                                `json:"response_map"`
}

func (AuthProviderCreateRequestOauth2RefreshRequestParam) MarshalJSON

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

type AuthProviderCreateRequestOauth2RefreshRequestRequestContentType

type AuthProviderCreateRequestOauth2RefreshRequestRequestContentType string
const (
	AuthProviderCreateRequestOauth2RefreshRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2RefreshRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2RefreshRequestRequestContentTypeApplicationJson               AuthProviderCreateRequestOauth2RefreshRequestRequestContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2RefreshRequestRequestContentType) IsKnown

type AuthProviderCreateRequestOauth2RefreshRequestResponseContentType

type AuthProviderCreateRequestOauth2RefreshRequestResponseContentType string
const (
	AuthProviderCreateRequestOauth2RefreshRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2RefreshRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2RefreshRequestResponseContentTypeApplicationJson               AuthProviderCreateRequestOauth2RefreshRequestResponseContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2RefreshRequestResponseContentType) IsKnown

type AuthProviderCreateRequestOauth2ScopeDelimiter

type AuthProviderCreateRequestOauth2ScopeDelimiter string
const (
	AuthProviderCreateRequestOauth2ScopeDelimiterUnknown0  AuthProviderCreateRequestOauth2ScopeDelimiter = ","
	AuthProviderCreateRequestOauth2ScopeDelimiterLowercase AuthProviderCreateRequestOauth2ScopeDelimiter = " "
)

func (AuthProviderCreateRequestOauth2ScopeDelimiter) IsKnown

type AuthProviderCreateRequestOauth2TokenIntrospectionRequestParam

type AuthProviderCreateRequestOauth2TokenIntrospectionRequestParam struct {
	Endpoint            param.Field[string]                                                                      `json:"endpoint,required"`
	Triggers            param.Field[AuthProviderCreateRequestOauth2TokenIntrospectionRequestTriggersParam]       `json:"triggers,required"`
	AuthMethod          param.Field[string]                                                                      `json:"auth_method"`
	Method              param.Field[string]                                                                      `json:"method"`
	Params              param.Field[map[string]string]                                                           `json:"params"`
	RequestContentType  param.Field[AuthProviderCreateRequestOauth2TokenIntrospectionRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderCreateRequestOauth2TokenIntrospectionRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                                           `json:"response_map"`
}

func (AuthProviderCreateRequestOauth2TokenIntrospectionRequestParam) MarshalJSON

type AuthProviderCreateRequestOauth2TokenIntrospectionRequestRequestContentType

type AuthProviderCreateRequestOauth2TokenIntrospectionRequestRequestContentType string
const (
	AuthProviderCreateRequestOauth2TokenIntrospectionRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2TokenIntrospectionRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2TokenIntrospectionRequestRequestContentTypeApplicationJson               AuthProviderCreateRequestOauth2TokenIntrospectionRequestRequestContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2TokenIntrospectionRequestRequestContentType) IsKnown

type AuthProviderCreateRequestOauth2TokenIntrospectionRequestResponseContentType

type AuthProviderCreateRequestOauth2TokenIntrospectionRequestResponseContentType string
const (
	AuthProviderCreateRequestOauth2TokenIntrospectionRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2TokenIntrospectionRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2TokenIntrospectionRequestResponseContentTypeApplicationJson               AuthProviderCreateRequestOauth2TokenIntrospectionRequestResponseContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2TokenIntrospectionRequestResponseContentType) IsKnown

type AuthProviderCreateRequestOauth2TokenIntrospectionRequestTriggersParam

type AuthProviderCreateRequestOauth2TokenIntrospectionRequestTriggersParam struct {
	OnTokenGrant   param.Field[bool] `json:"on_token_grant"`
	OnTokenRefresh param.Field[bool] `json:"on_token_refresh"`
}

func (AuthProviderCreateRequestOauth2TokenIntrospectionRequestTriggersParam) MarshalJSON

type AuthProviderCreateRequestOauth2TokenRequestParam

type AuthProviderCreateRequestOauth2TokenRequestParam struct {
	Endpoint            param.Field[string]                                                         `json:"endpoint,required"`
	AuthMethod          param.Field[string]                                                         `json:"auth_method"`
	Method              param.Field[string]                                                         `json:"method"`
	Params              param.Field[map[string]string]                                              `json:"params"`
	RequestContentType  param.Field[AuthProviderCreateRequestOauth2TokenRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderCreateRequestOauth2TokenRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                              `json:"response_map"`
}

func (AuthProviderCreateRequestOauth2TokenRequestParam) MarshalJSON

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

type AuthProviderCreateRequestOauth2TokenRequestRequestContentType

type AuthProviderCreateRequestOauth2TokenRequestRequestContentType string
const (
	AuthProviderCreateRequestOauth2TokenRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2TokenRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2TokenRequestRequestContentTypeApplicationJson               AuthProviderCreateRequestOauth2TokenRequestRequestContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2TokenRequestRequestContentType) IsKnown

type AuthProviderCreateRequestOauth2TokenRequestResponseContentType

type AuthProviderCreateRequestOauth2TokenRequestResponseContentType string
const (
	AuthProviderCreateRequestOauth2TokenRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2TokenRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2TokenRequestResponseContentTypeApplicationJson               AuthProviderCreateRequestOauth2TokenRequestResponseContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2TokenRequestResponseContentType) IsKnown

type AuthProviderCreateRequestOauth2UserInfoRequestParam

type AuthProviderCreateRequestOauth2UserInfoRequestParam struct {
	Endpoint            param.Field[string]                                                            `json:"endpoint,required"`
	Triggers            param.Field[AuthProviderCreateRequestOauth2UserInfoRequestTriggersParam]       `json:"triggers,required"`
	AuthMethod          param.Field[string]                                                            `json:"auth_method"`
	Method              param.Field[string]                                                            `json:"method"`
	Params              param.Field[map[string]string]                                                 `json:"params"`
	RequestContentType  param.Field[AuthProviderCreateRequestOauth2UserInfoRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderCreateRequestOauth2UserInfoRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                                 `json:"response_map"`
}

func (AuthProviderCreateRequestOauth2UserInfoRequestParam) MarshalJSON

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

type AuthProviderCreateRequestOauth2UserInfoRequestRequestContentType

type AuthProviderCreateRequestOauth2UserInfoRequestRequestContentType string
const (
	AuthProviderCreateRequestOauth2UserInfoRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2UserInfoRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2UserInfoRequestRequestContentTypeApplicationJson               AuthProviderCreateRequestOauth2UserInfoRequestRequestContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2UserInfoRequestRequestContentType) IsKnown

type AuthProviderCreateRequestOauth2UserInfoRequestResponseContentType

type AuthProviderCreateRequestOauth2UserInfoRequestResponseContentType string
const (
	AuthProviderCreateRequestOauth2UserInfoRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderCreateRequestOauth2UserInfoRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderCreateRequestOauth2UserInfoRequestResponseContentTypeApplicationJson               AuthProviderCreateRequestOauth2UserInfoRequestResponseContentType = "application/json"
)

func (AuthProviderCreateRequestOauth2UserInfoRequestResponseContentType) IsKnown

type AuthProviderCreateRequestOauth2UserInfoRequestTriggersParam

type AuthProviderCreateRequestOauth2UserInfoRequestTriggersParam struct {
	OnTokenGrant   param.Field[bool] `json:"on_token_grant"`
	OnTokenRefresh param.Field[bool] `json:"on_token_refresh"`
}

func (AuthProviderCreateRequestOauth2UserInfoRequestTriggersParam) MarshalJSON

type AuthProviderCreateRequestParam

type AuthProviderCreateRequestParam struct {
	ID          param.Field[string]                               `json:"id,required"`
	Description param.Field[string]                               `json:"description"`
	Oauth2      param.Field[AuthProviderCreateRequestOauth2Param] `json:"oauth2"`
	ProviderID  param.Field[string]                               `json:"provider_id"`
	Status      param.Field[string]                               `json:"status"`
	Type        param.Field[string]                               `json:"type"`
}

func (AuthProviderCreateRequestParam) MarshalJSON

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

type AuthProviderResponse

type AuthProviderResponse struct {
	ID          string                      `json:"id"`
	Binding     AuthProviderResponseBinding `json:"binding"`
	CreatedAt   string                      `json:"created_at"`
	Description string                      `json:"description"`
	Oauth2      AuthProviderResponseOauth2  `json:"oauth2"`
	ProviderID  string                      `json:"provider_id"`
	Status      string                      `json:"status"`
	Type        string                      `json:"type"`
	UpdatedAt   string                      `json:"updated_at"`
	JSON        authProviderResponseJSON    `json:"-"`
}

func (*AuthProviderResponse) UnmarshalJSON

func (r *AuthProviderResponse) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseBinding

type AuthProviderResponseBinding struct {
	ID   string                          `json:"id"`
	Type AuthProviderResponseBindingType `json:"type"`
	JSON authProviderResponseBindingJSON `json:"-"`
}

func (*AuthProviderResponseBinding) UnmarshalJSON

func (r *AuthProviderResponseBinding) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseBindingType

type AuthProviderResponseBindingType string
const (
	AuthProviderResponseBindingTypeStatic  AuthProviderResponseBindingType = "static"
	AuthProviderResponseBindingTypeTenant  AuthProviderResponseBindingType = "tenant"
	AuthProviderResponseBindingTypeProject AuthProviderResponseBindingType = "project"
	AuthProviderResponseBindingTypeAccount AuthProviderResponseBindingType = "account"
)

func (AuthProviderResponseBindingType) IsKnown

type AuthProviderResponseOauth2

type AuthProviderResponseOauth2 struct {
	AuthorizeRequest          AuthProviderResponseOauth2AuthorizeRequest          `json:"authorize_request"`
	ClientID                  string                                              `json:"client_id"`
	ClientSecret              AuthProviderResponseOauth2ClientSecret              `json:"client_secret"`
	Pkce                      AuthProviderResponseOauth2Pkce                      `json:"pkce"`
	RefreshRequest            AuthProviderResponseOauth2RefreshRequest            `json:"refresh_request"`
	ScopeDelimiter            string                                              `json:"scope_delimiter"`
	TokenIntrospectionRequest AuthProviderResponseOauth2TokenIntrospectionRequest `json:"token_introspection_request"`
	TokenRequest              AuthProviderResponseOauth2TokenRequest              `json:"token_request"`
	UserInfoRequest           AuthProviderResponseOauth2UserInfoRequest           `json:"user_info_request"`
	JSON                      authProviderResponseOauth2JSON                      `json:"-"`
}

func (*AuthProviderResponseOauth2) UnmarshalJSON

func (r *AuthProviderResponseOauth2) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseOauth2AuthorizeRequest

type AuthProviderResponseOauth2AuthorizeRequest struct {
	AuthMethod          string                                         `json:"auth_method"`
	Endpoint            string                                         `json:"endpoint"`
	ExpirationFormat    string                                         `json:"expiration_format"`
	Method              string                                         `json:"method"`
	Params              map[string]string                              `json:"params"`
	RequestContentType  string                                         `json:"request_content_type"`
	ResponseContentType string                                         `json:"response_content_type"`
	ResponseMap         map[string]string                              `json:"response_map"`
	JSON                authProviderResponseOauth2AuthorizeRequestJSON `json:"-"`
}

func (*AuthProviderResponseOauth2AuthorizeRequest) UnmarshalJSON

func (r *AuthProviderResponseOauth2AuthorizeRequest) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseOauth2ClientSecret

type AuthProviderResponseOauth2ClientSecret struct {
	Binding  AuthProviderResponseOauth2ClientSecretBinding `json:"binding"`
	Editable bool                                          `json:"editable"`
	Exists   bool                                          `json:"exists"`
	Hint     string                                        `json:"hint"`
	Value    string                                        `json:"value"`
	JSON     authProviderResponseOauth2ClientSecretJSON    `json:"-"`
}

func (*AuthProviderResponseOauth2ClientSecret) UnmarshalJSON

func (r *AuthProviderResponseOauth2ClientSecret) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseOauth2ClientSecretBinding

type AuthProviderResponseOauth2ClientSecretBinding string
const (
	AuthProviderResponseOauth2ClientSecretBindingStatic  AuthProviderResponseOauth2ClientSecretBinding = "static"
	AuthProviderResponseOauth2ClientSecretBindingTenant  AuthProviderResponseOauth2ClientSecretBinding = "tenant"
	AuthProviderResponseOauth2ClientSecretBindingProject AuthProviderResponseOauth2ClientSecretBinding = "project"
	AuthProviderResponseOauth2ClientSecretBindingAccount AuthProviderResponseOauth2ClientSecretBinding = "account"
)

func (AuthProviderResponseOauth2ClientSecretBinding) IsKnown

type AuthProviderResponseOauth2Pkce

type AuthProviderResponseOauth2Pkce struct {
	CodeChallengeMethod string                             `json:"code_challenge_method"`
	Enabled             bool                               `json:"enabled"`
	JSON                authProviderResponseOauth2PkceJSON `json:"-"`
}

func (*AuthProviderResponseOauth2Pkce) UnmarshalJSON

func (r *AuthProviderResponseOauth2Pkce) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseOauth2RefreshRequest

type AuthProviderResponseOauth2RefreshRequest struct {
	AuthMethod          string                                       `json:"auth_method"`
	Endpoint            string                                       `json:"endpoint"`
	ExpirationFormat    string                                       `json:"expiration_format"`
	Method              string                                       `json:"method"`
	Params              map[string]string                            `json:"params"`
	RequestContentType  string                                       `json:"request_content_type"`
	ResponseContentType string                                       `json:"response_content_type"`
	ResponseMap         map[string]string                            `json:"response_map"`
	JSON                authProviderResponseOauth2RefreshRequestJSON `json:"-"`
}

func (*AuthProviderResponseOauth2RefreshRequest) UnmarshalJSON

func (r *AuthProviderResponseOauth2RefreshRequest) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseOauth2TokenIntrospectionRequest

type AuthProviderResponseOauth2TokenIntrospectionRequest struct {
	AuthMethod          string                                                      `json:"auth_method"`
	Enabled             bool                                                        `json:"enabled"`
	Endpoint            string                                                      `json:"endpoint"`
	ExpirationFormat    string                                                      `json:"expiration_format"`
	Method              string                                                      `json:"method"`
	Params              map[string]string                                           `json:"params"`
	RequestContentType  string                                                      `json:"request_content_type"`
	ResponseContentType string                                                      `json:"response_content_type"`
	ResponseMap         map[string]string                                           `json:"response_map"`
	Triggers            AuthProviderResponseOauth2TokenIntrospectionRequestTriggers `json:"triggers"`
	JSON                authProviderResponseOauth2TokenIntrospectionRequestJSON     `json:"-"`
}

func (*AuthProviderResponseOauth2TokenIntrospectionRequest) UnmarshalJSON

func (r *AuthProviderResponseOauth2TokenIntrospectionRequest) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseOauth2TokenIntrospectionRequestTriggers

type AuthProviderResponseOauth2TokenIntrospectionRequestTriggers struct {
	OnTokenGrant   bool                                                            `json:"on_token_grant"`
	OnTokenRefresh bool                                                            `json:"on_token_refresh"`
	JSON           authProviderResponseOauth2TokenIntrospectionRequestTriggersJSON `json:"-"`
}

func (*AuthProviderResponseOauth2TokenIntrospectionRequestTriggers) UnmarshalJSON

type AuthProviderResponseOauth2TokenRequest

type AuthProviderResponseOauth2TokenRequest struct {
	AuthMethod          string                                     `json:"auth_method"`
	Endpoint            string                                     `json:"endpoint"`
	ExpirationFormat    string                                     `json:"expiration_format"`
	Method              string                                     `json:"method"`
	Params              map[string]string                          `json:"params"`
	RequestContentType  string                                     `json:"request_content_type"`
	ResponseContentType string                                     `json:"response_content_type"`
	ResponseMap         map[string]string                          `json:"response_map"`
	JSON                authProviderResponseOauth2TokenRequestJSON `json:"-"`
}

func (*AuthProviderResponseOauth2TokenRequest) UnmarshalJSON

func (r *AuthProviderResponseOauth2TokenRequest) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseOauth2UserInfoRequest

type AuthProviderResponseOauth2UserInfoRequest struct {
	AuthMethod          string                                            `json:"auth_method"`
	Endpoint            string                                            `json:"endpoint"`
	ExpirationFormat    string                                            `json:"expiration_format"`
	Method              string                                            `json:"method"`
	Params              map[string]string                                 `json:"params"`
	RequestContentType  string                                            `json:"request_content_type"`
	ResponseContentType string                                            `json:"response_content_type"`
	ResponseMap         map[string]string                                 `json:"response_map"`
	Triggers            AuthProviderResponseOauth2UserInfoRequestTriggers `json:"triggers"`
	JSON                authProviderResponseOauth2UserInfoRequestJSON     `json:"-"`
}

func (*AuthProviderResponseOauth2UserInfoRequest) UnmarshalJSON

func (r *AuthProviderResponseOauth2UserInfoRequest) UnmarshalJSON(data []byte) (err error)

type AuthProviderResponseOauth2UserInfoRequestTriggers

type AuthProviderResponseOauth2UserInfoRequestTriggers struct {
	OnTokenGrant   bool                                                  `json:"on_token_grant"`
	OnTokenRefresh bool                                                  `json:"on_token_refresh"`
	JSON           authProviderResponseOauth2UserInfoRequestTriggersJSON `json:"-"`
}

func (*AuthProviderResponseOauth2UserInfoRequestTriggers) UnmarshalJSON

func (r *AuthProviderResponseOauth2UserInfoRequestTriggers) UnmarshalJSON(data []byte) (err error)

type AuthProviderUpdateRequestOauth2AuthorizeRequestParam

type AuthProviderUpdateRequestOauth2AuthorizeRequestParam struct {
	AuthMethod          param.Field[string]                                                             `json:"auth_method"`
	Endpoint            param.Field[string]                                                             `json:"endpoint"`
	Method              param.Field[string]                                                             `json:"method"`
	Params              param.Field[map[string]string]                                                  `json:"params"`
	RequestContentType  param.Field[AuthProviderUpdateRequestOauth2AuthorizeRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderUpdateRequestOauth2AuthorizeRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                                  `json:"response_map"`
}

func (AuthProviderUpdateRequestOauth2AuthorizeRequestParam) MarshalJSON

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

type AuthProviderUpdateRequestOauth2AuthorizeRequestRequestContentType

type AuthProviderUpdateRequestOauth2AuthorizeRequestRequestContentType string
const (
	AuthProviderUpdateRequestOauth2AuthorizeRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderUpdateRequestOauth2AuthorizeRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderUpdateRequestOauth2AuthorizeRequestRequestContentTypeApplicationJson               AuthProviderUpdateRequestOauth2AuthorizeRequestRequestContentType = "application/json"
)

func (AuthProviderUpdateRequestOauth2AuthorizeRequestRequestContentType) IsKnown

type AuthProviderUpdateRequestOauth2AuthorizeRequestResponseContentType

type AuthProviderUpdateRequestOauth2AuthorizeRequestResponseContentType string
const (
	AuthProviderUpdateRequestOauth2AuthorizeRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderUpdateRequestOauth2AuthorizeRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderUpdateRequestOauth2AuthorizeRequestResponseContentTypeApplicationJson               AuthProviderUpdateRequestOauth2AuthorizeRequestResponseContentType = "application/json"
)

func (AuthProviderUpdateRequestOauth2AuthorizeRequestResponseContentType) IsKnown

type AuthProviderUpdateRequestOauth2Param

type AuthProviderUpdateRequestOauth2Param struct {
	AuthorizeRequest param.Field[AuthProviderUpdateRequestOauth2AuthorizeRequestParam] `json:"authorize_request"`
	ClientID         param.Field[string]                                               `json:"client_id"`
	ClientSecret     param.Field[string]                                               `json:"client_secret"`
	Pkce             param.Field[AuthProviderUpdateRequestOauth2PkceParam]             `json:"pkce"`
	RefreshRequest   param.Field[AuthProviderUpdateRequestOauth2RefreshRequestParam]   `json:"refresh_request"`
	ScopeDelimiter   param.Field[AuthProviderUpdateRequestOauth2ScopeDelimiter]        `json:"scope_delimiter"`
	TokenRequest     param.Field[AuthProviderUpdateRequestOauth2TokenRequestParam]     `json:"token_request"`
	UserInfoRequest  param.Field[AuthProviderUpdateRequestOauth2UserInfoRequestParam]  `json:"user_info_request"`
}

func (AuthProviderUpdateRequestOauth2Param) MarshalJSON

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

type AuthProviderUpdateRequestOauth2PkceParam

type AuthProviderUpdateRequestOauth2PkceParam struct {
	CodeChallengeMethod param.Field[string] `json:"code_challenge_method"`
	Enabled             param.Field[bool]   `json:"enabled"`
}

func (AuthProviderUpdateRequestOauth2PkceParam) MarshalJSON

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

type AuthProviderUpdateRequestOauth2RefreshRequestParam

type AuthProviderUpdateRequestOauth2RefreshRequestParam struct {
	AuthMethod          param.Field[string]                                                           `json:"auth_method"`
	Endpoint            param.Field[string]                                                           `json:"endpoint"`
	Method              param.Field[string]                                                           `json:"method"`
	Params              param.Field[map[string]string]                                                `json:"params"`
	RequestContentType  param.Field[AuthProviderUpdateRequestOauth2RefreshRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderUpdateRequestOauth2RefreshRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                                `json:"response_map"`
}

func (AuthProviderUpdateRequestOauth2RefreshRequestParam) MarshalJSON

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

type AuthProviderUpdateRequestOauth2RefreshRequestRequestContentType

type AuthProviderUpdateRequestOauth2RefreshRequestRequestContentType string
const (
	AuthProviderUpdateRequestOauth2RefreshRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderUpdateRequestOauth2RefreshRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderUpdateRequestOauth2RefreshRequestRequestContentTypeApplicationJson               AuthProviderUpdateRequestOauth2RefreshRequestRequestContentType = "application/json"
)

func (AuthProviderUpdateRequestOauth2RefreshRequestRequestContentType) IsKnown

type AuthProviderUpdateRequestOauth2RefreshRequestResponseContentType

type AuthProviderUpdateRequestOauth2RefreshRequestResponseContentType string
const (
	AuthProviderUpdateRequestOauth2RefreshRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderUpdateRequestOauth2RefreshRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderUpdateRequestOauth2RefreshRequestResponseContentTypeApplicationJson               AuthProviderUpdateRequestOauth2RefreshRequestResponseContentType = "application/json"
)

func (AuthProviderUpdateRequestOauth2RefreshRequestResponseContentType) IsKnown

type AuthProviderUpdateRequestOauth2ScopeDelimiter

type AuthProviderUpdateRequestOauth2ScopeDelimiter string
const (
	AuthProviderUpdateRequestOauth2ScopeDelimiterUnknown1  AuthProviderUpdateRequestOauth2ScopeDelimiter = ","
	AuthProviderUpdateRequestOauth2ScopeDelimiterLowercase AuthProviderUpdateRequestOauth2ScopeDelimiter = " "
)

func (AuthProviderUpdateRequestOauth2ScopeDelimiter) IsKnown

type AuthProviderUpdateRequestOauth2TokenRequestParam

type AuthProviderUpdateRequestOauth2TokenRequestParam struct {
	AuthMethod          param.Field[string]                                                         `json:"auth_method"`
	Endpoint            param.Field[string]                                                         `json:"endpoint"`
	Method              param.Field[string]                                                         `json:"method"`
	Params              param.Field[map[string]string]                                              `json:"params"`
	RequestContentType  param.Field[AuthProviderUpdateRequestOauth2TokenRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderUpdateRequestOauth2TokenRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                              `json:"response_map"`
}

func (AuthProviderUpdateRequestOauth2TokenRequestParam) MarshalJSON

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

type AuthProviderUpdateRequestOauth2TokenRequestRequestContentType

type AuthProviderUpdateRequestOauth2TokenRequestRequestContentType string
const (
	AuthProviderUpdateRequestOauth2TokenRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderUpdateRequestOauth2TokenRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderUpdateRequestOauth2TokenRequestRequestContentTypeApplicationJson               AuthProviderUpdateRequestOauth2TokenRequestRequestContentType = "application/json"
)

func (AuthProviderUpdateRequestOauth2TokenRequestRequestContentType) IsKnown

type AuthProviderUpdateRequestOauth2TokenRequestResponseContentType

type AuthProviderUpdateRequestOauth2TokenRequestResponseContentType string
const (
	AuthProviderUpdateRequestOauth2TokenRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderUpdateRequestOauth2TokenRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderUpdateRequestOauth2TokenRequestResponseContentTypeApplicationJson               AuthProviderUpdateRequestOauth2TokenRequestResponseContentType = "application/json"
)

func (AuthProviderUpdateRequestOauth2TokenRequestResponseContentType) IsKnown

type AuthProviderUpdateRequestOauth2UserInfoRequestParam

type AuthProviderUpdateRequestOauth2UserInfoRequestParam struct {
	AuthMethod          param.Field[string]                                                            `json:"auth_method"`
	Endpoint            param.Field[string]                                                            `json:"endpoint"`
	Method              param.Field[string]                                                            `json:"method"`
	Params              param.Field[map[string]string]                                                 `json:"params"`
	RequestContentType  param.Field[AuthProviderUpdateRequestOauth2UserInfoRequestRequestContentType]  `json:"request_content_type"`
	ResponseContentType param.Field[AuthProviderUpdateRequestOauth2UserInfoRequestResponseContentType] `json:"response_content_type"`
	ResponseMap         param.Field[map[string]string]                                                 `json:"response_map"`
	Triggers            param.Field[AuthProviderUpdateRequestOauth2UserInfoRequestTriggersParam]       `json:"triggers"`
}

func (AuthProviderUpdateRequestOauth2UserInfoRequestParam) MarshalJSON

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

type AuthProviderUpdateRequestOauth2UserInfoRequestRequestContentType

type AuthProviderUpdateRequestOauth2UserInfoRequestRequestContentType string
const (
	AuthProviderUpdateRequestOauth2UserInfoRequestRequestContentTypeApplicationXWwwFormUrlencoded AuthProviderUpdateRequestOauth2UserInfoRequestRequestContentType = "application/x-www-form-urlencoded"
	AuthProviderUpdateRequestOauth2UserInfoRequestRequestContentTypeApplicationJson               AuthProviderUpdateRequestOauth2UserInfoRequestRequestContentType = "application/json"
)

func (AuthProviderUpdateRequestOauth2UserInfoRequestRequestContentType) IsKnown

type AuthProviderUpdateRequestOauth2UserInfoRequestResponseContentType

type AuthProviderUpdateRequestOauth2UserInfoRequestResponseContentType string
const (
	AuthProviderUpdateRequestOauth2UserInfoRequestResponseContentTypeApplicationXWwwFormUrlencoded AuthProviderUpdateRequestOauth2UserInfoRequestResponseContentType = "application/x-www-form-urlencoded"
	AuthProviderUpdateRequestOauth2UserInfoRequestResponseContentTypeApplicationJson               AuthProviderUpdateRequestOauth2UserInfoRequestResponseContentType = "application/json"
)

func (AuthProviderUpdateRequestOauth2UserInfoRequestResponseContentType) IsKnown

type AuthProviderUpdateRequestOauth2UserInfoRequestTriggersParam

type AuthProviderUpdateRequestOauth2UserInfoRequestTriggersParam struct {
	OnTokenGrant   param.Field[bool] `json:"on_token_grant"`
	OnTokenRefresh param.Field[bool] `json:"on_token_refresh"`
}

func (AuthProviderUpdateRequestOauth2UserInfoRequestTriggersParam) MarshalJSON

type AuthProviderUpdateRequestParam

type AuthProviderUpdateRequestParam struct {
	ID          param.Field[string]                               `json:"id"`
	Description param.Field[string]                               `json:"description"`
	Oauth2      param.Field[AuthProviderUpdateRequestOauth2Param] `json:"oauth2"`
	ProviderID  param.Field[string]                               `json:"provider_id"`
	Status      param.Field[string]                               `json:"status"`
	Type        param.Field[string]                               `json:"type"`
}

func (AuthProviderUpdateRequestParam) MarshalJSON

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

type AuthRequestAuthRequirementOauth2Param

type AuthRequestAuthRequirementOauth2Param struct {
	Scopes param.Field[[]string] `json:"scopes"`
}

func (AuthRequestAuthRequirementOauth2Param) MarshalJSON

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

type AuthRequestAuthRequirementParam

type AuthRequestAuthRequirementParam struct {
	// one of ID or ProviderID must be set
	ID     param.Field[string]                                `json:"id"`
	Oauth2 param.Field[AuthRequestAuthRequirementOauth2Param] `json:"oauth2"`
	// one of ID or ProviderID must be set
	ProviderID   param.Field[string] `json:"provider_id"`
	ProviderType param.Field[string] `json:"provider_type"`
}

func (AuthRequestAuthRequirementParam) MarshalJSON

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

type AuthRequestParam

type AuthRequestParam struct {
	AuthRequirement param.Field[AuthRequestAuthRequirementParam] `json:"auth_requirement,required"`
	UserID          param.Field[string]                          `json:"user_id,required"`
	// Optional: if provided, the user will be redirected to this URI after
	// authorization
	NextUri param.Field[string] `json:"next_uri"`
}

func (AuthRequestParam) MarshalJSON

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

type AuthService

type AuthService struct {
	Options []option.RequestOption
}

AuthService contains methods and other services that help with interacting with the Arcade 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 NewAuthService method instead.

func NewAuthService

func NewAuthService(opts ...option.RequestOption) (r *AuthService)

NewAuthService 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 (*AuthService) Authorize

Starts the authorization process for given authorization requirements

func (*AuthService) Status

Checks the status of an ongoing authorization process for a specific tool. If 'wait' param is present, does not respond until either the auth status becomes completed or the timeout is reached.

type AuthStatusParams

type AuthStatusParams struct {
	// Authorization ID
	ID param.Field[string] `query:"id,required"`
	// Timeout in seconds (max 59)
	Wait param.Field[int64] `query:"wait"`
}

func (AuthStatusParams) URLQuery

func (r AuthStatusParams) URLQuery() (v url.Values)

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

type AuthorizationContext

type AuthorizationContext = shared.AuthorizationContext

This is an alias to an internal type.

type AuthorizationResponse

type AuthorizationResponse = shared.AuthorizationResponse

This is an alias to an internal type.

type AuthorizationResponseStatus

type AuthorizationResponseStatus = shared.AuthorizationResponseStatus

This is an alias to an internal type.

type AuthorizeToolRequestParam

type AuthorizeToolRequestParam struct {
	ToolName param.Field[string] `json:"tool_name,required"`
	// Optional: if provided, the user will be redirected to this URI after
	// authorization
	NextUri param.Field[string] `json:"next_uri"`
	// Optional: if not provided, any version is used
	ToolVersion param.Field[string] `json:"tool_version"`
	// Required only when calling with an API key
	UserID param.Field[string] `json:"user_id"`
}

func (AuthorizeToolRequestParam) MarshalJSON

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

type ChatCompletionNewParams

type ChatCompletionNewParams struct {
	ChatRequest ChatRequestParam `json:"chat_request,required"`
}

func (ChatCompletionNewParams) MarshalJSON

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

type ChatCompletionService

type ChatCompletionService struct {
	Options []option.RequestOption
}

ChatCompletionService contains methods and other services that help with interacting with the Arcade 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 NewChatCompletionService method instead.

func NewChatCompletionService

func NewChatCompletionService(opts ...option.RequestOption) (r *ChatCompletionService)

NewChatCompletionService 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 (*ChatCompletionService) New

Interact with language models via OpenAI's chat completions API

type ChatMessage

type ChatMessage struct {
	// The content of the message.
	Content string `json:"content,required"`
	// The role of the author of this message. One of system, user, tool, or assistant.
	Role string `json:"role,required"`
	// tool Name
	Name string `json:"name"`
	// tool_call_id
	ToolCallID string `json:"tool_call_id"`
	// tool calls if any
	ToolCalls []ChatMessageToolCall `json:"tool_calls"`
	JSON      chatMessageJSON       `json:"-"`
}

func (*ChatMessage) UnmarshalJSON

func (r *ChatMessage) UnmarshalJSON(data []byte) (err error)

type ChatMessageParam

type ChatMessageParam struct {
	// The content of the message.
	Content param.Field[string] `json:"content,required"`
	// The role of the author of this message. One of system, user, tool, or assistant.
	Role param.Field[string] `json:"role,required"`
	// tool Name
	Name param.Field[string] `json:"name"`
	// tool_call_id
	ToolCallID param.Field[string] `json:"tool_call_id"`
	// tool calls if any
	ToolCalls param.Field[[]ChatMessageToolCallParam] `json:"tool_calls"`
}

func (ChatMessageParam) MarshalJSON

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

type ChatMessageToolCall

type ChatMessageToolCall struct {
	ID       string                       `json:"id"`
	Function ChatMessageToolCallsFunction `json:"function"`
	Type     ChatMessageToolCallsType     `json:"type"`
	JSON     chatMessageToolCallJSON      `json:"-"`
}

func (*ChatMessageToolCall) UnmarshalJSON

func (r *ChatMessageToolCall) UnmarshalJSON(data []byte) (err error)

type ChatMessageToolCallParam

type ChatMessageToolCallParam struct {
	ID       param.Field[string]                            `json:"id"`
	Function param.Field[ChatMessageToolCallsFunctionParam] `json:"function"`
	Type     param.Field[ChatMessageToolCallsType]          `json:"type"`
}

func (ChatMessageToolCallParam) MarshalJSON

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

type ChatMessageToolCallsFunction

type ChatMessageToolCallsFunction struct {
	Arguments string                           `json:"arguments"`
	Name      string                           `json:"name"`
	JSON      chatMessageToolCallsFunctionJSON `json:"-"`
}

func (*ChatMessageToolCallsFunction) UnmarshalJSON

func (r *ChatMessageToolCallsFunction) UnmarshalJSON(data []byte) (err error)

type ChatMessageToolCallsFunctionParam

type ChatMessageToolCallsFunctionParam struct {
	Arguments param.Field[string] `json:"arguments"`
	Name      param.Field[string] `json:"name"`
}

func (ChatMessageToolCallsFunctionParam) MarshalJSON

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

type ChatMessageToolCallsType

type ChatMessageToolCallsType string
const (
	ChatMessageToolCallsTypeFunction ChatMessageToolCallsType = "function"
)

func (ChatMessageToolCallsType) IsKnown

func (r ChatMessageToolCallsType) IsKnown() bool

type ChatRequestParam

type ChatRequestParam struct {
	FrequencyPenalty param.Field[float64] `json:"frequency_penalty"`
	// LogitBias is must be a token id string (specified by their token ID in the
	// tokenizer), not a word string. incorrect: `"logit_bias":{"You": 6}`, correct:
	// `"logit_bias":{"1639": 6}` refs:
	// https://platform.openai.com/docs/api-reference/chat/create#chat/create-logit_bias
	LogitBias param.Field[map[string]int64] `json:"logit_bias"`
	// LogProbs indicates whether to return log probabilities of the output tokens or
	// not. If true, returns the log probabilities of each output token returned in the
	// content of message. This option is currently not available on the
	// gpt-4-vision-preview model.
	Logprobs  param.Field[bool]               `json:"logprobs"`
	MaxTokens param.Field[int64]              `json:"max_tokens"`
	Messages  param.Field[[]ChatMessageParam] `json:"messages"`
	Model     param.Field[string]             `json:"model"`
	N         param.Field[int64]              `json:"n"`
	// Disable the default behavior of parallel tool calls by setting it: false.
	ParallelToolCalls param.Field[bool]                           `json:"parallel_tool_calls"`
	PresencePenalty   param.Field[float64]                        `json:"presence_penalty"`
	ResponseFormat    param.Field[ChatRequestResponseFormatParam] `json:"response_format"`
	Seed              param.Field[int64]                          `json:"seed"`
	Stop              param.Field[[]string]                       `json:"stop"`
	Stream            param.Field[bool]                           `json:"stream"`
	// Options for streaming response. Only set this when you set stream: true.
	StreamOptions param.Field[ChatRequestStreamOptionsParam] `json:"stream_options"`
	Temperature   param.Field[float64]                       `json:"temperature"`
	// This can be either a string or an ToolChoice object.
	ToolChoice param.Field[interface{}] `json:"tool_choice"`
	Tools      param.Field[interface{}] `json:"tools"`
	// TopLogProbs is an integer between 0 and 5 specifying the number of most likely
	// tokens to return at each token position, each with an associated log
	// probability. logprobs must be set to true if this parameter is used.
	TopLogprobs param.Field[int64]   `json:"top_logprobs"`
	TopP        param.Field[float64] `json:"top_p"`
	User        param.Field[string]  `json:"user"`
}

func (ChatRequestParam) MarshalJSON

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

type ChatRequestResponseFormatParam

type ChatRequestResponseFormatParam struct {
	Type param.Field[ChatRequestResponseFormatType] `json:"type"`
}

func (ChatRequestResponseFormatParam) MarshalJSON

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

type ChatRequestResponseFormatType

type ChatRequestResponseFormatType string
const (
	ChatRequestResponseFormatTypeJsonObject ChatRequestResponseFormatType = "json_object"
	ChatRequestResponseFormatTypeText       ChatRequestResponseFormatType = "text"
)

func (ChatRequestResponseFormatType) IsKnown

func (r ChatRequestResponseFormatType) IsKnown() bool

type ChatRequestStreamOptionsParam

type ChatRequestStreamOptionsParam struct {
	// If set, an additional chunk will be streamed before the data: [DONE] message.
	// The usage field on this chunk shows the token usage statistics for the entire
	// request, and the choices field will always be an empty array. All other chunks
	// will also include a usage field, but with a null value.
	IncludeUsage param.Field[bool] `json:"include_usage"`
}

Options for streaming response. Only set this when you set stream: true.

func (ChatRequestStreamOptionsParam) MarshalJSON

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

type ChatResponse

type ChatResponse struct {
	ID                string           `json:"id"`
	Choices           []Choice         `json:"choices"`
	Created           int64            `json:"created"`
	Model             string           `json:"model"`
	Object            string           `json:"object"`
	SystemFingerprint string           `json:"system_fingerprint"`
	Usage             Usage            `json:"usage"`
	JSON              chatResponseJSON `json:"-"`
}

func (*ChatResponse) UnmarshalJSON

func (r *ChatResponse) UnmarshalJSON(data []byte) (err error)

type ChatService

type ChatService struct {
	Options     []option.RequestOption
	Completions *ChatCompletionService
}

ChatService contains methods and other services that help with interacting with the Arcade 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 NewChatService method instead.

func NewChatService

func NewChatService(opts ...option.RequestOption) (r *ChatService)

NewChatService 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.

type Choice

type Choice struct {
	FinishReason       string                         `json:"finish_reason"`
	Index              int64                          `json:"index"`
	Logprobs           interface{}                    `json:"logprobs"`
	Message            ChatMessage                    `json:"message"`
	ToolAuthorizations []shared.AuthorizationResponse `json:"tool_authorizations"`
	ToolMessages       []ChatMessage                  `json:"tool_messages"`
	JSON               choiceJSON                     `json:"-"`
}

func (*Choice) UnmarshalJSON

func (r *Choice) UnmarshalJSON(data []byte) (err error)

type Client

type Client struct {
	Options []option.RequestOption
	Admin   *AdminService
	Auth    *AuthService
	Health  *HealthService
	Chat    *ChatService
	Tools   *ToolService
	Workers *WorkerService
}

Client creates a struct with services and top level methods that help with interacting with the Arcade 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 (ARCADE_API_KEY, ARCADE_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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 CreateWorkerRequestHTTPParam

type CreateWorkerRequestHTTPParam struct {
	Retry   param.Field[int64]  `json:"retry,required"`
	Secret  param.Field[string] `json:"secret,required"`
	Timeout param.Field[int64]  `json:"timeout,required"`
	Uri     param.Field[string] `json:"uri,required"`
}

func (CreateWorkerRequestHTTPParam) MarshalJSON

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

type CreateWorkerRequestMcpParam

type CreateWorkerRequestMcpParam struct {
	Retry   param.Field[int64]  `json:"retry,required"`
	Timeout param.Field[int64]  `json:"timeout,required"`
	Uri     param.Field[string] `json:"uri,required"`
}

func (CreateWorkerRequestMcpParam) MarshalJSON

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

type CreateWorkerRequestParam

type CreateWorkerRequestParam struct {
	ID      param.Field[string]                       `json:"id,required"`
	Enabled param.Field[bool]                         `json:"enabled"`
	HTTP    param.Field[CreateWorkerRequestHTTPParam] `json:"http"`
	Mcp     param.Field[CreateWorkerRequestMcpParam]  `json:"mcp"`
	Type    param.Field[string]                       `json:"type"`
}

func (CreateWorkerRequestParam) MarshalJSON

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

type Error

type Error = apierror.Error

type ExecuteToolRequestParam

type ExecuteToolRequestParam struct {
	ToolName param.Field[string] `json:"tool_name,required"`
	// JSON input to the tool, if any
	Input param.Field[map[string]interface{}] `json:"input"`
	// The time at which the tool should be run (optional). If not provided, the tool
	// is run immediately. Format ISO 8601: YYYY-MM-DDTHH:MM:SS
	RunAt param.Field[string] `json:"run_at"`
	// The tool version to use (optional). If not provided, any version is used
	ToolVersion param.Field[string] `json:"tool_version"`
	UserID      param.Field[string] `json:"user_id"`
}

func (ExecuteToolRequestParam) MarshalJSON

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

type ExecuteToolResponse

type ExecuteToolResponse struct {
	ID            string                    `json:"id"`
	Duration      float64                   `json:"duration"`
	ExecutionID   string                    `json:"execution_id"`
	ExecutionType string                    `json:"execution_type"`
	FinishedAt    string                    `json:"finished_at"`
	Output        ExecuteToolResponseOutput `json:"output"`
	RunAt         string                    `json:"run_at"`
	Status        string                    `json:"status"`
	// Whether the request was successful. For immediately-executed requests, this will
	// be true if the tool call succeeded. For scheduled requests, this will be true if
	// the request was scheduled successfully.
	Success bool                    `json:"success"`
	JSON    executeToolResponseJSON `json:"-"`
}

func (*ExecuteToolResponse) UnmarshalJSON

func (r *ExecuteToolResponse) UnmarshalJSON(data []byte) (err error)

type ExecuteToolResponseOutput

type ExecuteToolResponseOutput struct {
	Authorization shared.AuthorizationResponse   `json:"authorization"`
	Error         ExecuteToolResponseOutputError `json:"error"`
	Logs          []ExecuteToolResponseOutputLog `json:"logs"`
	Value         interface{}                    `json:"value"`
	JSON          executeToolResponseOutputJSON  `json:"-"`
}

func (*ExecuteToolResponseOutput) UnmarshalJSON

func (r *ExecuteToolResponseOutput) UnmarshalJSON(data []byte) (err error)

type ExecuteToolResponseOutputError

type ExecuteToolResponseOutputError struct {
	Message                 string                             `json:"message,required"`
	AdditionalPromptContent string                             `json:"additional_prompt_content"`
	CanRetry                bool                               `json:"can_retry"`
	DeveloperMessage        string                             `json:"developer_message"`
	RetryAfterMs            int64                              `json:"retry_after_ms"`
	JSON                    executeToolResponseOutputErrorJSON `json:"-"`
}

func (*ExecuteToolResponseOutputError) UnmarshalJSON

func (r *ExecuteToolResponseOutputError) UnmarshalJSON(data []byte) (err error)

type ExecuteToolResponseOutputLog

type ExecuteToolResponseOutputLog struct {
	Level   string                           `json:"level,required"`
	Message string                           `json:"message,required"`
	Subtype string                           `json:"subtype"`
	JSON    executeToolResponseOutputLogJSON `json:"-"`
}

func (*ExecuteToolResponseOutputLog) UnmarshalJSON

func (r *ExecuteToolResponseOutputLog) UnmarshalJSON(data []byte) (err error)

type HealthSchema

type HealthSchema struct {
	Healthy bool             `json:"healthy"`
	JSON    healthSchemaJSON `json:"-"`
}

func (*HealthSchema) UnmarshalJSON

func (r *HealthSchema) UnmarshalJSON(data []byte) (err error)

type HealthService

type HealthService struct {
	Options []option.RequestOption
}

HealthService contains methods and other services that help with interacting with the Arcade 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 NewHealthService method instead.

func NewHealthService

func NewHealthService(opts ...option.RequestOption) (r *HealthService)

NewHealthService 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 (*HealthService) Check

func (r *HealthService) Check(ctx context.Context, opts ...option.RequestOption) (res *HealthSchema, err error)

Check if Arcade Engine is healthy

type SecretResponse

type SecretResponse struct {
	ID             string                `json:"id"`
	Binding        SecretResponseBinding `json:"binding"`
	CreatedAt      string                `json:"created_at"`
	Description    string                `json:"description"`
	Hint           string                `json:"hint"`
	Key            string                `json:"key"`
	LastAccessedAt string                `json:"last_accessed_at"`
	UpdatedAt      string                `json:"updated_at"`
	JSON           secretResponseJSON    `json:"-"`
}

func (*SecretResponse) UnmarshalJSON

func (r *SecretResponse) UnmarshalJSON(data []byte) (err error)

type SecretResponseBinding

type SecretResponseBinding struct {
	ID   string                    `json:"id"`
	Type SecretResponseBindingType `json:"type"`
	JSON secretResponseBindingJSON `json:"-"`
}

func (*SecretResponseBinding) UnmarshalJSON

func (r *SecretResponseBinding) UnmarshalJSON(data []byte) (err error)

type SecretResponseBindingType

type SecretResponseBindingType string
const (
	SecretResponseBindingTypeStatic  SecretResponseBindingType = "static"
	SecretResponseBindingTypeTenant  SecretResponseBindingType = "tenant"
	SecretResponseBindingTypeProject SecretResponseBindingType = "project"
	SecretResponseBindingTypeAccount SecretResponseBindingType = "account"
)

func (SecretResponseBindingType) IsKnown

func (r SecretResponseBindingType) IsKnown() bool

type ToolAuthorizeParams

type ToolAuthorizeParams struct {
	AuthorizeToolRequest AuthorizeToolRequestParam `json:"authorize_tool_request,required"`
}

func (ToolAuthorizeParams) MarshalJSON

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

type ToolDefinition

type ToolDefinition struct {
	FullyQualifiedName string                     `json:"fully_qualified_name,required"`
	Input              ToolDefinitionInput        `json:"input,required"`
	Name               string                     `json:"name,required"`
	QualifiedName      string                     `json:"qualified_name,required"`
	Toolkit            ToolDefinitionToolkit      `json:"toolkit,required"`
	Description        string                     `json:"description"`
	FormattedSchema    map[string]interface{}     `json:"formatted_schema"`
	Output             ToolDefinitionOutput       `json:"output"`
	Requirements       ToolDefinitionRequirements `json:"requirements"`
	JSON               toolDefinitionJSON         `json:"-"`
}

func (*ToolDefinition) UnmarshalJSON

func (r *ToolDefinition) UnmarshalJSON(data []byte) (err error)

type ToolDefinitionInput

type ToolDefinitionInput struct {
	Parameters []ToolDefinitionInputParameter `json:"parameters"`
	JSON       toolDefinitionInputJSON        `json:"-"`
}

func (*ToolDefinitionInput) UnmarshalJSON

func (r *ToolDefinitionInput) UnmarshalJSON(data []byte) (err error)

type ToolDefinitionInputParameter

type ToolDefinitionInputParameter struct {
	Name        string                           `json:"name,required"`
	ValueSchema ValueSchema                      `json:"value_schema,required"`
	Description string                           `json:"description"`
	Inferrable  bool                             `json:"inferrable"`
	Required    bool                             `json:"required"`
	JSON        toolDefinitionInputParameterJSON `json:"-"`
}

func (*ToolDefinitionInputParameter) UnmarshalJSON

func (r *ToolDefinitionInputParameter) UnmarshalJSON(data []byte) (err error)

type ToolDefinitionOutput

type ToolDefinitionOutput struct {
	AvailableModes []string                 `json:"available_modes"`
	Description    string                   `json:"description"`
	ValueSchema    ValueSchema              `json:"value_schema"`
	JSON           toolDefinitionOutputJSON `json:"-"`
}

func (*ToolDefinitionOutput) UnmarshalJSON

func (r *ToolDefinitionOutput) UnmarshalJSON(data []byte) (err error)

type ToolDefinitionRequirements

type ToolDefinitionRequirements struct {
	Authorization ToolDefinitionRequirementsAuthorization `json:"authorization"`
	Met           bool                                    `json:"met"`
	Secrets       []ToolDefinitionRequirementsSecret      `json:"secrets"`
	JSON          toolDefinitionRequirementsJSON          `json:"-"`
}

func (*ToolDefinitionRequirements) UnmarshalJSON

func (r *ToolDefinitionRequirements) UnmarshalJSON(data []byte) (err error)

type ToolDefinitionRequirementsAuthorization

type ToolDefinitionRequirementsAuthorization struct {
	ID           string                                             `json:"id"`
	Oauth2       ToolDefinitionRequirementsAuthorizationOauth2      `json:"oauth2"`
	ProviderID   string                                             `json:"provider_id"`
	ProviderType string                                             `json:"provider_type"`
	Status       ToolDefinitionRequirementsAuthorizationStatus      `json:"status"`
	StatusReason string                                             `json:"status_reason"`
	TokenStatus  ToolDefinitionRequirementsAuthorizationTokenStatus `json:"token_status"`
	JSON         toolDefinitionRequirementsAuthorizationJSON        `json:"-"`
}

func (*ToolDefinitionRequirementsAuthorization) UnmarshalJSON

func (r *ToolDefinitionRequirementsAuthorization) UnmarshalJSON(data []byte) (err error)

type ToolDefinitionRequirementsAuthorizationOauth2

type ToolDefinitionRequirementsAuthorizationOauth2 struct {
	Scopes []string                                          `json:"scopes"`
	JSON   toolDefinitionRequirementsAuthorizationOauth2JSON `json:"-"`
}

func (*ToolDefinitionRequirementsAuthorizationOauth2) UnmarshalJSON

func (r *ToolDefinitionRequirementsAuthorizationOauth2) UnmarshalJSON(data []byte) (err error)

type ToolDefinitionRequirementsAuthorizationStatus

type ToolDefinitionRequirementsAuthorizationStatus string
const (
	ToolDefinitionRequirementsAuthorizationStatusActive   ToolDefinitionRequirementsAuthorizationStatus = "active"
	ToolDefinitionRequirementsAuthorizationStatusInactive ToolDefinitionRequirementsAuthorizationStatus = "inactive"
)

func (ToolDefinitionRequirementsAuthorizationStatus) IsKnown

type ToolDefinitionRequirementsAuthorizationTokenStatus

type ToolDefinitionRequirementsAuthorizationTokenStatus string
const (
	ToolDefinitionRequirementsAuthorizationTokenStatusNotStarted ToolDefinitionRequirementsAuthorizationTokenStatus = "not_started"
	ToolDefinitionRequirementsAuthorizationTokenStatusPending    ToolDefinitionRequirementsAuthorizationTokenStatus = "pending"
	ToolDefinitionRequirementsAuthorizationTokenStatusCompleted  ToolDefinitionRequirementsAuthorizationTokenStatus = "completed"
	ToolDefinitionRequirementsAuthorizationTokenStatusFailed     ToolDefinitionRequirementsAuthorizationTokenStatus = "failed"
)

func (ToolDefinitionRequirementsAuthorizationTokenStatus) IsKnown

type ToolDefinitionRequirementsSecret

type ToolDefinitionRequirementsSecret struct {
	Key          string                               `json:"key,required"`
	Met          bool                                 `json:"met"`
	StatusReason string                               `json:"status_reason"`
	JSON         toolDefinitionRequirementsSecretJSON `json:"-"`
}

func (*ToolDefinitionRequirementsSecret) UnmarshalJSON

func (r *ToolDefinitionRequirementsSecret) UnmarshalJSON(data []byte) (err error)

type ToolDefinitionToolkit

type ToolDefinitionToolkit struct {
	Name        string                    `json:"name,required"`
	Description string                    `json:"description"`
	Version     string                    `json:"version"`
	JSON        toolDefinitionToolkitJSON `json:"-"`
}

func (*ToolDefinitionToolkit) UnmarshalJSON

func (r *ToolDefinitionToolkit) UnmarshalJSON(data []byte) (err error)

type ToolExecuteParams

type ToolExecuteParams struct {
	ExecuteToolRequest ExecuteToolRequestParam `json:"execute_tool_request,required"`
}

func (ToolExecuteParams) MarshalJSON

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

type ToolExecution

type ToolExecution struct {
	ID              string            `json:"id"`
	CreatedAt       string            `json:"created_at"`
	ExecutionStatus string            `json:"execution_status"`
	ExecutionType   string            `json:"execution_type"`
	FinishedAt      string            `json:"finished_at"`
	RunAt           string            `json:"run_at"`
	StartedAt       string            `json:"started_at"`
	ToolName        string            `json:"tool_name"`
	ToolkitName     string            `json:"toolkit_name"`
	ToolkitVersion  string            `json:"toolkit_version"`
	UpdatedAt       string            `json:"updated_at"`
	UserID          string            `json:"user_id"`
	JSON            toolExecutionJSON `json:"-"`
}

func (*ToolExecution) UnmarshalJSON

func (r *ToolExecution) UnmarshalJSON(data []byte) (err error)

type ToolExecutionAttempt

type ToolExecutionAttempt struct {
	ID                 string                     `json:"id"`
	FinishedAt         string                     `json:"finished_at"`
	Output             ToolExecutionAttemptOutput `json:"output"`
	StartedAt          string                     `json:"started_at"`
	Success            bool                       `json:"success"`
	SystemErrorMessage string                     `json:"system_error_message"`
	JSON               toolExecutionAttemptJSON   `json:"-"`
}

func (*ToolExecutionAttempt) UnmarshalJSON

func (r *ToolExecutionAttempt) UnmarshalJSON(data []byte) (err error)

type ToolExecutionAttemptOutput

type ToolExecutionAttemptOutput struct {
	Authorization shared.AuthorizationResponse    `json:"authorization"`
	Error         ToolExecutionAttemptOutputError `json:"error"`
	Logs          []ToolExecutionAttemptOutputLog `json:"logs"`
	Value         interface{}                     `json:"value"`
	JSON          toolExecutionAttemptOutputJSON  `json:"-"`
}

func (*ToolExecutionAttemptOutput) UnmarshalJSON

func (r *ToolExecutionAttemptOutput) UnmarshalJSON(data []byte) (err error)

type ToolExecutionAttemptOutputError

type ToolExecutionAttemptOutputError struct {
	Message                 string                              `json:"message,required"`
	AdditionalPromptContent string                              `json:"additional_prompt_content"`
	CanRetry                bool                                `json:"can_retry"`
	DeveloperMessage        string                              `json:"developer_message"`
	RetryAfterMs            int64                               `json:"retry_after_ms"`
	JSON                    toolExecutionAttemptOutputErrorJSON `json:"-"`
}

func (*ToolExecutionAttemptOutputError) UnmarshalJSON

func (r *ToolExecutionAttemptOutputError) UnmarshalJSON(data []byte) (err error)

type ToolExecutionAttemptOutputLog

type ToolExecutionAttemptOutputLog struct {
	Level   string                            `json:"level,required"`
	Message string                            `json:"message,required"`
	Subtype string                            `json:"subtype"`
	JSON    toolExecutionAttemptOutputLogJSON `json:"-"`
}

func (*ToolExecutionAttemptOutputLog) UnmarshalJSON

func (r *ToolExecutionAttemptOutputLog) UnmarshalJSON(data []byte) (err error)

type ToolFormattedGetParams

type ToolFormattedGetParams struct {
	// Provider format
	Format param.Field[string] `query:"format"`
	// User ID
	UserID param.Field[string] `query:"user_id"`
}

func (ToolFormattedGetParams) URLQuery

func (r ToolFormattedGetParams) URLQuery() (v url.Values)

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

type ToolFormattedGetResponse

type ToolFormattedGetResponse = interface{}

type ToolFormattedListParams

type ToolFormattedListParams struct {
	// Provider format
	Format param.Field[string] `query:"format"`
	// Number of items to return (default: 25, max: 100)
	Limit param.Field[int64] `query:"limit"`
	// Offset from the start of the list (default: 0)
	Offset param.Field[int64] `query:"offset"`
	// Toolkit name
	Toolkit param.Field[string] `query:"toolkit"`
	// User ID
	UserID param.Field[string] `query:"user_id"`
}

func (ToolFormattedListParams) URLQuery

func (r ToolFormattedListParams) URLQuery() (v url.Values)

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

type ToolFormattedListResponse

type ToolFormattedListResponse = interface{}

type ToolFormattedService

type ToolFormattedService struct {
	Options []option.RequestOption
}

ToolFormattedService contains methods and other services that help with interacting with the Arcade 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 NewToolFormattedService method instead.

func NewToolFormattedService

func NewToolFormattedService(opts ...option.RequestOption) (r *ToolFormattedService)

NewToolFormattedService 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 (*ToolFormattedService) Get

Returns the formatted tool specification for a specific tool, given a provider

func (*ToolFormattedService) List

Returns a page of tools from the engine configuration, optionally filtered by toolkit, formatted for a specific provider

func (*ToolFormattedService) ListAutoPaging

Returns a page of tools from the engine configuration, optionally filtered by toolkit, formatted for a specific provider

type ToolGetParams

type ToolGetParams struct {
	// Comma separated tool formats that will be included in the response.
	IncludeFormat param.Field[[]ToolGetParamsIncludeFormat] `query:"include_format"`
	// User ID
	UserID param.Field[string] `query:"user_id"`
}

func (ToolGetParams) URLQuery

func (r ToolGetParams) URLQuery() (v url.Values)

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

type ToolGetParamsIncludeFormat

type ToolGetParamsIncludeFormat string
const (
	ToolGetParamsIncludeFormatArcade    ToolGetParamsIncludeFormat = "arcade"
	ToolGetParamsIncludeFormatOpenAI    ToolGetParamsIncludeFormat = "openai"
	ToolGetParamsIncludeFormatAnthropic ToolGetParamsIncludeFormat = "anthropic"
)

func (ToolGetParamsIncludeFormat) IsKnown

func (r ToolGetParamsIncludeFormat) IsKnown() bool

type ToolListParams

type ToolListParams struct {
	// Comma separated tool formats that will be included in the response.
	IncludeFormat param.Field[[]ToolListParamsIncludeFormat] `query:"include_format"`
	// Number of items to return (default: 25, max: 100)
	Limit param.Field[int64] `query:"limit"`
	// Offset from the start of the list (default: 0)
	Offset param.Field[int64] `query:"offset"`
	// Toolkit name
	Toolkit param.Field[string] `query:"toolkit"`
	// User ID
	UserID param.Field[string] `query:"user_id"`
}

func (ToolListParams) URLQuery

func (r ToolListParams) URLQuery() (v url.Values)

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

type ToolListParamsIncludeFormat

type ToolListParamsIncludeFormat string
const (
	ToolListParamsIncludeFormatArcade    ToolListParamsIncludeFormat = "arcade"
	ToolListParamsIncludeFormatOpenAI    ToolListParamsIncludeFormat = "openai"
	ToolListParamsIncludeFormatAnthropic ToolListParamsIncludeFormat = "anthropic"
)

func (ToolListParamsIncludeFormat) IsKnown

func (r ToolListParamsIncludeFormat) IsKnown() bool

type ToolScheduledGetResponse

type ToolScheduledGetResponse struct {
	ID              string                       `json:"id"`
	Attempts        []ToolExecutionAttempt       `json:"attempts"`
	CreatedAt       string                       `json:"created_at"`
	ExecutionStatus string                       `json:"execution_status"`
	ExecutionType   string                       `json:"execution_type"`
	FinishedAt      string                       `json:"finished_at"`
	Input           map[string]interface{}       `json:"input"`
	RunAt           string                       `json:"run_at"`
	StartedAt       string                       `json:"started_at"`
	ToolName        string                       `json:"tool_name"`
	ToolkitName     string                       `json:"toolkit_name"`
	ToolkitVersion  string                       `json:"toolkit_version"`
	UpdatedAt       string                       `json:"updated_at"`
	UserID          string                       `json:"user_id"`
	JSON            toolScheduledGetResponseJSON `json:"-"`
}

func (*ToolScheduledGetResponse) UnmarshalJSON

func (r *ToolScheduledGetResponse) UnmarshalJSON(data []byte) (err error)

type ToolScheduledListParams

type ToolScheduledListParams struct {
	// Number of items to return (default: 25, max: 100)
	Limit param.Field[int64] `query:"limit"`
	// Offset from the start of the list (default: 0)
	Offset param.Field[int64] `query:"offset"`
}

func (ToolScheduledListParams) URLQuery

func (r ToolScheduledListParams) URLQuery() (v url.Values)

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

type ToolScheduledService

type ToolScheduledService struct {
	Options []option.RequestOption
}

ToolScheduledService contains methods and other services that help with interacting with the Arcade 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 NewToolScheduledService method instead.

func NewToolScheduledService

func NewToolScheduledService(opts ...option.RequestOption) (r *ToolScheduledService)

NewToolScheduledService 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 (*ToolScheduledService) Get

Returns the details for a specific scheduled tool execution

func (*ToolScheduledService) List

Returns a page of scheduled tool executions

func (*ToolScheduledService) ListAutoPaging

Returns a page of scheduled tool executions

type ToolService

type ToolService struct {
	Options   []option.RequestOption
	Scheduled *ToolScheduledService
	Formatted *ToolFormattedService
}

ToolService contains methods and other services that help with interacting with the Arcade 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 NewToolService method instead.

func NewToolService

func NewToolService(opts ...option.RequestOption) (r *ToolService)

NewToolService 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 (*ToolService) Authorize

Authorizes a user for a specific tool by name

func (*ToolService) Execute

func (r *ToolService) Execute(ctx context.Context, body ToolExecuteParams, opts ...option.RequestOption) (res *ExecuteToolResponse, err error)

Executes a tool by name and arguments

func (*ToolService) Get

func (r *ToolService) Get(ctx context.Context, name string, query ToolGetParams, opts ...option.RequestOption) (res *ToolDefinition, err error)

Returns the arcade tool specification for a specific tool

func (*ToolService) List

Returns a page of tools from the engine configuration, optionally filtered by toolkit

func (*ToolService) ListAutoPaging

Returns a page of tools from the engine configuration, optionally filtered by toolkit

type UpdateWorkerRequestHTTPParam

type UpdateWorkerRequestHTTPParam struct {
	Retry   param.Field[int64]  `json:"retry"`
	Secret  param.Field[string] `json:"secret"`
	Timeout param.Field[int64]  `json:"timeout"`
	Uri     param.Field[string] `json:"uri"`
}

func (UpdateWorkerRequestHTTPParam) MarshalJSON

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

type UpdateWorkerRequestMcpParam

type UpdateWorkerRequestMcpParam struct {
	Retry   param.Field[int64]  `json:"retry"`
	Timeout param.Field[int64]  `json:"timeout"`
	Uri     param.Field[string] `json:"uri"`
}

func (UpdateWorkerRequestMcpParam) MarshalJSON

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

type UpdateWorkerRequestParam

type UpdateWorkerRequestParam struct {
	Enabled param.Field[bool]                         `json:"enabled"`
	HTTP    param.Field[UpdateWorkerRequestHTTPParam] `json:"http"`
	Mcp     param.Field[UpdateWorkerRequestMcpParam]  `json:"mcp"`
}

func (UpdateWorkerRequestParam) MarshalJSON

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

type Usage

type Usage struct {
	CompletionTokens int64     `json:"completion_tokens"`
	PromptTokens     int64     `json:"prompt_tokens"`
	TotalTokens      int64     `json:"total_tokens"`
	JSON             usageJSON `json:"-"`
}

func (*Usage) UnmarshalJSON

func (r *Usage) UnmarshalJSON(data []byte) (err error)

type UserConnectionResponse

type UserConnectionResponse struct {
	ID                  string                     `json:"id"`
	ConnectionID        string                     `json:"connection_id"`
	ConnectionStatus    string                     `json:"connection_status"`
	ProviderDescription string                     `json:"provider_description"`
	ProviderID          string                     `json:"provider_id"`
	ProviderUserInfo    interface{}                `json:"provider_user_info"`
	Scopes              []string                   `json:"scopes"`
	UserID              string                     `json:"user_id"`
	JSON                userConnectionResponseJSON `json:"-"`
}

func (*UserConnectionResponse) UnmarshalJSON

func (r *UserConnectionResponse) UnmarshalJSON(data []byte) (err error)

type ValueSchema

type ValueSchema struct {
	ValType      string          `json:"val_type,required"`
	Enum         []string        `json:"enum"`
	InnerValType string          `json:"inner_val_type"`
	JSON         valueSchemaJSON `json:"-"`
}

func (*ValueSchema) UnmarshalJSON

func (r *ValueSchema) UnmarshalJSON(data []byte) (err error)

type WorkerHealthResponse

type WorkerHealthResponse struct {
	ID      string                   `json:"id"`
	Enabled bool                     `json:"enabled"`
	Healthy bool                     `json:"healthy"`
	Message string                   `json:"message"`
	JSON    workerHealthResponseJSON `json:"-"`
}

func (*WorkerHealthResponse) UnmarshalJSON

func (r *WorkerHealthResponse) UnmarshalJSON(data []byte) (err error)

type WorkerListParams

type WorkerListParams struct {
	// Number of items to return (default: 25, max: 100)
	Limit param.Field[int64] `query:"limit"`
	// Offset from the start of the list (default: 0)
	Offset param.Field[int64] `query:"offset"`
}

func (WorkerListParams) URLQuery

func (r WorkerListParams) URLQuery() (v url.Values)

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

type WorkerNewParams

type WorkerNewParams struct {
	CreateWorkerRequest CreateWorkerRequestParam `json:"create_worker_request,required"`
}

func (WorkerNewParams) MarshalJSON

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

type WorkerResponse

type WorkerResponse struct {
	ID      string                `json:"id"`
	Binding WorkerResponseBinding `json:"binding"`
	Enabled bool                  `json:"enabled"`
	HTTP    WorkerResponseHTTP    `json:"http"`
	Mcp     WorkerResponseMcp     `json:"mcp"`
	Oxp     WorkerResponseOxp     `json:"oxp"`
	Type    WorkerResponseType    `json:"type"`
	JSON    workerResponseJSON    `json:"-"`
}

func (*WorkerResponse) UnmarshalJSON

func (r *WorkerResponse) UnmarshalJSON(data []byte) (err error)

type WorkerResponseBinding

type WorkerResponseBinding struct {
	ID   string                    `json:"id"`
	Type WorkerResponseBindingType `json:"type"`
	JSON workerResponseBindingJSON `json:"-"`
}

func (*WorkerResponseBinding) UnmarshalJSON

func (r *WorkerResponseBinding) UnmarshalJSON(data []byte) (err error)

type WorkerResponseBindingType

type WorkerResponseBindingType string
const (
	WorkerResponseBindingTypeStatic  WorkerResponseBindingType = "static"
	WorkerResponseBindingTypeTenant  WorkerResponseBindingType = "tenant"
	WorkerResponseBindingTypeProject WorkerResponseBindingType = "project"
	WorkerResponseBindingTypeAccount WorkerResponseBindingType = "account"
)

func (WorkerResponseBindingType) IsKnown

func (r WorkerResponseBindingType) IsKnown() bool

type WorkerResponseHTTP

type WorkerResponseHTTP struct {
	Retry   int64                    `json:"retry"`
	Secret  WorkerResponseHTTPSecret `json:"secret"`
	Timeout int64                    `json:"timeout"`
	Uri     string                   `json:"uri"`
	JSON    workerResponseHTTPJSON   `json:"-"`
}

func (*WorkerResponseHTTP) UnmarshalJSON

func (r *WorkerResponseHTTP) UnmarshalJSON(data []byte) (err error)

type WorkerResponseHTTPSecret

type WorkerResponseHTTPSecret struct {
	Binding  WorkerResponseHTTPSecretBinding `json:"binding"`
	Editable bool                            `json:"editable"`
	Exists   bool                            `json:"exists"`
	Hint     string                          `json:"hint"`
	Value    string                          `json:"value"`
	JSON     workerResponseHTTPSecretJSON    `json:"-"`
}

func (*WorkerResponseHTTPSecret) UnmarshalJSON

func (r *WorkerResponseHTTPSecret) UnmarshalJSON(data []byte) (err error)

type WorkerResponseHTTPSecretBinding

type WorkerResponseHTTPSecretBinding string
const (
	WorkerResponseHTTPSecretBindingStatic  WorkerResponseHTTPSecretBinding = "static"
	WorkerResponseHTTPSecretBindingTenant  WorkerResponseHTTPSecretBinding = "tenant"
	WorkerResponseHTTPSecretBindingProject WorkerResponseHTTPSecretBinding = "project"
	WorkerResponseHTTPSecretBindingAccount WorkerResponseHTTPSecretBinding = "account"
)

func (WorkerResponseHTTPSecretBinding) IsKnown

type WorkerResponseMcp

type WorkerResponseMcp struct {
	Retry   int64                 `json:"retry"`
	Timeout int64                 `json:"timeout"`
	Uri     string                `json:"uri"`
	JSON    workerResponseMcpJSON `json:"-"`
}

func (*WorkerResponseMcp) UnmarshalJSON

func (r *WorkerResponseMcp) UnmarshalJSON(data []byte) (err error)

type WorkerResponseOxp

type WorkerResponseOxp struct {
	Retry   int64                   `json:"retry"`
	Secret  WorkerResponseOxpSecret `json:"secret"`
	Timeout int64                   `json:"timeout"`
	Uri     string                  `json:"uri"`
	JSON    workerResponseOxpJSON   `json:"-"`
}

func (*WorkerResponseOxp) UnmarshalJSON

func (r *WorkerResponseOxp) UnmarshalJSON(data []byte) (err error)

type WorkerResponseOxpSecret

type WorkerResponseOxpSecret struct {
	Binding  WorkerResponseOxpSecretBinding `json:"binding"`
	Editable bool                           `json:"editable"`
	Exists   bool                           `json:"exists"`
	Hint     string                         `json:"hint"`
	Value    string                         `json:"value"`
	JSON     workerResponseOxpSecretJSON    `json:"-"`
}

func (*WorkerResponseOxpSecret) UnmarshalJSON

func (r *WorkerResponseOxpSecret) UnmarshalJSON(data []byte) (err error)

type WorkerResponseOxpSecretBinding

type WorkerResponseOxpSecretBinding string
const (
	WorkerResponseOxpSecretBindingStatic  WorkerResponseOxpSecretBinding = "static"
	WorkerResponseOxpSecretBindingTenant  WorkerResponseOxpSecretBinding = "tenant"
	WorkerResponseOxpSecretBindingProject WorkerResponseOxpSecretBinding = "project"
	WorkerResponseOxpSecretBindingAccount WorkerResponseOxpSecretBinding = "account"
)

func (WorkerResponseOxpSecretBinding) IsKnown

type WorkerResponseType

type WorkerResponseType string
const (
	WorkerResponseTypeHTTP    WorkerResponseType = "http"
	WorkerResponseTypeMcp     WorkerResponseType = "mcp"
	WorkerResponseTypeUnknown WorkerResponseType = "unknown"
)

func (WorkerResponseType) IsKnown

func (r WorkerResponseType) IsKnown() bool

type WorkerService

type WorkerService struct {
	Options []option.RequestOption
}

WorkerService contains methods and other services that help with interacting with the Arcade 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 NewWorkerService method instead.

func NewWorkerService

func NewWorkerService(opts ...option.RequestOption) (r *WorkerService)

NewWorkerService 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 (*WorkerService) Delete

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

Delete a worker

func (*WorkerService) Get

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

Get a worker by ID

func (*WorkerService) Health

func (r *WorkerService) Health(ctx context.Context, id string, opts ...option.RequestOption) (res *WorkerHealthResponse, err error)

Get the health of a worker

func (*WorkerService) List

List all workers with their definitions

func (*WorkerService) ListAutoPaging

List all workers with their definitions

func (*WorkerService) New

func (r *WorkerService) New(ctx context.Context, body WorkerNewParams, opts ...option.RequestOption) (res *WorkerResponse, err error)

Create a worker

func (*WorkerService) Tools

Returns a page of tools

func (*WorkerService) ToolsAutoPaging

Returns a page of tools

func (*WorkerService) Update

func (r *WorkerService) Update(ctx context.Context, id string, body WorkerUpdateParams, opts ...option.RequestOption) (res *WorkerResponse, err error)

Update a worker

type WorkerToolsParams

type WorkerToolsParams struct {
	// Number of items to return (default: 25, max: 100)
	Limit param.Field[int64] `query:"limit"`
	// Offset from the start of the list (default: 0)
	Offset param.Field[int64] `query:"offset"`
}

func (WorkerToolsParams) URLQuery

func (r WorkerToolsParams) URLQuery() (v url.Values)

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

type WorkerUpdateParams

type WorkerUpdateParams struct {
	UpdateWorkerRequest UpdateWorkerRequestParam `json:"update_worker_request,required"`
}

func (WorkerUpdateParams) MarshalJSON

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

Directories

Path Synopsis
packages

Jump to

Keyboard shortcuts

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