truto

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

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 15 Imported by: 0

README

truto-go-sdk

Go client for the Truto API. It covers the Unified, Proxy and Custom APIs, MCP, and the admin API (integrated accounts, integrations, sync jobs, webhooks, and the rest). Admin resources use typed models generated from Truto's OpenAPI spec.

  • Go 1.23 or later, standard library only
  • Retries with backoff, Retry-After support and per-request timeouts
  • Cursor pagination as an iterator, including range-over-func
  • Typed errors with the API's status and body

Install

go get github.com/trutohq/truto-go-sdk
import truto "github.com/trutohq/truto-go-sdk"

Quick start

ctx := context.Background()
client := truto.NewClient(os.Getenv("TRUTO_API_TOKEN"))

// Admin API: typed models
accounts, err := client.IntegratedAccounts.List(ctx,
	truto.WithQuery(truto.Params{"tenant_id": "acme"})).All()
if err != nil {
	log.Fatal(err)
}
for _, a := range accounts {
	fmt.Println(*a.ID, *a.Status)
}

Every method takes a context.Context first and accepts Options last. Options passed to NewClient apply to every call. Options passed to a method apply to that call only.

Option What it does
WithQuery(truto.Params{...}) Query parameters. Nested maps and slices are encoded the way the API expects (filter[status]=open, ids[0]=a).
WithTimeout(d) Time limit per attempt (default 30s).
WithMaxRetries(n) / WithNoRetry() Number of retries (default 3), or none.
WithRetryStatusCodes(codes...) Extra status codes to retry.
WithOnRetry(fn) / WithOnRateLimited(fn) Hooks called before a retry or a rate-limit wait.
WithHeader(k, v) Extra request header.
WithBaseURL(url), WithHTTPClient(c), WithDefaultRetryAfter(d) Client setup.

Unified API

contacts := client.Unified.List(ctx, truto.UnifiedResource{
	Model:               "crm",
	Resource:            "contacts",
	IntegratedAccountID: "ia_123",
}, truto.WithQuery(truto.Params{"limit": 50}))

for record, err := range contacts.Seq() {
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(record["id"], record["first_name"])
}

Unified, Proxy and Custom API results depend on the integration, so they come back as truto.Record (map[string]any). Use truto.Decode to convert a record into your own type:

type Contact struct {
	ID        string `json:"id"`
	FirstName string `json:"first_name"`
}

c, err := truto.Decode[Contact](record)
all, err := truto.DecodeAll[Contact](records)

Other unified calls: Get, Create, Update, Delete, CustomMethod, Meta and ModelMeta.

Proxy API

deals := truto.ProxyResource{Resource: "deals", IntegratedAccountID: "ia_123"}

deal, err := client.Proxy.Get(ctx, deals, "42")
_, err = client.Proxy.Update(ctx, deals, "42", map[string]any{"stage": "won"})
_, err = client.Proxy.CustomMethod(ctx, deals, "merge", map[string]any{"ids": []string{"1", "2"}})

Custom API

A custom endpoint can return anything, so these calls return the raw response:

res, err := client.Custom.Get(ctx, "ia_123", "/reports/monthly")
fmt.Println(res.ContentType, string(res.Body))

Pagination

List methods return a lazy *truto.Iterator[T]. No request is sent until you read from it.

it := client.SyncJobRuns.List(ctx, truto.WithQuery(truto.Params{"sync_job_id": "sj_1"}))

all, err := it.All()                // every item from every page
first, err := it.First()            // first item, or truto.Done if there are none
page, err := it.NextPage()          // one page: page.Items, page.NextCursor
item, err := it.Next()              // one item at a time; truto.Done at the end
for run, err := range it.Seq() {}   // range-over-func

Errors

_, err := client.IntegratedAccounts.Get(ctx, "missing")

var apiErr *truto.Error
switch {
case truto.IsNotFound(err):          // also IsUnauthorized, IsRateLimited
case errors.Is(err, truto.ErrTimeout):
case errors.As(err, &apiErr):
	fmt.Println(apiErr.StatusCode, apiErr.Message(), apiErr.Body)
}

*truto.Error carries the status code, the parsed body (Body), the raw body (RawBody) and the response headers.

Retries

These statuses are retried: 408, 409, 425, 429, 502, 503 and 504, plus any added with WithRetryStatusCodes. Network errors are also retried. Timeouts are not.

  • A 429 waits for the Retry-After header (10s by default when the header is missing).
  • Other retryable statuses wait with exponential backoff and jitter, starting at 500ms and capped at 10s.

The request body is sent again on every attempt.

Typed models

Admin API types such as truto.IntegratedAccountResponse, truto.SyncJobCreateRequest and truto.WebhookSchema are generated from spec/openapi.json into models_gen.go. Their behaviour:

  • Optional fields are pointers. Use truto.Ptr to set them: truto.TenantUpdateRequest{Name: truto.Ptr("Acme")}.
  • Enums are open string types with constants, such as truto.IntegratedAccountStatus and truto.IntegratedAccountAuthenticationMethodOAuth2. A value the SDK doesn't know yet still decodes unchanged.
  • Union types (for example truto.DatastoreConfig) hold raw JSON. Decode a specific shape with the As... methods, such as cfg.AsDatastoreS3Config(), and build one with truto.DatastoreConfigFrom....
  • Unknown JSON fields are ignored, so new API fields don't break decoding.

Resources that the spec doesn't describe yet use truto.Record. These are teams, users, sandbox integrated accounts, daemons, daemon jobs and runs, and some request bodies.

Where the published spec doesn't match what the API returns, the fix lives in spec/overlay.json, an OpenAPI Overlay applied before generation. For example, resource-method body is typed as any JSON value, because some integrations send an array there. Header maps use map[string]*string, because a null value means "remove the inherited header".

To regenerate the models after updating spec/openapi.json or spec/overlay.json (needs Python 3):

go generate ./...

Calling any endpoint

For an endpoint the SDK doesn't wrap yet:

var out map[string]any
err := client.Do(ctx, "GET", "/some/path", nil, &out, truto.WithQuery(truto.Params{"a": 1}))

Examples

See examples/: Unified API listing with typed decoding, the Proxy API, link tokens, and error and retry handling.

Development

go test ./...
go vet ./...

The query-string encoder is tested against testdata/qs_cases.json. Those cases were generated with the qs library that the Truto API uses to parse query strings.

License

MIT

Documentation

Overview

Package truto is a Go client for the Truto API (https://truto.one).

Create a client with an API token and call the API through its services:

client := truto.NewClient(os.Getenv("TRUTO_API_TOKEN"))
accounts, err := client.IntegratedAccounts.List(ctx,
	truto.WithQuery(truto.Params{"tenant_id": "acme"})).All()

Admin resources (integrated accounts, sync jobs, webhooks, ...) use the typed models generated from Truto's OpenAPI spec. The Unified, Proxy and Custom APIs return Record values, since their shape depends on the integration; use Decode to turn them into your own types.

Every method accepts Options that override the client settings for that call, for example WithQuery, WithTimeout, WithNoRetry or WithHeader.

Index

Constants

View Source
const (
	DefaultBaseURL    = "https://api.truto.one"
	DefaultTimeout    = 30 * time.Second
	DefaultMaxRetries = 3
	DefaultRetryAfter = 10 * time.Second
)

Defaults used when no option overrides them.

View Source
const MCPProtocolVersion = "2024-11-05"

MCPProtocolVersion is the protocol version sent by Initialize.

View Source
const Version = "0.1.0"

Version is the SDK version, sent in the User-Agent header.

Variables

View Source
var Done = errors.New("truto: no more items")

Done is returned by Iterator.Next when there are no more items. The name follows google.golang.org/api/iterator.Done, so loops read naturally.

View Source
var ErrTimeout = errors.New("truto: request timed out")

ErrTimeout is matched (with errors.Is) by the error returned when a request attempt runs longer than the configured timeout.

Functions

func Decode

func Decode[T any](v any) (T, error)

Decode converts v (usually a Record) into T by round-tripping it through JSON.

type Contact struct{ ID string `json:"id"`; FirstName string `json:"first_name"` }
c, err := truto.Decode[Contact](record)

func DecodeAll

func DecodeAll[T any](records []Record) ([]T, error)

DecodeAll converts each element of records into T.

func IsNotFound

func IsNotFound(err error) bool

IsNotFound reports whether err is a Truto API 404.

func IsRateLimited

func IsRateLimited(err error) bool

IsRateLimited reports whether err is a Truto API 429 (after retries ran out).

func IsUnauthorized

func IsUnauthorized(err error) bool

IsUnauthorized reports whether err is a Truto API 401.

func Ptr

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

Ptr returns a pointer to v. Optional fields in request types are pointers:

truto.TenantUpdateRequest{Name: truto.Ptr("Acme")}

Types

type APITokensService

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

APITokensService manages API tokens of the environment.

func (*APITokensService) Get

func (s *APITokensService) Get(ctx context.Context, id string, opts ...Option) (*ApiTokenResponse, error)

Get fetches one item by ID.

func (*APITokensService) List

List returns an iterator over the items. Filter with WithQuery.

type AnalyticsBreakdownResponse

type AnalyticsBreakdownResponse struct {
	EnvironmentID *string                              `json:"environment_id,omitempty"`
	Metric        *string                              `json:"metric,omitempty"`
	Dimension     *string                              `json:"dimension,omitempty"`
	From          *string                              `json:"from,omitempty"`
	To            *string                              `json:"to,omitempty"`
	Rows          []AnalyticsBreakdownResponseRowsItem `json:"rows,omitempty"`
	NextCursor    *string                              `json:"next_cursor,omitempty"`
}

AnalyticsBreakdownResponse is a Truto API object.

type AnalyticsBreakdownResponseRowsItem

type AnalyticsBreakdownResponseRowsItem struct {
	Key           *string  `json:"key,omitempty"`
	Value         *float64 `json:"value,omitempty"`
	Numerator     *float64 `json:"numerator,omitempty"`
	Denominator   *float64 `json:"denominator,omitempty"`
	Integration   *string  `json:"integration,omitempty"`
	Calls         *int64   `json:"calls,omitempty"`
	Errors        *int64   `json:"errors,omitempty"`
	LastActiveDay *string  `json:"last_active_day,omitempty"`
	// When the account was last seen in the range (UTC), for `dimension=integrated_account`.
	LastActiveAt *string `json:"last_active_at,omitempty"`
	TenantID     *string `json:"tenant_id,omitempty"`
	// The account's current status (not its status during the range).
	Status *string `json:"status,omitempty"`
	// The account's `context.label` (who or what it belongs to), for `dimension=integrated_account`. `null` when the account has no text label.
	Label *string `json:"label,omitempty"`
}

AnalyticsBreakdownResponseRowsItem is a Truto API object.

type AnalyticsDashboardKpi

type AnalyticsDashboardKpi struct {
	// Null when there is nothing to measure, e.g. a rate with no requests behind it.
	Value *float64 `json:"value,omitempty"`
	// The same figure for the span of equal length just before the range (ending at the same time of day); null when that span is not inside the 90-day window, and for numbers that describe the accounts as they are now.
	Previous *float64 `json:"previous,omitempty"`
	// One value per day of the range (null for a rate or latency with no requests that day); empty for numbers that describe the accounts as they are now.
	Series []float64 `json:"series,omitempty"`
}

AnalyticsDashboardKpi is a Truto API object.

type AnalyticsDashboardResponse

type AnalyticsDashboardResponse struct {
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The named range shown, or `custom` for `from` / `to`.
	Range *AnalyticsDashboardResponseRange `json:"range,omitempty"`
	// The days analytics can show (the last 90 days, up to today).
	Window *AnalyticsDashboardResponseWindow `json:"window,omitempty"`
	// How long the parts of this response are cached.
	CacheSeconds *int64 `json:"cache_seconds,omitempty"`
	// The page filters applied, as sent.
	Filters  map[string]string                   `json:"filters,omitempty"`
	From     *string                             `json:"from,omitempty"`
	To       *string                             `json:"to,omitempty"`
	Previous *AnalyticsDashboardResponsePrevious `json:"previous,omitempty"`
	Buckets  []string                            `json:"buckets,omitempty"`
	// When the numbers were read. Responses are cached for 6 hours, so a range that includes today shows today as of this time.
	GeneratedAt *string `json:"generated_at,omitempty"`
	// Each headline number for the range, the span of the same length before it, and a daily series. `accounts`, `active_accounts` and `active_integrations` describe the accounts as they are now, so they have no previous value or series.
	Kpis       *AnalyticsDashboardResponseKpis            `json:"kpis,omitempty"`
	ByCategory []AnalyticsDashboardResponseByCategoryItem `json:"by_category,omitempty"`
	// The environment's integrations and integrated accounts as they are now (sandbox accounts excluded).
	Inventory *AnalyticsDashboardResponseInventory `json:"inventory,omitempty"`
	// Integrated account lifecycle events in the range, from the logs (for example `created`, `updated`, `deleted`).
	AccountEvents []AnalyticsDashboardResponseAccountEventsItem `json:"account_events,omitempty"`
	// Every integration with API calls in the range or integrated accounts now, by API calls.
	Integrations []AnalyticsDashboardResponseIntegrationsItem `json:"integrations,omitempty"`
	// API calls per day (as billing counts them), aligned with `buckets`. `null` when it could not be loaded.
	APICalls *AnalyticsDashboardResponseApiCalls `json:"api_calls,omitempty"`
	// p95 latency per day in ms, total and waiting on the provider; `null` on a day without requests.
	LatencyP95 *AnalyticsDashboardResponseLatencyP95 `json:"latency_p95,omitempty"`
	// API calls per hour (UTC) over the last 7 days of the range; an hour later today is `null`.
	HourlyAPICalls *AnalyticsDashboardResponseHourlyApiCalls `json:"hourly_api_calls,omitempty"`
	// API requests by HTTP status class (`2`, `4`, `5`, ...), largest first.
	StatusCodes []AnalyticsDashboardResponseStatusCodesItem `json:"status_codes,omitempty"`
	// The integrations with the most requests that returned HTTP 400 or above. An empty `key` is calls with no integration (Admin API calls, and requests that failed before an integration was known).
	ErrorsByIntegration []AnalyticsDashboardResponseErrorsByIntegrationItem `json:"errors_by_integration,omitempty"`
	// One page of the integrated accounts with the most API calls in the range. Only accounts that still exist are listed.
	Accounts *AnalyticsDashboardResponseAccounts `json:"accounts,omitempty"`
	// Parts that could not be loaded right now and are `null` (`api_calls`, `latency`, `hourly_api_calls`, `status_codes`, `errors_by_integration`, `accounts`).
	Unavailable []string `json:"unavailable,omitempty"`
}

AnalyticsDashboardResponse is a Truto API object.

type AnalyticsDashboardResponseAccountEventsItem

type AnalyticsDashboardResponseAccountEventsItem struct {
	Event *string `json:"event,omitempty"`
	Count *int64  `json:"count,omitempty"`
}

AnalyticsDashboardResponseAccountEventsItem is a Truto API object.

type AnalyticsDashboardResponseAccounts

type AnalyticsDashboardResponseAccounts struct {
	Rows []AnalyticsDashboardResponseAccountsRowsItem `json:"rows,omitempty"`
	// Pass as `accounts_cursor` for the next page.
	NextCursor *string `json:"next_cursor,omitempty"`
	Search     *string `json:"search,omitempty"`
}

One page of the integrated accounts with the most API calls in the range. Only accounts that still exist are listed.

type AnalyticsDashboardResponseAccountsRowsItem

type AnalyticsDashboardResponseAccountsRowsItem struct {
	// The integrated account id.
	Key *string `json:"key,omitempty"`
	// API calls.
	Value         *float64 `json:"value,omitempty"`
	Integration   *string  `json:"integration,omitempty"`
	Calls         *int64   `json:"calls,omitempty"`
	Errors        *int64   `json:"errors,omitempty"`
	LastActiveDay *string  `json:"last_active_day,omitempty"`
	LastActiveAt  *string  `json:"last_active_at,omitempty"`
	TenantID      *string  `json:"tenant_id,omitempty"`
	Status        *string  `json:"status,omitempty"`
	// The account's `context.label`, when it is text.
	Label *string `json:"label,omitempty"`
}

AnalyticsDashboardResponseAccountsRowsItem is a Truto API object.

type AnalyticsDashboardResponseApiCalls

type AnalyticsDashboardResponseApiCalls struct {
	Buckets       []string                                              `json:"buckets,omitempty"`
	Total         []AnalyticsDashboardResponseApiCallsTotalItem         `json:"total,omitempty"`
	ByCategory    []AnalyticsDashboardResponseApiCallsByCategoryItem    `json:"by_category,omitempty"`
	ByIntegration []AnalyticsDashboardResponseApiCallsByIntegrationItem `json:"by_integration,omitempty"`
}

API calls per day (as billing counts them), aligned with `buckets`. `null` when it could not be loaded.

type AnalyticsDashboardResponseApiCallsByCategoryItem

type AnalyticsDashboardResponseApiCallsByCategoryItem struct {
	Key    *string   `json:"key,omitempty"`
	Values []float64 `json:"values,omitempty"`
	Total  *float64  `json:"total,omitempty"`
}

AnalyticsDashboardResponseApiCallsByCategoryItem is a Truto API object.

type AnalyticsDashboardResponseApiCallsByIntegrationItem

type AnalyticsDashboardResponseApiCallsByIntegrationItem struct {
	Key    *string   `json:"key,omitempty"`
	Values []float64 `json:"values,omitempty"`
	Total  *float64  `json:"total,omitempty"`
}

AnalyticsDashboardResponseApiCallsByIntegrationItem is a Truto API object.

type AnalyticsDashboardResponseApiCallsTotalItem

type AnalyticsDashboardResponseApiCallsTotalItem struct {
	Key    *string   `json:"key,omitempty"`
	Values []float64 `json:"values,omitempty"`
	Total  *float64  `json:"total,omitempty"`
}

AnalyticsDashboardResponseApiCallsTotalItem is a Truto API object.

type AnalyticsDashboardResponseByCategoryItem

type AnalyticsDashboardResponseByCategoryItem struct {
	Category *string `json:"category,omitempty"`
	Calls    *int64  `json:"calls,omitempty"`
}

AnalyticsDashboardResponseByCategoryItem is a Truto API object.

type AnalyticsDashboardResponseErrorsByIntegrationItem

type AnalyticsDashboardResponseErrorsByIntegrationItem struct {
	Key   *string  `json:"key,omitempty"`
	Value *float64 `json:"value,omitempty"`
}

AnalyticsDashboardResponseErrorsByIntegrationItem is a Truto API object.

type AnalyticsDashboardResponseHourlyApiCalls

type AnalyticsDashboardResponseHourlyApiCalls struct {
	From    *string   `json:"from,omitempty"`
	To      *string   `json:"to,omitempty"`
	Buckets []string  `json:"buckets,omitempty"`
	Values  []float64 `json:"values,omitempty"`
}

API calls per hour (UTC) over the last 7 days of the range; an hour later today is `null`.

type AnalyticsDashboardResponseIntegrationsItem

type AnalyticsDashboardResponseIntegrationsItem struct {
	Integration *string `json:"integration,omitempty"`
	// API calls as billing counts them (the `billable_api_calls` filter).
	Calls *int64 `json:"calls,omitempty"`
	// API requests, the denominator of the error rate.
	Requests       *int64 `json:"requests,omitempty"`
	Errors         *int64 `json:"errors,omitempty"`
	Accounts       *int64 `json:"accounts,omitempty"`
	ActiveAccounts *int64 `json:"active_accounts,omitempty"`
	// Accounts with status `needs_reauth`, `validation_error` or `post_install_error` now.
	AttentionAccounts *int64 `json:"attention_accounts,omitempty"`
}

AnalyticsDashboardResponseIntegrationsItem is a Truto API object.

type AnalyticsDashboardResponseInventory

type AnalyticsDashboardResponseInventory struct {
	AsOf                *string          `json:"as_of,omitempty"`
	Accounts            *int64           `json:"accounts,omitempty"`
	ByStatus            map[string]int64 `json:"by_status,omitempty"`
	ActiveConnections   *int64           `json:"active_connections,omitempty"`
	SuperqueryAccounts  *int64           `json:"superquery_accounts,omitempty"`
	InstalledConnectors *int64           `json:"installed_connectors,omitempty"`
	ActiveConnectors    *int64           `json:"active_connectors,omitempty"`
}

The environment's integrations and integrated accounts as they are now (sandbox accounts excluded).

type AnalyticsDashboardResponseKpis

type AnalyticsDashboardResponseKpis struct {
	APICalls           *AnalyticsDashboardKpi `json:"api_calls,omitempty"`
	BillableAPICalls   *AnalyticsDashboardKpi `json:"billable_api_calls,omitempty"`
	Errors             *AnalyticsDashboardKpi `json:"errors,omitempty"`
	ErrorRate          *AnalyticsDashboardKpi `json:"error_rate,omitempty"`
	RateLimited        *AnalyticsDashboardKpi `json:"rate_limited,omitempty"`
	LatencyP95         *AnalyticsDashboardKpi `json:"latency_p95,omitempty"`
	ProviderLatencyP95 *AnalyticsDashboardKpi `json:"provider_latency_p95,omitempty"`
	RecordsSynced      *AnalyticsDashboardKpi `json:"records_synced,omitempty"`
	SyncFailures       *AnalyticsDashboardKpi `json:"sync_failures,omitempty"`
	WebhookEvents      *AnalyticsDashboardKpi `json:"webhook_events,omitempty"`
	WebhookFailureRate *AnalyticsDashboardKpi `json:"webhook_failure_rate,omitempty"`
	MCPCalls           *AnalyticsDashboardKpi `json:"mcp_calls,omitempty"`
	NewAccounts        *AnalyticsDashboardKpi `json:"new_accounts,omitempty"`
	Accounts           *AnalyticsDashboardKpi `json:"accounts,omitempty"`
	ActiveAccounts     *AnalyticsDashboardKpi `json:"active_accounts,omitempty"`
	ActiveIntegrations *AnalyticsDashboardKpi `json:"active_integrations,omitempty"`
}

Each headline number for the range, the span of the same length before it, and a daily series. `accounts`, `active_accounts` and `active_integrations` describe the accounts as they are now, so they have no previous value or series.

type AnalyticsDashboardResponseLatencyP95

type AnalyticsDashboardResponseLatencyP95 struct {
	Buckets  []string  `json:"buckets,omitempty"`
	Total    []float64 `json:"total,omitempty"`
	Provider []float64 `json:"provider,omitempty"`
}

p95 latency per day in ms, total and waiting on the provider; `null` on a day without requests.

type AnalyticsDashboardResponsePrevious

type AnalyticsDashboardResponsePrevious struct {
	From *string `json:"from,omitempty"`
	To   *string `json:"to,omitempty"`
}

AnalyticsDashboardResponsePrevious is a Truto API object.

type AnalyticsDashboardResponseRange

type AnalyticsDashboardResponseRange string

The named range shown, or `custom` for `from` / `to`.

Values the SDK does not know about decode unchanged.

const (
	AnalyticsDashboardResponseRangeMtd       AnalyticsDashboardResponseRange = "mtd"
	AnalyticsDashboardResponseRangeLastMonth AnalyticsDashboardResponseRange = "last_month"
	AnalyticsDashboardResponseRangeN7D       AnalyticsDashboardResponseRange = "7d"
	AnalyticsDashboardResponseRangeN30D      AnalyticsDashboardResponseRange = "30d"
	AnalyticsDashboardResponseRangeN90D      AnalyticsDashboardResponseRange = "90d"
	AnalyticsDashboardResponseRangeCustom    AnalyticsDashboardResponseRange = "custom"
)

Known AnalyticsDashboardResponseRange values.

type AnalyticsDashboardResponseStatusCodesItem

type AnalyticsDashboardResponseStatusCodesItem struct {
	Key   *string  `json:"key,omitempty"`
	Value *float64 `json:"value,omitempty"`
}

AnalyticsDashboardResponseStatusCodesItem is a Truto API object.

type AnalyticsDashboardResponseWindow

type AnalyticsDashboardResponseWindow struct {
	From *string `json:"from,omitempty"`
	To   *string `json:"to,omitempty"`
}

The days analytics can show (the last 90 days, up to today).

type AnalyticsMetricsResponse

type AnalyticsMetricsResponse struct {
	Metrics    []AnalyticsMetricsResponseMetricsItem    `json:"metrics,omitempty"`
	Dimensions []AnalyticsMetricsResponseDimensionsItem `json:"dimensions,omitempty"`
	Categories []AnalyticsMetricsResponseCategoriesItem `json:"categories,omitempty"`
}

AnalyticsMetricsResponse is a Truto API object.

type AnalyticsMetricsResponseCategoriesItem

type AnalyticsMetricsResponseCategoriesItem struct {
	ID    *string `json:"id,omitempty"`
	Label *string `json:"label,omitempty"`
}

AnalyticsMetricsResponseCategoriesItem is a Truto API object.

type AnalyticsMetricsResponseDimensionsItem

type AnalyticsMetricsResponseDimensionsItem struct {
	ID    *string `json:"id,omitempty"`
	Label *string `json:"label,omitempty"`
}

AnalyticsMetricsResponseDimensionsItem is a Truto API object.

type AnalyticsMetricsResponseMetricsItem

type AnalyticsMetricsResponseMetricsItem struct {
	ID            *string                                                `json:"id,omitempty"`
	Label         *string                                                `json:"label,omitempty"`
	Description   *string                                                `json:"description,omitempty"`
	Unit          *AnalyticsMetricsResponseMetricsItemUnit               `json:"unit,omitempty"`
	Kind          *AnalyticsMetricsResponseMetricsItemKind               `json:"kind,omitempty"`
	Granularities []AnalyticsMetricsResponseMetricsItemGranularitiesItem `json:"granularities,omitempty"`
	Dimensions    []string                                               `json:"dimensions,omitempty"`
	Breakdowns    []string                                               `json:"breakdowns,omitempty"`
}

AnalyticsMetricsResponseMetricsItem is a Truto API object.

type AnalyticsMetricsResponseMetricsItemGranularitiesItem

type AnalyticsMetricsResponseMetricsItemGranularitiesItem string

AnalyticsMetricsResponseMetricsItemGranularitiesItem is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	AnalyticsMetricsResponseMetricsItemGranularitiesItemDay  AnalyticsMetricsResponseMetricsItemGranularitiesItem = "day"
	AnalyticsMetricsResponseMetricsItemGranularitiesItemHour AnalyticsMetricsResponseMetricsItemGranularitiesItem = "hour"
)

Known AnalyticsMetricsResponseMetricsItemGranularitiesItem values.

type AnalyticsMetricsResponseMetricsItemKind

type AnalyticsMetricsResponseMetricsItemKind string

AnalyticsMetricsResponseMetricsItemKind is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	AnalyticsMetricsResponseMetricsItemKindSum     AnalyticsMetricsResponseMetricsItemKind = "sum"
	AnalyticsMetricsResponseMetricsItemKindRatio   AnalyticsMetricsResponseMetricsItemKind = "ratio"
	AnalyticsMetricsResponseMetricsItemKindLatency AnalyticsMetricsResponseMetricsItemKind = "latency"
)

Known AnalyticsMetricsResponseMetricsItemKind values.

type AnalyticsMetricsResponseMetricsItemUnit

type AnalyticsMetricsResponseMetricsItemUnit string

AnalyticsMetricsResponseMetricsItemUnit is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	AnalyticsMetricsResponseMetricsItemUnitCount AnalyticsMetricsResponseMetricsItemUnit = "count"
	AnalyticsMetricsResponseMetricsItemUnitRatio AnalyticsMetricsResponseMetricsItemUnit = "ratio"
	AnalyticsMetricsResponseMetricsItemUnitMs    AnalyticsMetricsResponseMetricsItemUnit = "ms"
)

Known AnalyticsMetricsResponseMetricsItemUnit values.

type AnalyticsService

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

AnalyticsService reads usage analytics. Pass filters such as environment_id, metric or range with WithQuery.

func (*AnalyticsService) Breakdown

func (s *AnalyticsService) Breakdown(ctx context.Context, opts ...Option) (*AnalyticsBreakdownResponse, error)

Breakdown returns a metric split by a dimension.

func (*AnalyticsService) Dashboard

func (s *AnalyticsService) Dashboard(ctx context.Context, opts ...Option) (*AnalyticsDashboardResponse, error)

Dashboard returns the dashboard summary.

func (*AnalyticsService) Metrics

Metrics lists the metrics and dimensions that can be queried.

func (*AnalyticsService) Status

Status reports whether analytics are available for the environment.

func (*AnalyticsService) Timeseries

func (s *AnalyticsService) Timeseries(ctx context.Context, opts ...Option) (*AnalyticsTimeseriesResponse, error)

Timeseries returns a metric over time.

type AnalyticsStatusResponse

type AnalyticsStatusResponse struct {
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The first and last UTC day that can be requested. `to` is today.
	Window *AnalyticsStatusResponseWindow `json:"window,omitempty"`
	// How long analytics responses are cached.
	CacheSeconds *int64 `json:"cache_seconds,omitempty"`
}

AnalyticsStatusResponse is a Truto API object.

type AnalyticsStatusResponseWindow

type AnalyticsStatusResponseWindow struct {
	From *string `json:"from,omitempty"`
	To   *string `json:"to,omitempty"`
}

The first and last UTC day that can be requested. `to` is today.

type AnalyticsTimeseriesResponse

type AnalyticsTimeseriesResponse struct {
	EnvironmentID *string                                 `json:"environment_id,omitempty"`
	Metric        *string                                 `json:"metric,omitempty"`
	Unit          *string                                 `json:"unit,omitempty"`
	Kind          *string                                 `json:"kind,omitempty"`
	Granularity   *string                                 `json:"granularity,omitempty"`
	From          *string                                 `json:"from,omitempty"`
	To            *string                                 `json:"to,omitempty"`
	Buckets       []string                                `json:"buckets,omitempty"`
	Series        []AnalyticsTimeseriesResponseSeriesItem `json:"series,omitempty"`
}

AnalyticsTimeseriesResponse is a Truto API object.

type AnalyticsTimeseriesResponseSeriesItem

type AnalyticsTimeseriesResponseSeriesItem struct {
	Key    *string   `json:"key,omitempty"`
	Values []float64 `json:"values,omitempty"`
	Total  *float64  `json:"total,omitempty"`
}

AnalyticsTimeseriesResponseSeriesItem is a Truto API object.

type ApiTokenResponse

type ApiTokenResponse struct {
	// The ID of the API token.
	ID *string `json:"id,omitempty"`
	// A descriptive name for the token.
	Name *string `json:"name,omitempty"`
	// The ID of the user who created this token.
	CreatedBy *string `json:"created_by,omitempty"`
	// The ID of the environment this token is scoped to.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The date and time when the token was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the token was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// Last time the token was used (UTC). Null until first use.
	LastUsedAt *string `json:"last_used_at,omitempty"`
}

ApiTokenResponse is a Truto API object.

type AppCredentialsNotConfiguredError

type AppCredentialsNotConfiguredError struct {
	StatusCode     *int64                                          `json:"statusCode,omitempty"`
	Error          *string                                         `json:"error,omitempty"`
	Message        *string                                         `json:"message,omitempty"`
	TrutoErrorCode *AppCredentialsNotConfiguredErrorTrutoErrorCode `json:"truto_error_code,omitempty"`
	// The integration's name.
	Integration              *string `json:"integration,omitempty"`
	EnvironmentIntegrationID *string `json:"environment_integration_id,omitempty"`
	// The methods that are missing their app credentials.
	AuthenticationMethods []AppCredentialsNotConfiguredErrorAuthenticationMethodsItem `json:"authentication_methods,omitempty"`
}

The refusal returned when a link token is requested for an integration that nothing can connect, because its app-level credentials were never configured in this environment.

type AppCredentialsNotConfiguredErrorAuthenticationMethodsItem

type AppCredentialsNotConfiguredErrorAuthenticationMethodsItem string

AppCredentialsNotConfiguredErrorAuthenticationMethodsItem is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	AppCredentialsNotConfiguredErrorAuthenticationMethodsItemOAuth2 AppCredentialsNotConfiguredErrorAuthenticationMethodsItem = "oauth2"
	AppCredentialsNotConfiguredErrorAuthenticationMethodsItemAwsSts AppCredentialsNotConfiguredErrorAuthenticationMethodsItem = "aws_sts"
)

Known AppCredentialsNotConfiguredErrorAuthenticationMethodsItem values.

type AppCredentialsNotConfiguredErrorTrutoErrorCode

type AppCredentialsNotConfiguredErrorTrutoErrorCode string

AppCredentialsNotConfiguredErrorTrutoErrorCode is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	AppCredentialsNotConfiguredErrorTrutoErrorCodeAppCredentialsNotConfigured AppCredentialsNotConfiguredErrorTrutoErrorCode = "app_credentials_not_configured"
)

Known AppCredentialsNotConfiguredErrorTrutoErrorCode values.

type BatchRequestResponse

type BatchRequestResponse struct {
	// Map of resource names to the records fetched for that resource. The key
	// is the resource's `name` from the request body.
	Result map[string][]any `json:"result,omitempty"`
	// Map of resource names to errors encountered while processing that
	// resource. Present only for resources that failed.
	Errors map[string][]BatchRequestResponseErrorsValueItem `json:"errors,omitempty"`
}

The combined response returned by `POST /batch-request`. Successful resource records are grouped under `result`, keyed by the `name` of each resource in the request. Errors are surfaced under `errors`, keyed the same way.

type BatchRequestResponseErrorsValueItem

type BatchRequestResponseErrorsValueItem struct {
	// Serialized error object describing what went wrong.
	Error map[string]any `json:"error,omitempty"`
	// Milliseconds to wait before retrying. Set when the upstream API returned a rate-limit response.
	RetryAfter *float64 `json:"retryAfter,omitempty"`
}

BatchRequestResponseErrorsValueItem is a Truto API object.

type BatchRequestSchema

type BatchRequestSchema struct {
	// The ID of the integrated account in whose context these resource calls are made.
	IntegratedAccountID string `json:"integrated_account_id"`
	// Optional arguments available for placeholder replacement in resource definitions.
	Args map[string]any `json:"args,omitempty"`
	// A list of resource definitions that can be either a request or a transform.
	Resources []SyncJobResourceSchema `json:"resources"`
}

The request body for creating a batch request, containing an integrated account ID and an array of resources.

type BatchRequestsService

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

BatchRequestsService runs several API requests in one call.

func (*BatchRequestsService) Create

Create runs a batch request.

type BillingAccountResponse

type BillingAccountResponse struct {
	TeamID            *string `json:"team_id,omitempty"`
	StripeCustomerID  *string `json:"stripe_customer_id,omitempty"`
	HasStripeCustomer *bool   `json:"has_stripe_customer,omitempty"`
	HasPaymentMethod  *bool   `json:"has_payment_method,omitempty"`
	// Informational; nothing is enforced on it today.
	BillingStatus        *BillingAccountResponseBillingStatus        `json:"billing_status,omitempty"`
	BillingEmail         *string                                     `json:"billing_email,omitempty"`
	Currency             *string                                     `json:"currency,omitempty"`
	PaymentMethodSummary *BillingAccountResponsePaymentMethodSummary `json:"payment_method_summary,omitempty"`
	BillingAddress       *BillingAccountResponseBillingAddress       `json:"billing_address,omitempty"`
	TaxIDs               []BillingAccountResponseTaxIdsItem          `json:"tax_ids,omitempty"`
	LastSyncedAt         *string                                     `json:"last_synced_at,omitempty"`
	LastPaymentFailedAt  *string                                     `json:"last_payment_failed_at,omitempty"`
}

BillingAccountResponse is a Truto API object.

type BillingAccountResponseBillingAddress

type BillingAccountResponseBillingAddress struct {
	Name       *string `json:"name,omitempty"`
	Line1      *string `json:"line1,omitempty"`
	Line2      *string `json:"line2,omitempty"`
	City       *string `json:"city,omitempty"`
	State      *string `json:"state,omitempty"`
	PostalCode *string `json:"postal_code,omitempty"`
	Country    *string `json:"country,omitempty"`
}

BillingAccountResponseBillingAddress is a Truto API object.

type BillingAccountResponseBillingStatus

type BillingAccountResponseBillingStatus string

Informational; nothing is enforced on it today.

Values the SDK does not know about decode unchanged.

const (
	BillingAccountResponseBillingStatusActive    BillingAccountResponseBillingStatus = "active"
	BillingAccountResponseBillingStatusPastDue   BillingAccountResponseBillingStatus = "past_due"
	BillingAccountResponseBillingStatusSuspended BillingAccountResponseBillingStatus = "suspended"
	BillingAccountResponseBillingStatusExempt    BillingAccountResponseBillingStatus = "exempt"
)

Known BillingAccountResponseBillingStatus values.

type BillingAccountResponsePaymentMethodSummary

type BillingAccountResponsePaymentMethodSummary struct {
	StripePaymentMethodID *string `json:"stripe_payment_method_id,omitempty"`
	Type                  *string `json:"type,omitempty"`
	Brand                 *string `json:"brand,omitempty"`
	Last4                 *string `json:"last4,omitempty"`
	ExpMonth              *int64  `json:"exp_month,omitempty"`
	ExpYear               *int64  `json:"exp_year,omitempty"`
}

BillingAccountResponsePaymentMethodSummary is a Truto API object.

type BillingAccountResponseTaxIdsItem

type BillingAccountResponseTaxIdsItem struct {
	Type  *string `json:"type,omitempty"`
	Value *string `json:"value,omitempty"`
}

BillingAccountResponseTaxIdsItem is a Truto API object.

type BillingInvoiceResponse

type BillingInvoiceResponse struct {
	// Truto's id for the mirrored invoice row.
	ID               *string `json:"id,omitempty"`
	TeamID           *string `json:"team_id,omitempty"`
	StripeInvoiceID  *string `json:"stripe_invoice_id,omitempty"`
	StripeCustomerID *string `json:"stripe_customer_id,omitempty"`
	// `automated` when Truto generated it from a plan; `stripe_manual` when it was raised by hand in Stripe.
	Source *BillingInvoiceResponseSource `json:"source,omitempty"`
	// Raw Stripe invoice status.
	Status               *BillingInvoiceResponseStatus `json:"status,omitempty"`
	Number               *string                       `json:"number,omitempty"`
	Currency             *string                       `json:"currency,omitempty"`
	AmountDueCents       *int64                        `json:"amount_due_cents,omitempty"`
	AmountPaidCents      *int64                        `json:"amount_paid_cents,omitempty"`
	AmountRemainingCents *int64                        `json:"amount_remaining_cents,omitempty"`
	PeriodStart          *string                       `json:"period_start,omitempty"`
	PeriodEnd            *string                       `json:"period_end,omitempty"`
	// Stripe-hosted page to view and pay the invoice.
	HostedInvoiceURL *string `json:"hosted_invoice_url,omitempty"`
	InvoicePdf       *string `json:"invoice_pdf,omitempty"`
	StripeCreatedAt  *string `json:"stripe_created_at,omitempty"`
	FinalizedAt      *string `json:"finalized_at,omitempty"`
	PaidAt           *string `json:"paid_at,omitempty"`
	VoidedAt         *string `json:"voided_at,omitempty"`
	AttemptCount     *int64  `json:"attempt_count,omitempty"`
	LastPaymentError *string `json:"last_payment_error,omitempty"`
}

A Stripe invoice mirrored into Truto. Stripe remains the system of record; use `hosted_invoice_url` to view or pay it.

type BillingInvoiceResponseSource

type BillingInvoiceResponseSource string

`automated` when Truto generated it from a plan; `stripe_manual` when it was raised by hand in Stripe.

Values the SDK does not know about decode unchanged.

const (
	BillingInvoiceResponseSourceAutomated    BillingInvoiceResponseSource = "automated"
	BillingInvoiceResponseSourceStripeManual BillingInvoiceResponseSource = "stripe_manual"
)

Known BillingInvoiceResponseSource values.

type BillingInvoiceResponseStatus

type BillingInvoiceResponseStatus string

Raw Stripe invoice status.

Values the SDK does not know about decode unchanged.

const (
	BillingInvoiceResponseStatusDraft         BillingInvoiceResponseStatus = "draft"
	BillingInvoiceResponseStatusOpen          BillingInvoiceResponseStatus = "open"
	BillingInvoiceResponseStatusPaid          BillingInvoiceResponseStatus = "paid"
	BillingInvoiceResponseStatusVoid          BillingInvoiceResponseStatus = "void"
	BillingInvoiceResponseStatusUncollectible BillingInvoiceResponseStatus = "uncollectible"
)

Known BillingInvoiceResponseStatus values.

type BillingLine

type BillingLine struct {
	Key  *string          `json:"key,omitempty"`
	Kind *BillingLineKind `json:"kind,omitempty"`
	// Invoice wording. Usage lines mention the included allowance only when the component has one.
	Description *string `json:"description,omitempty"`
	// Units charged; for usage lines the number of blocks of `unit_size`.
	Quantity *int64 `json:"quantity,omitempty"`
	// Price per charged unit (per block for usage lines).
	UnitPriceCents *float64 `json:"unit_price_cents,omitempty"`
	// Usage lines only — units per block.
	UnitSize *int64 `json:"unit_size,omitempty"`
	// Usage lines only — measured minus included, before block rounding.
	OverageQuantity *int64 `json:"overage_quantity,omitempty"`
	// Amount before discount.
	GrossAmountCents *int64   `json:"gross_amount_cents,omitempty"`
	DiscountPercent  *float64 `json:"discount_percent,omitempty"`
	DiscountCents    *int64   `json:"discount_cents,omitempty"`
	// Net amount charged.
	AmountCents *int64  `json:"amount_cents,omitempty"`
	PeriodStart *string `json:"period_start,omitempty"`
	// Exclusive end (first day of the next period).
	PeriodEnd        *string            `json:"period_end,omitempty"`
	Metric           *BillingLineMetric `json:"metric,omitempty"`
	MeasuredQuantity *int64             `json:"measured_quantity,omitempty"`
	IncludedQuantity *int64             `json:"included_quantity,omitempty"`
}

BillingLine is a Truto API object.

type BillingLineKind

type BillingLineKind string

BillingLineKind is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	BillingLineKindBaseFee BillingLineKind = "base_fee"
	BillingLineKindUsage   BillingLineKind = "usage"
	BillingLineKindFixed   BillingLineKind = "fixed"
)

Known BillingLineKind values.

type BillingLineMetric

type BillingLineMetric string

BillingLineMetric is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	BillingLineMetricConnector         BillingLineMetric = "connector"
	BillingLineMetricActiveConnection  BillingLineMetric = "active_connection"
	BillingLineMetricAPICall           BillingLineMetric = "api_call"
	BillingLineMetricSuperqueryAccount BillingLineMetric = "superquery_account"
)

Known BillingLineMetric values.

type BillingPlanResponse

type BillingPlanResponse struct {
	TeamID                 *string                             `json:"team_id,omitempty"`
	Name                   *string                             `json:"name,omitempty"`
	IsActive               *bool                               `json:"is_active,omitempty"`
	BaseFeeCents           *int64                              `json:"base_fee_cents,omitempty"`
	BaseFeeInterval        *BillingPlanResponseBaseFeeInterval `json:"base_fee_interval,omitempty"`
	BaseFeeAnchorMonth     *int64                              `json:"base_fee_anchor_month,omitempty"`
	BaseFeeDescription     *string                             `json:"base_fee_description,omitempty"`
	BaseFeeDiscountPercent *float64                            `json:"base_fee_discount_percent,omitempty"`
	// `automatic` invoices are generated by the daily billing run on `billing_day`; `manual` plans are invoiced by Truto staff.
	BillingMode *BillingPlanResponseBillingMode `json:"billing_mode,omitempty"`
	// Day of the month (UTC) automatic invoices are issued.
	BillingDay *int64 `json:"billing_day,omitempty"`
	Components []any  `json:"components,omitempty"`
	// First calendar month (always the 1st) this plan bills. Everything bills in arrears, so the first invoice is issued on `billing_day` of the following month.
	EffectiveFrom *string `json:"effective_from,omitempty"`
	CreatedAt     *string `json:"created_at,omitempty"`
	UpdatedAt     *string `json:"updated_at,omitempty"`
}

BillingPlanResponse is a Truto API object.

type BillingPlanResponseBaseFeeInterval

type BillingPlanResponseBaseFeeInterval string

BillingPlanResponseBaseFeeInterval is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	BillingPlanResponseBaseFeeIntervalMonth    BillingPlanResponseBaseFeeInterval = "month"
	BillingPlanResponseBaseFeeIntervalQuarter  BillingPlanResponseBaseFeeInterval = "quarter"
	BillingPlanResponseBaseFeeIntervalHalfYear BillingPlanResponseBaseFeeInterval = "half_year"
	BillingPlanResponseBaseFeeIntervalYear     BillingPlanResponseBaseFeeInterval = "year"
)

Known BillingPlanResponseBaseFeeInterval values.

type BillingPlanResponseBillingMode

type BillingPlanResponseBillingMode string

`automatic` invoices are generated by the daily billing run on `billing_day`; `manual` plans are invoiced by Truto staff.

Values the SDK does not know about decode unchanged.

const (
	BillingPlanResponseBillingModeAutomatic BillingPlanResponseBillingMode = "automatic"
	BillingPlanResponseBillingModeManual    BillingPlanResponseBillingMode = "manual"
)

Known BillingPlanResponseBillingMode values.

type BillingSummaryResponse

type BillingSummaryResponse struct {
	Account *BillingAccountResponse `json:"account,omitempty"`
	Plan    *BillingPlanResponse    `json:"plan,omitempty"`
	// Month-to-date charges priced against the plan. Everything — platform fee, fixed items and usage — bills in arrears, so these are invoiced on `invoice_date`, after the month ends. `null` when the team has no active plan.
	CurrentPeriod *BillingSummaryResponseCurrentPeriod `json:"current_period,omitempty"`
	// Next date the daily billing run will invoice this team (its plan's `billing_day`). Never earlier than the month after the plan's `effective_from`, since everything bills in arrears. Null for manual or inactive plans.
	NextInvoiceDate *string                 `json:"next_invoice_date,omitempty"`
	LastInvoice     *BillingInvoiceResponse `json:"last_invoice,omitempty"`
}

BillingSummaryResponse is a Truto API object.

type BillingSummaryResponseCurrentPeriod

type BillingSummaryResponseCurrentPeriod struct {
	PeriodStart         *string                                   `json:"period_start,omitempty"`
	PeriodEnd           *string                                   `json:"period_end,omitempty"`
	Usage               *BillingSummaryResponseCurrentPeriodUsage `json:"usage,omitempty"`
	Lines               []BillingLine                             `json:"lines,omitempty"`
	EstimatedTotalCents *int64                                    `json:"estimated_total_cents,omitempty"`
	// When these charges are invoiced, the plan's `billing_day` in the month after `period_end`. Null for manual plans and while the plan has not started.
	InvoiceDate *string `json:"invoice_date,omitempty"`
}

Month-to-date charges priced against the plan. Everything — platform fee, fixed items and usage — bills in arrears, so these are invoiced on `invoice_date`, after the month ends. `null` when the team has no active plan.

type BillingSummaryResponseCurrentPeriodUsage

type BillingSummaryResponseCurrentPeriodUsage struct {
	Counts  *BillingSummaryResponseCurrentPeriodUsageCounts `json:"counts,omitempty"`
	Details map[string]any                                  `json:"details,omitempty"`
}

BillingSummaryResponseCurrentPeriodUsage is a Truto API object.

type BillingSummaryResponseCurrentPeriodUsageCounts

type BillingSummaryResponseCurrentPeriodUsageCounts struct {
	Connector         *int64 `json:"connector,omitempty"`
	ActiveConnection  *int64 `json:"active_connection,omitempty"`
	APICall           *int64 `json:"api_call,omitempty"`
	SuperqueryAccount *int64 `json:"superquery_account,omitempty"`
}

BillingSummaryResponseCurrentPeriodUsageCounts is a Truto API object.

type CapabilitiesResponse

type CapabilitiesResponse struct {
	Integration CapabilitiesResponseIntegration `json:"integration"`
	Account     *CapabilityAccount              `json:"account,omitempty"`
	Proxy       *CapabilitiesResponseProxy      `json:"proxy,omitempty"`
	Unified     *CapabilitiesResponseUnified    `json:"unified,omitempty"`
	Auth        *CapabilityAuth                 `json:"auth,omitempty"`
	AiReadiness *CapabilityAiReadiness          `json:"ai_readiness,omitempty"`
}

Consolidated capabilities for an integration or integrated account.

type CapabilitiesResponseIntegration

type CapabilitiesResponseIntegration struct {
	ID   string  `json:"id"`
	Slug string  `json:"slug"`
	Name *string `json:"name,omitempty"`
}

CapabilitiesResponseIntegration is a Truto API object.

type CapabilitiesResponseProxy

type CapabilitiesResponseProxy struct {
	Resources []CapabilityProxyResource `json:"resources"`
}

CapabilitiesResponseProxy is a Truto API object.

type CapabilitiesResponseUnified

type CapabilitiesResponseUnified struct {
	Resources []CapabilityUnifiedResource `json:"resources"`
}

CapabilitiesResponseUnified is a Truto API object.

type CapabilityAccount

type CapabilityAccount struct {
	ID                   string  `json:"id"`
	Slug                 *string `json:"slug,omitempty"`
	Status               string  `json:"status"`
	AuthenticationMethod *string `json:"authentication_method,omitempty"`
	EnvironmentID        *string `json:"environment_id,omitempty"`
	IsBlocked            *bool   `json:"is_blocked,omitempty"`
}

Present on `/integrated-account/{id}/capabilities` only.

type CapabilityAiReadiness

type CapabilityAiReadiness struct {
	TotalMethods     int64 `json:"total_methods"`
	DescribedMethods int64 `json:"described_methods"`
	// Ratio in `[0, 1]`.
	Score float64 `json:"score"`
}

Coverage of proxy methods that have descriptions.

type CapabilityAuth

type CapabilityAuth struct {
	Formats          []string                   `json:"formats"`
	Fields           []CapabilityAuthFieldsItem `json:"fields,omitempty"`
	Scopes           []string                   `json:"scopes,omitempty"`
	DocumentationURL *string                    `json:"documentation_url,omitempty"`
}

Authentication formats and required fields for the integration.

type CapabilityAuthFieldsItem

type CapabilityAuthFieldsItem struct {
	Name        *string `json:"name,omitempty"`
	Required    *bool   `json:"required,omitempty"`
	Description *string `json:"description,omitempty"`
	Format      *string `json:"format,omitempty"`
}

CapabilityAuthFieldsItem is a Truto API object.

type CapabilityProxyMethod

type CapabilityProxyMethod struct {
	// Canonical method name (`list`, `get`, `create`, `update`, `delete`, or a custom name).
	Method string `json:"method"`
	// MCP tool name for this method. Resolved as: environment-integration `tool_name` documentation override,
	// then integration-level `tool_name` override, then a programmatic default from `getToolName()`.
	Name string `json:"name"`
	// Present and `true` when the method is disabled by an environment override.
	Disabled *bool `json:"disabled,omitempty"`
	// Tool name without environment-integration overrides (base `tool_name` documentation or programmatic
	// default). Same as `name` when no env override applies. Used by the app to revert env-level overrides.
	InheritedName *string `json:"inherited_name,omitempty"`
	// Human/AI-facing description, sourced from documentation or inline configuration.
	Description *string  `json:"description,omitempty"`
	Tags        []string `json:"tags,omitempty"`
	Deprecated  *bool    `json:"deprecated,omitempty"`
}

A single proxy method on a resource.

type CapabilityProxyResource

type CapabilityProxyResource struct {
	Name        string                  `json:"name"`
	Description *string                 `json:"description,omitempty"`
	DocsURL     *string                 `json:"docs_url,omitempty"`
	Methods     []CapabilityProxyMethod `json:"methods"`
}

A proxy resource and the methods it exposes.

type CapabilityUnifiedResource

type CapabilityUnifiedResource struct {
	APIName     string                                 `json:"api_name"`
	Name        string                                 `json:"name"`
	Description *string                                `json:"description,omitempty"`
	DocsURL     *string                                `json:"docs_url,omitempty"`
	Methods     []CapabilityUnifiedResourceMethodsItem `json:"methods"`
}

A unified resource grouped under a unified API.

type CapabilityUnifiedResourceMethodsItem

type CapabilityUnifiedResourceMethodsItem string

CapabilityUnifiedResourceMethodsItem is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	CapabilityUnifiedResourceMethodsItemList   CapabilityUnifiedResourceMethodsItem = "list"
	CapabilityUnifiedResourceMethodsItemGet    CapabilityUnifiedResourceMethodsItem = "get"
	CapabilityUnifiedResourceMethodsItemCreate CapabilityUnifiedResourceMethodsItem = "create"
	CapabilityUnifiedResourceMethodsItemUpdate CapabilityUnifiedResourceMethodsItem = "update"
	CapabilityUnifiedResourceMethodsItemDelete CapabilityUnifiedResourceMethodsItem = "delete"
)

Known CapabilityUnifiedResourceMethodsItem values.

type CategoriesService

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

CategoriesService manages integration categories.

func (*CategoriesService) List

List returns an iterator over the items. Filter with WithQuery.

type CategorySchema

type CategorySchema struct {
	// The internal name/slug of the category.
	Name *string `json:"name,omitempty"`
	// A user-facing label or descriptive name for the category.
	Label *string `json:"label,omitempty"`
	// The date and time when the category was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the category was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

CategorySchema is a Truto API object.

type Client

type Client struct {
	APITokens                              *APITokensService
	Environments                           *EnvironmentsService
	Categories                             *CategoriesService
	Teams                                  *TeamsService
	Users                                  *UsersService
	Tenants                                *TenantsService
	LinkTokens                             *LinkTokensService
	SessionTokens                          *SessionTokensService
	IntegratedAccounts                     *IntegratedAccountsService
	SandboxIntegratedAccounts              *SandboxIntegratedAccountsService
	Integrations                           *IntegrationsService
	EnvironmentIntegrations                *EnvironmentIntegrationsService
	UnifiedModels                          *UnifiedModelsService
	EnvironmentUnifiedModels               *EnvironmentUnifiedModelsService
	UnifiedModelResourceMethods            *UnifiedModelResourceMethodsService
	EnvironmentUnifiedModelResourceMethods *EnvironmentUnifiedModelResourceMethodsService
	SyncJobs                               *SyncJobsService
	SyncJobRuns                            *SyncJobRunsService
	SyncJobCronTriggers                    *SyncJobCronTriggersService
	SyncJobTemplates                       *SyncJobTemplatesService
	SyncJobRunStates                       *SyncJobRunStatesService
	Daemons                                *RecordService
	DaemonJobs                             *RecordService
	DaemonJobRuns                          *RecordService
	DaemonJobCronTriggers                  *DaemonJobCronTriggersService
	Workflows                              *WorkflowsService
	WorkflowRuns                           *WorkflowRunsService
	Webhooks                               *WebhooksService
	Datastores                             *DatastoresService
	Documentation                          *DocumentationService
	Logs                                   *LogsService
	StaticGates                            *StaticGatesService
	ObservabilityDestinations              *ObservabilityDestinationsService
	Analytics                              *AnalyticsService
	BatchRequests                          *BatchRequestsService
	EnvironmentIntegrationWebhooks         *WebhookProcessorService
	IntegratedAccountWebhooks              *WebhookProcessorService

	Unified *UnifiedAPIService
	Proxy   *ProxyAPIService
	Custom  *CustomAPIService
	MCP     *MCPService
	// contains filtered or unexported fields
}

Client is a Truto API client. It is safe for concurrent use.

func NewClient

func NewClient(token string, opts ...Option) *Client

NewClient returns a client authenticated with an API token.

func (*Client) Do

func (c *Client) Do(ctx context.Context, method, path string, body, out any, opts ...Option) error

Do sends a request to any API path and decodes the JSON response into out (which may be nil). Use it for endpoints the SDK does not wrap yet.

func (*Client) Ping

func (c *Client) Ping(ctx context.Context, opts ...Option) (*Ping, error)

Ping checks that the API is reachable and the token is valid.

type CustomAPIService

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

CustomAPIService calls Custom API endpoints you defined on an integration. Responses are returned raw, because a custom endpoint may answer with anything; RawResponse.Body is JSON when ContentType says so.

func (*CustomAPIService) Delete

func (s *CustomAPIService) Delete(ctx context.Context, integratedAccountID, path string, opts ...Option) (*RawResponse, error)

Delete sends DELETE /custom/{path}.

func (*CustomAPIService) Get

func (s *CustomAPIService) Get(ctx context.Context, integratedAccountID, path string, opts ...Option) (*RawResponse, error)

Get sends GET /custom/{path}.

func (*CustomAPIService) Patch

func (s *CustomAPIService) Patch(ctx context.Context, integratedAccountID, path string, body any, opts ...Option) (*RawResponse, error)

Patch sends PATCH /custom/{path}.

func (*CustomAPIService) Post

func (s *CustomAPIService) Post(ctx context.Context, integratedAccountID, path string, body any, opts ...Option) (*RawResponse, error)

Post sends POST /custom/{path}.

func (*CustomAPIService) Put

func (s *CustomAPIService) Put(ctx context.Context, integratedAccountID, path string, body any, opts ...Option) (*RawResponse, error)

Put sends PUT /custom/{path}.

type DaemonJobCronTriggersService

type DaemonJobCronTriggersService struct{ RecordService }

DaemonJobCronTriggersService manages cron schedules for daemon jobs.

func (*DaemonJobCronTriggersService) Schedule

func (s *DaemonJobCronTriggersService) Schedule(ctx context.Context, id string, opts ...Option) (*Record, error)

Schedule (re)schedules the trigger's next run.

type DatastoreConfig

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

Datastore configuration. The shape of `config` depends on the parent record's `type` field. Truto deserializes the `config` blob into one of `DatastoreMongoDataApiConfig`, `DatastoreGoogleCloudStorageConfig`, `DatastoreS3Config`, or `DatastoreQdrantConfig`.

It holds the raw JSON; use the As* methods to decode a specific shape.

func DatastoreConfigFromDatastoreGoogleCloudStorageConfig

func DatastoreConfigFromDatastoreGoogleCloudStorageConfig(v DatastoreGoogleCloudStorageConfig) (DatastoreConfig, error)

DatastoreConfigFromDatastoreGoogleCloudStorageConfig wraps a DatastoreGoogleCloudStorageConfig.

func DatastoreConfigFromDatastoreMongoDataApiConfig

func DatastoreConfigFromDatastoreMongoDataApiConfig(v DatastoreMongoDataApiConfig) (DatastoreConfig, error)

DatastoreConfigFromDatastoreMongoDataApiConfig wraps a DatastoreMongoDataApiConfig.

func DatastoreConfigFromDatastoreQdrantConfig

func DatastoreConfigFromDatastoreQdrantConfig(v DatastoreQdrantConfig) (DatastoreConfig, error)

DatastoreConfigFromDatastoreQdrantConfig wraps a DatastoreQdrantConfig.

func DatastoreConfigFromDatastoreS3Config

func DatastoreConfigFromDatastoreS3Config(v DatastoreS3Config) (DatastoreConfig, error)

DatastoreConfigFromDatastoreS3Config wraps a DatastoreS3Config.

func (DatastoreConfig) AsDatastoreGoogleCloudStorageConfig

func (u DatastoreConfig) AsDatastoreGoogleCloudStorageConfig() (*DatastoreGoogleCloudStorageConfig, error)

AsDatastoreGoogleCloudStorageConfig decodes the value as a DatastoreGoogleCloudStorageConfig.

func (DatastoreConfig) AsDatastoreMongoDataApiConfig

func (u DatastoreConfig) AsDatastoreMongoDataApiConfig() (*DatastoreMongoDataApiConfig, error)

AsDatastoreMongoDataApiConfig decodes the value as a DatastoreMongoDataApiConfig.

func (DatastoreConfig) AsDatastoreQdrantConfig

func (u DatastoreConfig) AsDatastoreQdrantConfig() (*DatastoreQdrantConfig, error)

AsDatastoreQdrantConfig decodes the value as a DatastoreQdrantConfig.

func (DatastoreConfig) AsDatastoreS3Config

func (u DatastoreConfig) AsDatastoreS3Config() (*DatastoreS3Config, error)

AsDatastoreS3Config decodes the value as a DatastoreS3Config.

func (DatastoreConfig) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (DatastoreConfig) Raw

Raw returns the JSON this DatastoreConfig holds.

func (*DatastoreConfig) UnmarshalJSON

func (u *DatastoreConfig) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type DatastoreCreateRequest

type DatastoreCreateRequest struct {
	// The datastore ID (optional; if omitted, one is generated).
	ID *string `json:"id,omitempty"`
	// The datastore type. Determines the shape of `config`.
	Type DatastoreCreateRequestType `json:"type"`
	// A friendly label for this datastore.
	Label string `json:"label"`
	// Config object for the datastore connection. Shape depends on `type`.
	Config DatastoreConfig `json:"config"`
	// The environment that owns this datastore. If omitted, defaults to the user's first environment; required when the user has multiple environments.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// Optional list of integration methods (e.g. `unified_api/resource/method`) used to validate the datastore configuration before persisting.
	ValidationMethods []string `json:"validation_methods,omitempty"`
}

DatastoreCreateRequest is a Truto API object.

type DatastoreCreateRequestType

type DatastoreCreateRequestType string

The datastore type. Determines the shape of `config`.

Values the SDK does not know about decode unchanged.

const (
	DatastoreCreateRequestTypeMongoDataAPI       DatastoreCreateRequestType = "mongo_data_api"
	DatastoreCreateRequestTypeGoogleCloudStorage DatastoreCreateRequestType = "google_cloud_storage"
	DatastoreCreateRequestTypeS3                 DatastoreCreateRequestType = "s3"
	DatastoreCreateRequestTypeQdrant             DatastoreCreateRequestType = "qdrant"
)

Known DatastoreCreateRequestType values.

type DatastoreDeleteResponse

type DatastoreDeleteResponse struct {
	// The ID of the deleted datastore.
	ID *string `json:"id,omitempty"`
}

DatastoreDeleteResponse is a Truto API object.

type DatastoreGoogleCloudStorageConfig

type DatastoreGoogleCloudStorageConfig struct {
	Bucket      string                                 `json:"bucket"`
	Credentials DatastoreGoogleCloudStorageCredentials `json:"credentials"`
}

Configuration for the Google Cloud Storage datastore type.

type DatastoreGoogleCloudStorageCredentials

type DatastoreGoogleCloudStorageCredentials struct {
	Type                    string `json:"type"`
	ProjectID               string `json:"project_id"`
	PrivateKeyID            string `json:"private_key_id"`
	PrivateKey              string `json:"private_key"`
	ClientEmail             string `json:"client_email"`
	ClientID                string `json:"client_id"`
	AuthURI                 string `json:"auth_uri"`
	TokenURI                string `json:"token_uri"`
	AuthProviderX509CertURL string `json:"auth_provider_x509_cert_url"`
	ClientX509CertURL       string `json:"client_x509_cert_url"`
	UniverseDomain          string `json:"universe_domain"`
}

Service-account JSON used to authenticate against Google Cloud Storage.

type DatastoreMongoDataApiConfig

type DatastoreMongoDataApiConfig struct {
	// Name of the Atlas cluster (the Data API "data source").
	DataSource string `json:"data_source"`
	Database   string `json:"database"`
	// Base URL of your Atlas Data API endpoint.
	APIURL string `json:"api_url"`
	// Atlas Data API key. Treat as a secret.
	APIKey string `json:"api_key"`
}

Configuration for the MongoDB Atlas Data API datastore type.

type DatastoreQdrantConfig

type DatastoreQdrantConfig struct {
	BaseURL string `json:"base_url"`
	// Qdrant API key. Treat as a secret.
	APIKey     string `json:"api_key"`
	Port       *int64 `json:"port,omitempty"`
	Collection string `json:"collection"`
}

Configuration for the Qdrant vector-store datastore type.

type DatastoreS3Config

type DatastoreS3Config struct {
	AccessKeyID string `json:"access_key_id"`
	// Secret access key. Treat as a secret.
	SecretAccessKey string `json:"secret_access_key"`
	Region          string `json:"region"`
	Bucket          string `json:"bucket"`
	// Optional override for non-AWS S3 endpoints (e.g. R2, MinIO).
	BaseURL *string `json:"base_url,omitempty"`
}

Configuration for the S3 / S3-compatible datastore type.

type DatastoreSchema

type DatastoreSchema struct {
	// The unique ID of the datastore.
	ID string `json:"id"`
	// The datastore's backend type. Determines the shape of `config`.
	Type DatastoreSchemaType `json:"type"`
	// A friendly label for identifying this datastore.
	Label string `json:"label"`
	// Config object for the datastore connection (minus sensitive fields). The shape depends on `type`.
	Config DatastoreConfig `json:"config"`
	// The environment to which this datastore belongs.
	EnvironmentID string `json:"environment_id"`
	// Timestamp when the datastore record was created.
	CreatedAt string `json:"created_at"`
	// Timestamp when the datastore record was last updated.
	UpdatedAt string `json:"updated_at"`
}

DatastoreSchema is a Truto API object.

type DatastoreSchemaType

type DatastoreSchemaType string

The datastore's backend type. Determines the shape of `config`.

Values the SDK does not know about decode unchanged.

const (
	DatastoreSchemaTypeMongoDataAPI       DatastoreSchemaType = "mongo_data_api"
	DatastoreSchemaTypeGoogleCloudStorage DatastoreSchemaType = "google_cloud_storage"
	DatastoreSchemaTypeS3                 DatastoreSchemaType = "s3"
	DatastoreSchemaTypeQdrant             DatastoreSchemaType = "qdrant"
)

Known DatastoreSchemaType values.

type DatastoreUpdateRequest

type DatastoreUpdateRequest struct {
	// New label for this datastore.
	Label *string `json:"label,omitempty"`
	// Updated config object. Partial updates are accepted; fields not supplied are left unchanged. Shape still depends on `type`. An update that moves `api_url` (`mongo_data_api`) or `base_url` (`qdrant`) to another site must send `api_key` with it, or it is refused with a `400`. `api_key` sent back as `********` keeps the stored key, so it is refused too.
	Config *DatastoreConfig `json:"config,omitempty"`
}

DatastoreUpdateRequest is a Truto API object.

type DatastoresService

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

DatastoresService manages datastores that sync jobs can write to.

func (*DatastoresService) Create

Create creates a datastore.

func (*DatastoresService) Delete

Delete deletes a datastore.

func (*DatastoresService) Get

func (s *DatastoresService) Get(ctx context.Context, id string, opts ...Option) (*DatastoreSchema, error)

Get fetches a datastore.

func (*DatastoresService) List

List returns an iterator over datastores.

func (*DatastoresService) Test

func (s *DatastoresService) Test(ctx context.Context, id, method string, body Record, opts ...Option) (*Record, error)

Test runs one of the datastore's validation methods.

func (*DatastoresService) Update

Update changes a datastore.

type DeleteResponse

type DeleteResponse struct {
	// The ID of the resource that was deleted.
	ID *string `json:"id,omitempty"`
}

DeleteResponse is a Truto API object.

type Documentation

type Documentation struct {
	ID         string                   `json:"id"`
	EntityID   string                   `json:"entity_id"`
	EntityType *DocumentationEntityType `json:"entity_type,omitempty"`
	Type       DocumentationType        `json:"type"`
	// Row payload. For `tool_name`, a snake_case MCP tool name override (max 64 chars, `[a-z0-9_]`).
	// For `description`, plain text. For `*_schema` types, YAML-encoded schema.
	Content              string  `json:"content"`
	Resource             *string `json:"resource,omitempty"`
	Method               *string `json:"method,omitempty"`
	AuthenticationMethod *string `json:"authentication_method,omitempty"`
	IntegrationName      *string `json:"integration_name,omitempty"`
	CreatedAt            string  `json:"created_at"`
	UpdatedAt            string  `json:"updated_at"`
}

A documentation row attached to an integration, environment integration, or unified model.

type DocumentationCreateRequest

type DocumentationCreateRequest struct {
	IntegrationID             *string           `json:"integration_id,omitempty"`
	EnvironmentIntegrationID  *string           `json:"environment_integration_id,omitempty"`
	UnifiedModelID            *string           `json:"unified_model_id,omitempty"`
	EnvironmentUnifiedModelID *string           `json:"environment_unified_model_id,omitempty"`
	Type                      DocumentationType `json:"type"`
	Content                   string            `json:"content"`
	Resource                  *string           `json:"resource,omitempty"`
	Method                    *string           `json:"method,omitempty"`
	AuthenticationMethod      *string           `json:"authentication_method,omitempty"`
}

DocumentationCreateRequest is a Truto API object.

type DocumentationEntityType

type DocumentationEntityType string

DocumentationEntityType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	DocumentationEntityTypeIntegration             DocumentationEntityType = "integration"
	DocumentationEntityTypeUnifiedModel            DocumentationEntityType = "unified_model"
	DocumentationEntityTypeEnvironmentIntegration  DocumentationEntityType = "environment_integration"
	DocumentationEntityTypeEnvironmentUnifiedModel DocumentationEntityType = "environment_unified_model"
)

Known DocumentationEntityType values.

type DocumentationPatchRequest

type DocumentationPatchRequest struct {
	Type                 *DocumentationType `json:"type,omitempty"`
	Content              *string            `json:"content,omitempty"`
	Resource             *string            `json:"resource,omitempty"`
	Method               *string            `json:"method,omitempty"`
	AuthenticationMethod *string            `json:"authentication_method,omitempty"`
	IntegrationName      *string            `json:"integration_name,omitempty"`
}

DocumentationPatchRequest is a Truto API object.

type DocumentationService

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

DocumentationService manages documentation records.

func (*DocumentationService) Create

Create creates an item.

func (*DocumentationService) Delete

func (s *DocumentationService) Delete(ctx context.Context, id string, opts ...Option) error

Delete deletes an item.

func (*DocumentationService) Get

func (s *DocumentationService) Get(ctx context.Context, id string, opts ...Option) (*Documentation, error)

Get fetches one item by ID.

func (*DocumentationService) List

List returns an iterator over the items. Filter with WithQuery.

func (*DocumentationService) Update

Update changes an item. Only the fields that are set are sent.

type DocumentationType

type DocumentationType string

Documentation row type. Per-method MCP tooling uses `description`, `tool_name`, `query_schema`, `body_schema`, and `response_schema`. Integration-wide rows include `readme`, `oauth_*`, and `note`.

Values the SDK does not know about decode unchanged.

const (
	DocumentationTypeReadme                       DocumentationType = "readme"
	DocumentationTypeNote                         DocumentationType = "note"
	DocumentationTypeEndUserGuide                 DocumentationType = "end_user_guide"
	DocumentationTypeDescription                  DocumentationType = "description"
	DocumentationTypeToolName                     DocumentationType = "tool_name"
	DocumentationTypeQuerySchema                  DocumentationType = "query_schema"
	DocumentationTypeBodySchema                   DocumentationType = "body_schema"
	DocumentationTypeResponseSchema               DocumentationType = "response_schema"
	DocumentationTypeOAuthDocumentationLink       DocumentationType = "oauth_documentation_link"
	DocumentationTypeOAuthAppRequiresVerification DocumentationType = "oauth_app_requires_verification"
	DocumentationTypeOAuthNote                    DocumentationType = "oauth_note"
)

Known DocumentationType values.

type EnvironmentIntegrationConfig

type EnvironmentIntegrationConfig struct {
	BaseURL          *string                                                     `json:"base_url,omitempty"`
	Label            *string                                                     `json:"label,omitempty"`
	Icon             *string                                                     `json:"icon,omitempty"`
	Headers          map[string]*string                                          `json:"headers,omitempty"`
	Query            map[string]string                                           `json:"query,omitempty"`
	QueryArrayFormat *EnvironmentIntegrationConfigQueryArrayFormat               `json:"query_array_format,omitempty"`
	Actions          map[string]IntegrationAction                                `json:"actions,omitempty"`
	Credentials      any                                                         `json:"credentials,omitempty"`
	Authorization    *IntegrationAuthorization                                   `json:"authorization,omitempty"`
	Pagination       *IntegrationPagination                                      `json:"pagination,omitempty"`
	RateLimit        *IntegrationRateLimit                                       `json:"rate_limit,omitempty"`
	Resources        map[string]map[string]*EnvironmentIntegrationResourceMethod `json:"resources,omitempty"`
	ToolTags         map[string][]string                                         `json:"tool_tags,omitempty"`
	Webhook          *IntegrationWebhookConfig                                   `json:"webhook,omitempty"`
	ErrorExpression  *string                                                     `json:"error_expression,omitempty"`
	// Environment-specific description shown in the catalog.
	Description *string `json:"description,omitempty"`
	// Environment-specific tags shown in the catalog.
	Tags []string `json:"tags,omitempty"`
	// Environment-specific beta flag shown in the catalog and Connect UI. Deep-merged onto `integration.is_beta` at request time.
	IsBeta *bool `json:"is_beta,omitempty"`
	// Free-form key/value pairs available to JSONata as `{{env.<key>}}` for this integration in this environment. Values can be of any type (string, number, boolean, object, array).
	EnvironmentVariables map[string]any `json:"environment_variables,omitempty"`
}

Per-environment configuration override for an integration. Stored on `environment_integration.override` and **deep-merged** on top of the base `integration.config` at request time.

type EnvironmentIntegrationConfigQueryArrayFormat

type EnvironmentIntegrationConfigQueryArrayFormat string

EnvironmentIntegrationConfigQueryArrayFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	EnvironmentIntegrationConfigQueryArrayFormatComma    EnvironmentIntegrationConfigQueryArrayFormat = "comma"
	EnvironmentIntegrationConfigQueryArrayFormatBrackets EnvironmentIntegrationConfigQueryArrayFormat = "brackets"
	EnvironmentIntegrationConfigQueryArrayFormatIndices  EnvironmentIntegrationConfigQueryArrayFormat = "indices"
	EnvironmentIntegrationConfigQueryArrayFormatRepeat   EnvironmentIntegrationConfigQueryArrayFormat = "repeat"
)

Known EnvironmentIntegrationConfigQueryArrayFormat values.

type EnvironmentIntegrationCreateRequest

type EnvironmentIntegrationCreateRequest struct {
	// The ID of the integration to install.
	IntegrationID string `json:"integration_id"`
	// Whether to show this integration in the environment's catalog.
	ShowInCatalog *bool `json:"show_in_catalog,omitempty"`
	// Whether the integration should be enabled.
	IsEnabled *bool `json:"is_enabled,omitempty"`
	// An optional config override for the integration at environment level. Specify the Integration keys to override at the environment level. Deep-merged on top of the base `integration.config`. Checked as on `PATCH`, so where it keeps the integration's secret (it sends none of its own), it may move a host that secret is sent to only within the site it names or to a host one of the integration's select options gives, may not change such a path (`auth.tokenPath`, `auth.refreshPath`, `auth.revokePath`, or the path of an OAuth 1.0a URL), and each connect-form select keeps to the integration's options; any other move is a `400`.
	Override *EnvironmentIntegrationConfig `json:"override,omitempty"`
}

EnvironmentIntegrationCreateRequest is a Truto API object.

type EnvironmentIntegrationDeleteResponse

type EnvironmentIntegrationDeleteResponse struct {
	// The ID of the environment integration that was deleted.
	ID *string `json:"id,omitempty"`
}

EnvironmentIntegrationDeleteResponse is a Truto API object.

type EnvironmentIntegrationLinkUiConfig

type EnvironmentIntegrationLinkUiConfig struct {
	// Restricts which tenants may see and connect this integration. Omitted or `null` means every tenant sees it, which is the default for every integration.
	VisibleWhen *TenantVisibility `json:"visible_when,omitempty"`
	// Overrides `integration.category` as this card's grouping key in the widget.
	Group *string `json:"group,omitempty"`
	// Overrides the widget's Connect button label for this integration.
	ConnectLabel *string `json:"connect_label,omitempty"`
	// Overrides the widget's Configure button label for this integration.
	ConfigureLabel *string `json:"configure_label,omitempty"`
}

Per-integration configuration for the embedded **connections widget**, and nothing else. It is never merged into `integration.config`, so it cannot affect proxy, unified or custom requests.

type EnvironmentIntegrationResourceMethod

type EnvironmentIntegrationResourceMethod struct {
	BaseURL        *string                                     `json:"base_url,omitempty"`
	Method         *EnvironmentIntegrationResourceMethodMethod `json:"method,omitempty"`
	Path           *string                                     `json:"path,omitempty"`
	PaginationPath *string                                     `json:"pagination_path,omitempty"`
	Authorization  *IntegrationAuthorization                   `json:"authorization,omitempty"`
	// Override or add request headers for this method. Values may include JSONata placeholders.
	Headers map[string]any `json:"headers,omitempty"`
	// Override or add query params for this method. Values may include JSONata placeholders.
	Query            map[string]any                                        `json:"query,omitempty"`
	QueryArrayFormat *EnvironmentIntegrationResourceMethodQueryArrayFormat `json:"query_array_format,omitempty"`
	// Override the query schema. May be a JSONata string or a `JsonSchemaObject`.
	QuerySchema any `json:"query_schema,omitempty"`
	// Override the body schema. May be a JSONata string or a `JsonSchemaObject`. See `IntegrationResourceMethod.body_schema` for shape rationale.
	BodySchema                  any                                             `json:"body_schema,omitempty"`
	BodyFormat                  *EnvironmentIntegrationResourceMethodBodyFormat `json:"body_format,omitempty"`
	BodyFormatConfig            map[string]any                                  `json:"body_format_config,omitempty"`
	ResponseSchema              any                                             `json:"response_schema,omitempty"`
	ResponsePath                *string                                         `json:"response_path,omitempty"`
	Pagination                  *IntegrationPagination                          `json:"pagination,omitempty"`
	AddQueryToBody              *bool                                           `json:"add_query_to_body,omitempty"`
	IgnoreBodyInPagination      *bool                                           `json:"ignore_body_in_pagination,omitempty"`
	IgnoreBody                  *bool                                           `json:"ignore_body,omitempty"`
	SetBodyToNull               *bool                                           `json:"set_body_to_null,omitempty"`
	NoAuth                      *bool                                           `json:"no_auth,omitempty"`
	Examples                    *IntegrationResourceMethodExample               `json:"examples,omitempty"`
	IgnoreCredentialsOnRedirect *bool                                           `json:"ignore_credentials_on_redirect,omitempty"`
	APIResponseFormat           *string                                         `json:"api_response_format,omitempty"`
	ThrowErrorOnParseError      *bool                                           `json:"throw_error_on_parse_error,omitempty"`
	ErrorExpression             *string                                         `json:"error_expression,omitempty"`
	Description                 *string                                         `json:"description,omitempty"`
	APIDocumentationURL         *string                                         `json:"api_documentation_url,omitempty"`
	Scopes                      []string                                        `json:"scopes,omitempty"`
	// Per-environment override for the any-of half of the requirement. See
	// `IntegrationResourceMethod.scopes_any_of`.
	ScopesAnyOf []string `json:"scopes_any_of,omitempty"`
	// Per-environment override for which vocabulary `scopes` and `scopes_any_of` are written
	// in. See `IntegrationResourceMethod.permission_vocabulary` for what the values mean and
	// why the field normally stays unset. Overriding it here corrects one environment without
	// touching the base integration.
	PermissionVocabulary *EnvironmentIntegrationResourceMethodPermissionVocabulary `json:"permission_vocabulary,omitempty"`
	// Per-environment override for the method's MCP `ToolAnnotations` hints. See
	// `IntegrationResourceMethod.mcp_annotations`. Absent means "no hint". Hints merge per
	// key with the base method, so to tighten a base read to destructive the override must
	// also set `readOnlyHint: false`; a merged object with both `true` is treated as no hint.
	MCPAnnotations *EnvironmentIntegrationResourceMethodMcpAnnotations `json:"mcp_annotations,omitempty"`
	// Per-environment override for the method's `before` steps. See
	// `IntegrationResourceMethod.before`. Arrays are replaced wholesale, not merged per
	// step, so an override of `[]` clears the base method's `before` for this environment.
	// Stored only; Truto's own proxy does not run it yet.
	Before any `json:"before,omitempty"`
	// Override the request body for this method. Any JSON value; may include JSONata placeholders.
	Body any `json:"body,omitempty"`
}

Per-environment override for a single resource method. Same shape as `IntegrationResourceMethod` but every field is optional (deep-merged on top of the base method). `path` is also optional here.

type EnvironmentIntegrationResourceMethodBodyFormat

type EnvironmentIntegrationResourceMethodBodyFormat string

EnvironmentIntegrationResourceMethodBodyFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	EnvironmentIntegrationResourceMethodBodyFormatJSON      EnvironmentIntegrationResourceMethodBodyFormat = "json"
	EnvironmentIntegrationResourceMethodBodyFormatForm      EnvironmentIntegrationResourceMethodBodyFormat = "form"
	EnvironmentIntegrationResourceMethodBodyFormatMultipart EnvironmentIntegrationResourceMethodBodyFormat = "multipart"
	EnvironmentIntegrationResourceMethodBodyFormatRaw       EnvironmentIntegrationResourceMethodBodyFormat = "raw"
	EnvironmentIntegrationResourceMethodBodyFormatXml       EnvironmentIntegrationResourceMethodBodyFormat = "xml"
)

Known EnvironmentIntegrationResourceMethodBodyFormat values.

type EnvironmentIntegrationResourceMethodMcpAnnotations

type EnvironmentIntegrationResourceMethodMcpAnnotations struct {
	// The tool does not modify its environment.
	ReadOnlyHint *bool `json:"readOnlyHint,omitempty"`
	// The tool may perform destructive updates (as opposed to purely additive ones).
	DestructiveHint *bool `json:"destructiveHint,omitempty"`
	// Calling the tool repeatedly with the same arguments has no additional effect.
	IdempotentHint *bool `json:"idempotentHint,omitempty"`
	// The tool interacts with an open world of external entities (as opposed to a closed domain).
	OpenWorldHint *bool `json:"openWorldHint,omitempty"`
}

Per-environment override for the method's MCP `ToolAnnotations` hints. See `IntegrationResourceMethod.mcp_annotations`. Absent means "no hint". Hints merge per key with the base method, so to tighten a base read to destructive the override must also set `readOnlyHint: false`; a merged object with both `true` is treated as no hint.

type EnvironmentIntegrationResourceMethodMethod

type EnvironmentIntegrationResourceMethodMethod string

EnvironmentIntegrationResourceMethodMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	EnvironmentIntegrationResourceMethodMethodGet        EnvironmentIntegrationResourceMethodMethod = "get"
	EnvironmentIntegrationResourceMethodMethodPost       EnvironmentIntegrationResourceMethodMethod = "post"
	EnvironmentIntegrationResourceMethodMethodPut        EnvironmentIntegrationResourceMethodMethod = "put"
	EnvironmentIntegrationResourceMethodMethodPatch      EnvironmentIntegrationResourceMethodMethod = "patch"
	EnvironmentIntegrationResourceMethodMethodDelete     EnvironmentIntegrationResourceMethodMethod = "delete"
	EnvironmentIntegrationResourceMethodMethodOptions    EnvironmentIntegrationResourceMethodMethod = "options"
	EnvironmentIntegrationResourceMethodMethodPropfind   EnvironmentIntegrationResourceMethodMethod = "propfind"
	EnvironmentIntegrationResourceMethodMethodReport     EnvironmentIntegrationResourceMethodMethod = "report"
	EnvironmentIntegrationResourceMethodMethodProppatch  EnvironmentIntegrationResourceMethodMethod = "proppatch"
	EnvironmentIntegrationResourceMethodMethodMkcalendar EnvironmentIntegrationResourceMethodMethod = "mkcalendar"
	EnvironmentIntegrationResourceMethodMethodMkcol      EnvironmentIntegrationResourceMethodMethod = "mkcol"
)

Known EnvironmentIntegrationResourceMethodMethod values.

type EnvironmentIntegrationResourceMethodPermissionVocabulary

type EnvironmentIntegrationResourceMethodPermissionVocabulary string

Per-environment override for which vocabulary `scopes` and `scopes_any_of` are written in. See `IntegrationResourceMethod.permission_vocabulary` for what the values mean and why the field normally stays unset. Overriding it here corrects one environment without touching the base integration.

Values the SDK does not know about decode unchanged.

const (
	EnvironmentIntegrationResourceMethodPermissionVocabularyOAuthScope       EnvironmentIntegrationResourceMethodPermissionVocabulary = "oauth_scope"
	EnvironmentIntegrationResourceMethodPermissionVocabularyAPIKeyPermission EnvironmentIntegrationResourceMethodPermissionVocabulary = "api_key_permission"
	EnvironmentIntegrationResourceMethodPermissionVocabularyRoleLabel        EnvironmentIntegrationResourceMethodPermissionVocabulary = "role_label"
)

Known EnvironmentIntegrationResourceMethodPermissionVocabulary values.

type EnvironmentIntegrationResourceMethodQueryArrayFormat

type EnvironmentIntegrationResourceMethodQueryArrayFormat string

EnvironmentIntegrationResourceMethodQueryArrayFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	EnvironmentIntegrationResourceMethodQueryArrayFormatComma    EnvironmentIntegrationResourceMethodQueryArrayFormat = "comma"
	EnvironmentIntegrationResourceMethodQueryArrayFormatBrackets EnvironmentIntegrationResourceMethodQueryArrayFormat = "brackets"
	EnvironmentIntegrationResourceMethodQueryArrayFormatIndices  EnvironmentIntegrationResourceMethodQueryArrayFormat = "indices"
	EnvironmentIntegrationResourceMethodQueryArrayFormatRepeat   EnvironmentIntegrationResourceMethodQueryArrayFormat = "repeat"
)

Known EnvironmentIntegrationResourceMethodQueryArrayFormat values.

type EnvironmentIntegrationResponse

type EnvironmentIntegrationResponse struct {
	// The ID of the environment integration.
	ID *string `json:"id,omitempty"`
	// The ID of the integration this environment integration references.
	IntegrationID *string `json:"integration_id,omitempty"`
	// The ID of the environment in which this integration is installed.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// Whether this integration is shown in the environment's catalog.
	ShowInCatalog *bool `json:"show_in_catalog,omitempty"`
	// Whether this integration is enabled in the environment.
	IsEnabled *bool `json:"is_enabled,omitempty"`
	// The date and time when the environment integration was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the environment integration was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// The referenced integration object.
	Integration *IntegrationResponse `json:"integration,omitempty"`
	// An optional config override applied for the integration at environment level. Deep-merged on top of the base `integration.config` at request time.
	Override *EnvironmentIntegrationConfig `json:"override,omitempty"`
	// Connections-widget-only configuration for this integration. Never merged into `integration.config`.
	LinkUIConfig *EnvironmentIntegrationLinkUiConfig `json:"link_ui_config,omitempty"`
}

EnvironmentIntegrationResponse is a Truto API object.

type EnvironmentIntegrationUpdateRequest

type EnvironmentIntegrationUpdateRequest struct {
	// Whether to show this integration in the environment's catalog.
	ShowInCatalog *bool `json:"show_in_catalog,omitempty"`
	// Whether the integration is enabled.
	IsEnabled *bool `json:"is_enabled,omitempty"`
	// An optional config override for the integration at environment level. Deep-merged on top of the base `integration.config`.
	Override *EnvironmentIntegrationConfig `json:"override,omitempty"`
	// Connections-widget configuration for this integration. **Replaced wholesale**, exactly like `override` — send the complete object every time, or `null` to clear it. An unknown key is a `400`.
	LinkUIConfig *EnvironmentIntegrationLinkUiConfig `json:"link_ui_config,omitempty"`
}

EnvironmentIntegrationUpdateRequest is a Truto API object.

type EnvironmentIntegrationsService

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

EnvironmentIntegrationsService manages integrations installed in the environment.

func (*EnvironmentIntegrationsService) Create

Create creates an item.

func (*EnvironmentIntegrationsService) Delete

Delete deletes an item.

func (*EnvironmentIntegrationsService) Get

Get fetches one item by ID.

func (*EnvironmentIntegrationsService) List

List returns an iterator over the items. Filter with WithQuery.

func (*EnvironmentIntegrationsService) Update

Update changes an item. Only the fields that are set are sent.

type EnvironmentResponse

type EnvironmentResponse struct {
	// The ID of the environment.
	ID *string `json:"id,omitempty"`
	// The name of the environment.
	Name *string `json:"name,omitempty"`
	// The ID of the team that owns this environment.
	TeamID *string `json:"team_id,omitempty"`
	// The date and time when the environment was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the environment was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

EnvironmentResponse is a Truto API object.

type EnvironmentUnifiedModelCreateRequest

type EnvironmentUnifiedModelCreateRequest struct {
	// The ID of the unified model to install.
	UnifiedModelID string `json:"unified_model_id"`
	// Optional override object for resources, scopes, webhooks, or docs. Deep-merged on top of the base unified model.
	Override *EnvironmentUnifiedModelOverride `json:"override,omitempty"`
}

EnvironmentUnifiedModelCreateRequest is a Truto API object.

type EnvironmentUnifiedModelDeleteResponse

type EnvironmentUnifiedModelDeleteResponse struct {
	// The ID of the deleted environment-unified-model record.
	ID *string `json:"id,omitempty"`
}

EnvironmentUnifiedModelDeleteResponse is a Truto API object.

type EnvironmentUnifiedModelDocs

type EnvironmentUnifiedModelDocs struct {
	PricingPlan []string `json:"pricing_plan,omitempty"`
	UserRole    []string `json:"user_role,omitempty"`
	Scopes      []string `json:"scopes,omitempty"`
	// Markdown-formatted integration-specific instructions.
	Instructions *string `json:"instructions,omitempty"`
}

Per-integration documentation overrides surfaced via `GET /unified/meta/{model_name}/{integration_name}`.

type EnvironmentUnifiedModelMappingStep

type EnvironmentUnifiedModelMappingStep struct {
	// Step kind. `request` performs an HTTP call against any integration resource; `state`/`replace_data` are reserved for runtime state mutation.
	Type EnvironmentUnifiedModelMappingStepType `json:"type"`
	// Optional step identifier referenced from later steps via `{{steps.<name>.response}}`.
	Name *string `json:"name,omitempty"`
	// JSONata expression; if it evaluates to falsy the step is skipped.
	RunIf *string `json:"run_if,omitempty"`
	// Optional fixed delay (in milliseconds) before the step runs.
	DelayMs *float64 `json:"delay_ms,omitempty"`
	// Step-specific config. For `request` on a unified-model method, the same shape as a unified-model integration mapping (`resource`, `method`, `query_mapping`, `body_mapping`, etc.).
	Config any `json:"config,omitempty"`
}

A single `before` / `after` step. Used by unified-model resource methods, where Truto runs it around the main HTTP request, and by `before` on proxy resource methods (`IntegrationResourceMethod.before`), where Truto only stores it for engines that run proxy configs.

type EnvironmentUnifiedModelMappingStepType

type EnvironmentUnifiedModelMappingStepType string

Step kind. `request` performs an HTTP call against any integration resource; `state`/`replace_data` are reserved for runtime state mutation.

Values the SDK does not know about decode unchanged.

const (
	EnvironmentUnifiedModelMappingStepTypeRequest     EnvironmentUnifiedModelMappingStepType = "request"
	EnvironmentUnifiedModelMappingStepTypeState       EnvironmentUnifiedModelMappingStepType = "state"
	EnvironmentUnifiedModelMappingStepTypeReplaceData EnvironmentUnifiedModelMappingStepType = "replace_data"
)

Known EnvironmentUnifiedModelMappingStepType values.

type EnvironmentUnifiedModelOverride

type EnvironmentUnifiedModelOverride struct {
	// Resource-level overrides keyed by resource name.
	Resources map[string]*EnvironmentUnifiedModelResourceOverride `json:"resources,omitempty"`
	// Per-integration extra OAuth scopes appended to the base unified-model scopes.
	Scopes map[string][]string `json:"scopes,omitempty"`
	// Per-integration JSONata expressions that route inbound webhooks to unified-model resources.
	Webhooks map[string]string `json:"webhooks,omitempty"`
	// Per-integration documentation overrides.
	Docs map[string]EnvironmentUnifiedModelDocs `json:"docs,omitempty"`
}

Per-environment override for a unified-model installation. Stored on `environment_unified_model.override` and deep-merged on top of the base `unified_model`.

type EnvironmentUnifiedModelResourceMethodCreateRequest

type EnvironmentUnifiedModelResourceMethodCreateRequest struct {
	// The `environment_unified_model` record to attach the override to — get it from `GET /environment-unified-model?unified_model_id=…`. Must belong to an environment you have access to.
	EnvironmentUnifiedModelID string `json:"environment_unified_model_id"`
	// The unified resource name (e.g. `contacts`).
	ResourceName string `json:"resource_name"`
	// The integration slug (e.g. `apollo`).
	IntegrationName string `json:"integration_name"`
	// The unified method name (`list`, `get`, `create`, `update`, `delete`, or a custom method).
	MethodName string `json:"method_name"`
	// The override mapping for this method, deep-merged on top of the base mapping.
	Config *UnifiedModelResourceMethod `json:"config,omitempty"`
}

EnvironmentUnifiedModelResourceMethodCreateRequest is a Truto API object.

type EnvironmentUnifiedModelResourceMethodDeleteResponse

type EnvironmentUnifiedModelResourceMethodDeleteResponse struct {
	// The ID of the deleted override row.
	ID *string `json:"id,omitempty"`
}

EnvironmentUnifiedModelResourceMethodDeleteResponse is a Truto API object.

type EnvironmentUnifiedModelResourceMethodOverride

type EnvironmentUnifiedModelResourceMethodOverride struct {
	// Static value returned for this method without making an HTTP call. Useful for stubbing.
	Static any `json:"static,omitempty"`
	// Override which integration resource this method points to. Either a resource name, an array of resource fragments to merge, or `{ expression, resources }` to pick dynamically.
	Resource any `json:"resource,omitempty"`
	// Override which integration method this maps to.
	Method any `json:"method,omitempty"`
	// JSONata expression returning a per-call base URL override.
	BaseURLMapping *string `json:"base_url_mapping,omitempty"`
	// JSONata expression returning a per-call path override.
	PathMapping *string `json:"path_mapping,omitempty"`
	// JSONata expression returning an error message when the upstream response should be treated as an error.
	ErrorMapping *string `json:"error_mapping,omitempty"`
	// Mapping schema version. `2` opts into object-form mappings (`*_schema` fields); omit (`undefined`) for legacy string-form mappings (`*_mapping` fields).
	MappingVersion *float64 `json:"mapping_version,omitempty"`
	// For object-form mappings, whether the response represents a single item or an array.
	ResponseMappingMethod *EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod `json:"response_mapping_method,omitempty"`
	// JSONata expression (string) or object-form mapping that transforms the integration response into the unified-model shape.
	ResponseMapping   any     `json:"response_mapping,omitempty"`
	DocumentationLink *string `json:"documentation_link,omitempty"`
	// Sub-fetches that run after the main request to enrich the response. Either a JSONata string or an array of related-resource configs.
	RelatedResources any `json:"related_resources,omitempty"`
	// Object-form (v2) request body schema (JSON-schema-style with embedded mappings).
	RequestBodySchema map[string]JsonSchemaObjectProperties `json:"request_body_schema,omitempty"`
	// Legacy (v1) string-form request body mapping, OR object-form (v2) request body mapping.
	RequestBodyMapping any `json:"request_body_mapping,omitempty"`
	// Legacy (v1) string-form query mapping, OR object-form (v2) query mapping.
	QueryMapping any `json:"query_mapping,omitempty"`
	// Object-form (v2) query schema.
	QuerySchema any `json:"query_schema,omitempty"`
	// JSONata expression that transforms the unified-API request headers before sending.
	RequestHeaderMapping *string `json:"request_header_mapping,omitempty"`
	// JSONata expression that transforms the integration response headers before returning.
	ResponseHeaderMapping *string `json:"response_header_mapping,omitempty"`
	// Static query params merged into the integration request. Values may be templated JSONata expressions.
	Query map[string]any `json:"query,omitempty"`
	// Static body merged into the integration request. Values may be templated JSONata expressions.
	Body map[string]any `json:"body,omitempty"`
	// Pre-request steps. Either a JSONata string for inline transforms or an array of `EnvironmentUnifiedModelMappingStep`.
	Before any `json:"before,omitempty"`
	// Post-response steps.
	After any `json:"after,omitempty"`
	// Marks the response as partial; downstream sync engines will treat missing fields as "unknown" rather than "deleted".
	IsPartialResponse *bool `json:"is_partial_response,omitempty"`
	// JSONata expression that returns true when the response should be considered partial.
	IsPartialExpression *string                                    `json:"is_partial_expression,omitempty"`
	SideLoad            map[string]EnvironmentUnifiedModelSideLoad `json:"side_load,omitempty"`
	// File-upload strategy for `create`/`update` methods that accept files.
	FileUpload any `json:"file_upload,omitempty"`
}

Per-environment override for a single unified-model resource method (e.g. `crm.contacts.list` on `salesforce`).

type EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod

type EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod string

For object-form mappings, whether the response represents a single item or an array.

Values the SDK does not know about decode unchanged.

const (
	EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethodArray EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod = "array"
	EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethodItem  EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod = "item"
)

Known EnvironmentUnifiedModelResourceMethodOverrideResponseMappingMethod values.

type EnvironmentUnifiedModelResourceMethodRowResponse

type EnvironmentUnifiedModelResourceMethodRowResponse struct {
	// The ID of the environment resource-method override row.
	ID *string `json:"id,omitempty"`
	// The `environment_unified_model` record (environment + unified model pair) this override belongs to.
	EnvironmentUnifiedModelID *string `json:"environment_unified_model_id,omitempty"`
	// The unified resource this override serves (e.g. `contacts`).
	ResourceName *string `json:"resource_name,omitempty"`
	// The integration slug this override serves (e.g. `apollo`).
	IntegrationName *string `json:"integration_name,omitempty"`
	// The unified method this override serves (`list`, `get`, `create`, `update`, `delete`, or a custom method name).
	MethodName *string `json:"method_name,omitempty"`
	// The override mapping, deep-merged on top of the base `unified_model_resource_method` config for the same (resource, integration, method) triple.
	Config *UnifiedModelResourceMethod `json:"config,omitempty"`
	// Optimistic-concurrency version. Send the current value in a PATCH body; every write increments it.
	Version   *float64 `json:"version,omitempty"`
	CreatedAt *string  `json:"created_at,omitempty"`
	UpdatedAt *string  `json:"updated_at,omitempty"`
}

One row of the `environment_unified_model_resource_method` table — an **environment-scoped** override of a single unified-model mapping. Writing here changes behaviour only for the environment that owns the parent `environment_unified_model` record; the base `unified_model_resource_method` row (and therefore every other environment) is untouched.

type EnvironmentUnifiedModelResourceMethodUpdateRequest

type EnvironmentUnifiedModelResourceMethodUpdateRequest struct {
	// Move the override to a different unified resource.
	ResourceName *string `json:"resource_name,omitempty"`
	// Move the override to a different integration slug.
	IntegrationName *string `json:"integration_name,omitempty"`
	// Move the override to a different unified method.
	MethodName *string `json:"method_name,omitempty"`
	// The replacement override mapping.
	Config *UnifiedModelResourceMethod `json:"config,omitempty"`
	// The row's current version. Required to avoid clobbering a concurrent write.
	Version *float64 `json:"version,omitempty"`
}

EnvironmentUnifiedModelResourceMethodUpdateRequest is a Truto API object.

type EnvironmentUnifiedModelResourceMethodsService

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

EnvironmentUnifiedModelResourceMethodsService manages environment-level overrides of unified model resource methods.

func (*EnvironmentUnifiedModelResourceMethodsService) Create

Create creates an item.

func (*EnvironmentUnifiedModelResourceMethodsService) Delete

Delete deletes an item.

func (*EnvironmentUnifiedModelResourceMethodsService) Get

Get fetches one item by ID.

func (*EnvironmentUnifiedModelResourceMethodsService) List

List returns an iterator over the items. Filter with WithQuery.

func (*EnvironmentUnifiedModelResourceMethodsService) Update

Update changes an item. Only the fields that are set are sent.

type EnvironmentUnifiedModelResourceOverride

type EnvironmentUnifiedModelResourceOverride struct {
	Description *string `json:"description,omitempty"`
	// Partial JSON schema for the resource. Field-merged on top of the base resource schema.
	Schema *JsonSchemaObject `json:"schema,omitempty"`
	// Overrides per integration → per method.
	IntegrationMapping map[string]map[string]EnvironmentUnifiedModelResourceMethodOverride `json:"integration_mapping,omitempty"`
}

Per-environment override for a single unified-model resource (e.g. `contacts` in the `crm` model).

type EnvironmentUnifiedModelResponse

type EnvironmentUnifiedModelResponse struct {
	// The ID of the environment-unified-model record.
	ID *string `json:"id,omitempty"`
	// The ID of the unified model being installed or overridden.
	UnifiedModelID *string `json:"unified_model_id,omitempty"`
	// The ID of the environment where this unified model is installed.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// An optional object containing environment-level overrides for the unified model. Deep-merged on top of the base unified model. See `EnvironmentUnifiedModelOverride` for the typed shape.
	Override *EnvironmentUnifiedModelOverride `json:"override,omitempty"`
	// Timestamp when this record was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// Timestamp when this record was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// The full unified model object, with any overrides merged in.
	UnifiedModel *UnifiedModelResponse `json:"unified_model,omitempty"`
}

EnvironmentUnifiedModelResponse is a Truto API object.

type EnvironmentUnifiedModelSideLoad

type EnvironmentUnifiedModelSideLoad struct {
	// JSON path inside the unified response where the side-loaded data should be attached.
	Path []string `json:"path"`
	// JSONata expression that produces the side-loaded value from the related record.
	ResponseMapping string `json:"response_mapping"`
}

Side-load configuration that fetches related records and merges them into the response under `path`.

type EnvironmentUnifiedModelUpdateRequest

type EnvironmentUnifiedModelUpdateRequest struct {
	// The updated override object. Deep-merged on top of the base unified model.
	Override *EnvironmentUnifiedModelOverride `json:"override,omitempty"`
}

EnvironmentUnifiedModelUpdateRequest is a Truto API object.

type EnvironmentUnifiedModelsService

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

EnvironmentUnifiedModelsService manages unified models installed in the environment.

func (*EnvironmentUnifiedModelsService) Create

Create creates an item.

func (*EnvironmentUnifiedModelsService) Delete

Delete deletes an item.

func (*EnvironmentUnifiedModelsService) Get

Get fetches one item by ID.

func (*EnvironmentUnifiedModelsService) List

List returns an iterator over the items. Filter with WithQuery.

func (*EnvironmentUnifiedModelsService) Update

Update changes an item. Only the fields that are set are sent.

type EnvironmentsService

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

EnvironmentsService manages environments of the team.

func (*EnvironmentsService) Get

Get fetches one item by ID.

func (*EnvironmentsService) List

List returns an iterator over the items. Filter with WithQuery.

func (*EnvironmentsService) Update

func (s *EnvironmentsService) Update(ctx context.Context, id string, body Record, opts ...Option) (*EnvironmentResponse, error)

Update changes an item. Only the fields that are set are sent.

type Error

type Error struct {
	// StatusCode is the HTTP status code, e.g. 404.
	StatusCode int
	// Status is the HTTP status text, e.g. "404 Not Found".
	Status string
	// Body is the parsed JSON body, or the body as a string when it is not JSON.
	Body any
	// RawBody is the response body as received.
	RawBody []byte
	// Header holds the response headers.
	Header http.Header
	// Method and Path identify the request that failed.
	Method string
	Path   string
}

Error is returned when the Truto API answers with a non-2xx status.

func (*Error) DecodeBody

func (e *Error) DecodeBody(v any) error

DecodeBody decodes the JSON error body into v.

func (*Error) Error

func (e *Error) Error() string

func (*Error) Message

func (e *Error) Message() string

Message returns the "message" or "error" field of a JSON error body, if any. Truto puts the detail in "message" and the status text in "error", as in {"message":"state_key is required","statusCode":400,"error":"Bad Request"}.

type ForbiddenErrorInsightSchema

type ForbiddenErrorInsightSchema struct {
	// A sentence derived from `value.refusal_basis`, safe to show a reader as-is.
	Description string                           `json:"description"`
	Resource    string                           `json:"resource"`
	Method      string                           `json:"method"`
	Value       ForbiddenErrorInsightSchemaValue `json:"value"`
}

Present on a 403 from the provider, on both the Unified and Proxy APIs. Not every 403 is a scope problem: `value.refusal_basis` states what Truto can say the refusal rests on.

type ForbiddenErrorInsightSchemaValue

type ForbiddenErrorInsightSchemaValue struct {
	// Always present. **Treat this as an open set**: the values below are the ones Truto
	// emits today, and the read path deliberately accepts an unrecognised one so a newly
	// shipped state cannot break a client — or an older Truto build — that has not heard
	// of it. Generate a permissive type from it and keep a default branch.
	RefusalBasis ForbiddenErrorInsightSchemaValueRefusalBasis `json:"refusal_basis"`
	// Declared all-of scopes absent from the grant. Present only for `scopes_missing`
	// and `scopes_satisfied`. Do not default an absent value to `[]` — absent means no
	// comparison ran, which is not the same statement as "nothing is missing".
	MissingScopes []string `json:"missing_scopes,omitempty"`
	// Scopes of which the operation needs any one, where the grant holds none.
	MissingAnyOfScopes []string `json:"missing_any_of_scopes,omitempty"`
	// What the operation requires, whether or not a comparison was possible. Always
	// paired with `permission_vocabulary`.
	RequiredPermissions []string `json:"required_permissions,omitempty"`
	// Permissions of which the operation needs any one.
	RequiredAnyOfPermissions []string `json:"required_any_of_permissions,omitempty"`
	// Which vocabulary the required permissions are written in, and therefore what the
	// remedy is. Only `oauth_scope` is fixed by reconnecting.
	PermissionVocabulary *ForbiddenErrorInsightSchemaValuePermissionVocabulary `json:"permission_vocabulary,omitempty"`
}

ForbiddenErrorInsightSchemaValue is a Truto API object.

type ForbiddenErrorInsightSchemaValuePermissionVocabulary

type ForbiddenErrorInsightSchemaValuePermissionVocabulary string

Which vocabulary the required permissions are written in, and therefore what the remedy is. Only `oauth_scope` is fixed by reconnecting.

Values the SDK does not know about decode unchanged.

const (
	ForbiddenErrorInsightSchemaValuePermissionVocabularyOAuthScope       ForbiddenErrorInsightSchemaValuePermissionVocabulary = "oauth_scope"
	ForbiddenErrorInsightSchemaValuePermissionVocabularyAPIKeyPermission ForbiddenErrorInsightSchemaValuePermissionVocabulary = "api_key_permission"
	ForbiddenErrorInsightSchemaValuePermissionVocabularyRoleLabel        ForbiddenErrorInsightSchemaValuePermissionVocabulary = "role_label"
)

Known ForbiddenErrorInsightSchemaValuePermissionVocabulary values.

type ForbiddenErrorInsightSchemaValueRefusalBasis

type ForbiddenErrorInsightSchemaValueRefusalBasis string

Always present. **Treat this as an open set**: the values below are the ones Truto emits today, and the read path deliberately accepts an unrecognised one so a newly shipped state cannot break a client — or an older Truto build — that has not heard of it. Generate a permissive type from it and keep a default branch.

Values the SDK does not know about decode unchanged.

const (
	ForbiddenErrorInsightSchemaValueRefusalBasisScopesMissing       ForbiddenErrorInsightSchemaValueRefusalBasis = "scopes_missing"
	ForbiddenErrorInsightSchemaValueRefusalBasisScopesSatisfied     ForbiddenErrorInsightSchemaValueRefusalBasis = "scopes_satisfied"
	ForbiddenErrorInsightSchemaValueRefusalBasisNonScopeRequirement ForbiddenErrorInsightSchemaValueRefusalBasis = "non_scope_requirement"
	ForbiddenErrorInsightSchemaValueRefusalBasisNoScopeConcept      ForbiddenErrorInsightSchemaValueRefusalBasis = "no_scope_concept"
	ForbiddenErrorInsightSchemaValueRefusalBasisNotDetermined       ForbiddenErrorInsightSchemaValueRefusalBasis = "not_determined"
)

Known ForbiddenErrorInsightSchemaValueRefusalBasis values.

type GroupMappingResponse

type GroupMappingResponse struct {
	// The ID of the group mapping.
	ID *string `json:"id,omitempty"`
	// The ID of the team that owns this group mapping.
	TeamID *string `json:"team_id,omitempty"`
	// The ID of the SCIM group this mapping applies to.
	ScimGroupID *string `json:"scim_group_id,omitempty"`
	// The role granted to members of the mapped SCIM group. Null leaves the role unchanged.
	Role *GroupMappingResponseRole `json:"role,omitempty"`
	// Environment IDs that members of the mapped group are granted access to.
	EnvironmentIDs []string `json:"environment_ids,omitempty"`
	// The date and time when the group mapping was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the group mapping was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

GroupMappingResponse is a Truto API object.

type GroupMappingResponseRole

type GroupMappingResponseRole string

The role granted to members of the mapped SCIM group. Null leaves the role unchanged.

Values the SDK does not know about decode unchanged.

const (
	GroupMappingResponseRoleAdmin  GroupMappingResponseRole = "admin"
	GroupMappingResponseRoleMember GroupMappingResponseRole = "member"
)

Known GroupMappingResponseRole values.

type HttpRequestFields

type HttpRequestFields struct {
	// The hostname that served the request.
	Host *string `json:"host,omitempty"`
	// The full URL of the request (with sensitive paths masked).
	HTTPURL *string `json:"http_url,omitempty"`
	// The HTTP status code of the response.
	HTTPStatusCode *int64 `json:"http_status_code,omitempty"`
	// The HTTP method of the request.
	HTTPMethod *string `json:"http_method,omitempty"`
	// The IP address of the client.
	HTTPIP *string `json:"http_ip,omitempty"`
	// The Cloudflare Ray ID for the request.
	HTTPRequestID *string `json:"http_request_id,omitempty"`
	// The country code of the client (from Cloudflare).
	HTTPCountry *string `json:"http_country,omitempty"`
	// The User-Agent header of the request.
	HTTPUseragent *string `json:"http_useragent,omitempty"`
	// The hostname portion of the request URL.
	HTTPURLDetailsHost *string `json:"http_url_details_host,omitempty"`
	// The path portion of the request URL. On `mcp` rows the token
	// segment is masked in full, so the value is always
	// `/mcp/[redacted]` and identifies nothing — use
	// `mcp_server_id` / `mcp_server_name` instead.
	HTTPURLDetailsPath *string `json:"http_url_details_path,omitempty"`
	// The parsed query string parameters of the request URL.
	HTTPURLDetailsQueryString map[string]any `json:"http_url_details_query_string,omitempty"`
	// The URL scheme.
	HTTPURLDetailsScheme *string `json:"http_url_details_scheme,omitempty"`
	// The HTTP protocol version.
	HTTPVersion *string `json:"http_version,omitempty"`
	// How the request was authenticated.
	AuthenticationType *HttpRequestFieldsAuthenticationType `json:"authentication_type,omitempty"`
	// The ID of the authenticated user, if applicable.
	UserID *string `json:"user_id,omitempty"`
	// The response headers returned to the client.
	ResponseHeaders map[string]string `json:"response_headers,omitempty"`
}

HTTP request/response context shared by log types that originate from an inbound HTTP request (`unified_proxy_api` and `mcp`).

type HttpRequestFieldsAuthenticationType

type HttpRequestFieldsAuthenticationType string

How the request was authenticated.

Values the SDK does not know about decode unchanged.

const (
	HttpRequestFieldsAuthenticationTypeSession           HttpRequestFieldsAuthenticationType = "session"
	HttpRequestFieldsAuthenticationTypeAPIToken          HttpRequestFieldsAuthenticationType = "api_token"
	HttpRequestFieldsAuthenticationTypeIntegratedAccount HttpRequestFieldsAuthenticationType = "integrated_account"
)

Known HttpRequestFieldsAuthenticationType values.

type IntegratedAccount

type IntegratedAccount struct {
	// The ID of the integrated account.
	ID *string `json:"id,omitempty"`
	// The ID of the tenant.
	TenantID *string `json:"tenant_id,omitempty"`
	// The ID of the environment integration (installed integration).
	EnvironmentIntegrationID *string `json:"environment_integration_id,omitempty"`
	// The context of the integrated account. You can find these in the `Variables` section of an integrated account in the Truto UI.
	Context map[string]any `json:"context,omitempty"`
	// Status of the integrated account.
	Status *IntegratedAccountStatus `json:"status,omitempty"`
	// The last error that occurred while running the post install or validation steps.
	LastError *string `json:"last_error,omitempty"`
	// Details of the most recent `403 Forbidden` returned by the third-party API for this
	// account, or `null` if the most recent call succeeded. Cleared automatically on the next
	// successful call.
	LastForbiddenError *IntegratedAccountLastForbiddenError `json:"last_forbidden_error,omitempty"`
	// The results of the post install and validation steps that ran on the integrated account.
	LastActionResult map[string]any `json:"last_action_result,omitempty"`
	// The date and time when the integrated account was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the integrated account was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// Whether the integrated account is in sandbox mode or not. Sandbox integrated accounts do not allow any "write" operations.
	IsSandbox *bool `json:"is_sandbox,omitempty"`
	// Type of authentication used.
	AuthenticationMethod *IntegratedAccountAuthenticationMethod `json:"authentication_method,omitempty"`
	// The region where the integrated account is placed.
	Region *IntegratedAccountRegion `json:"region,omitempty"`
}

IntegratedAccount is a Truto API object.

type IntegratedAccountAuthenticationMethod

type IntegratedAccountAuthenticationMethod string

Type of authentication used.

Values the SDK does not know about decode unchanged.

const (
	IntegratedAccountAuthenticationMethodOAuth2                  IntegratedAccountAuthenticationMethod = "oauth2"
	IntegratedAccountAuthenticationMethodOAuth                   IntegratedAccountAuthenticationMethod = "oauth"
	IntegratedAccountAuthenticationMethodAPIKey                  IntegratedAccountAuthenticationMethod = "api_key"
	IntegratedAccountAuthenticationMethodOAuth2ClientCredentials IntegratedAccountAuthenticationMethod = "oauth2_client_credentials"
	IntegratedAccountAuthenticationMethodKekaOAuth               IntegratedAccountAuthenticationMethod = "keka_oauth"
	IntegratedAccountAuthenticationMethodJWTBearer               IntegratedAccountAuthenticationMethod = "jwt_bearer"
	IntegratedAccountAuthenticationMethodAwsSts                  IntegratedAccountAuthenticationMethod = "aws_sts"
)

Known IntegratedAccountAuthenticationMethod values.

type IntegratedAccountCreate

type IntegratedAccountCreate struct {
	// The ID of the tenant.
	TenantID *string `json:"tenant_id,omitempty"`
	// The ID of the environment integration (installed integration).
	EnvironmentIntegrationID *string `json:"environment_integration_id,omitempty"`
	// The context of the integrated account.
	Context map[string]any `json:"context,omitempty"`
	// Type of authentication used.
	AuthenticationMethod *IntegratedAccountCreateAuthenticationMethod `json:"authentication_method,omitempty"`
	// The region where the integrated account is placed.
	Region *IntegratedAccountCreateRegion `json:"region,omitempty"`
}

IntegratedAccountCreate is a Truto API object.

type IntegratedAccountCreateAuthenticationMethod

type IntegratedAccountCreateAuthenticationMethod string

Type of authentication used.

Values the SDK does not know about decode unchanged.

const (
	IntegratedAccountCreateAuthenticationMethodOAuth2                  IntegratedAccountCreateAuthenticationMethod = "oauth2"
	IntegratedAccountCreateAuthenticationMethodOAuth                   IntegratedAccountCreateAuthenticationMethod = "oauth"
	IntegratedAccountCreateAuthenticationMethodAPIKey                  IntegratedAccountCreateAuthenticationMethod = "api_key"
	IntegratedAccountCreateAuthenticationMethodOAuth2ClientCredentials IntegratedAccountCreateAuthenticationMethod = "oauth2_client_credentials"
	IntegratedAccountCreateAuthenticationMethodKekaOAuth               IntegratedAccountCreateAuthenticationMethod = "keka_oauth"
	IntegratedAccountCreateAuthenticationMethodJWTBearer               IntegratedAccountCreateAuthenticationMethod = "jwt_bearer"
	IntegratedAccountCreateAuthenticationMethodAwsSts                  IntegratedAccountCreateAuthenticationMethod = "aws_sts"
)

Known IntegratedAccountCreateAuthenticationMethod values.

type IntegratedAccountCreateRegion

type IntegratedAccountCreateRegion string

The region where the integrated account is placed.

Values the SDK does not know about decode unchanged.

const (
	IntegratedAccountCreateRegionWnam IntegratedAccountCreateRegion = "wnam"
	IntegratedAccountCreateRegionEnam IntegratedAccountCreateRegion = "enam"
	IntegratedAccountCreateRegionApac IntegratedAccountCreateRegion = "apac"
	IntegratedAccountCreateRegionEu   IntegratedAccountCreateRegion = "eu"
)

Known IntegratedAccountCreateRegion values.

type IntegratedAccountCredentialsUpdateRequest

type IntegratedAccountCredentialsUpdateRequest struct {
	// The credential fields to update in the integrated account context
	Context map[string]any `json:"context"`
}

IntegratedAccountCredentialsUpdateRequest is a Truto API object.

type IntegratedAccountFormTokenRequest

type IntegratedAccountFormTokenRequest struct {
	// The connection whose post-connect form should be reopened. Must belong to this session's tenant.
	IntegratedAccountID string `json:"integrated_account_id"`
}

IntegratedAccountFormTokenRequest is a Truto API object.

type IntegratedAccountFormTokenResponse

type IntegratedAccountFormTokenResponse struct {
	// The purpose-limited token. Keep it in memory; never put it in a URL.
	IntegratedAccountToken *string `json:"integrated_account_token,omitempty"`
	// When the token stops working.
	ExpiresAt *string `json:"expires_at,omitempty"`
}

IntegratedAccountFormTokenResponse is a Truto API object.

type IntegratedAccountLastForbiddenError

type IntegratedAccountLastForbiddenError struct {
	// The third-party resource that was forbidden.
	Resource *string `json:"resource,omitempty"`
	// The method that was attempted on that resource.
	Method *string `json:"method,omitempty"`
	// The scopes required by this resource and method that the provider did not confirm as
	// granted.
	MissingScopes []string `json:"missing_scopes,omitempty"`
	// Which of the states below produced this record, so a reader never has to infer it
	// from the presence or emptiness of `missing_scopes`. Absent on rows recorded before
	// Truto stored it — and on such a row an empty `missing_scopes` cannot be read as
	// "compared, nothing missing", because it was also written when nothing had been
	// compared at all.
	RefusalBasis *string `json:"refusal_basis,omitempty"`
	// The sentence the live 403 carried, recorded so this row reads the same as the call did.
	Description *string `json:"description,omitempty"`
	// Scopes of which the operation needs *any one*, where the grant holds none. Kept
	// apart from `missing_scopes` so alternatives are never reported as though all were
	// required.
	MissingAnyOfScopes []string `json:"missing_any_of_scopes,omitempty"`
	// What this operation requires, whether or not a comparison was possible. Always
	// paired with `permission_vocabulary`, since the same string means "reconnect and
	// grant this", "add this to your API key" or "ask an admin for this role" depending
	// on which vocabulary it is written in.
	RequiredPermissions []string `json:"required_permissions,omitempty"`
	// Permissions of which the operation needs *any one*, kept apart from `required_permissions` for the same reason.
	RequiredAnyOfPermissions []string `json:"required_any_of_permissions,omitempty"`
	// Which vocabulary `required_permissions` is written in, and therefore what the
	// remedy is. Only `oauth_scope` is fixed by reconnecting: `api_key_permission` is
	// granted to the API key in the provider, and `role_label` in the provider's own
	// admin console.
	PermissionVocabulary *string `json:"permission_vocabulary,omitempty"`
	// A capped copy of the integration's own error body, so this record shows what the
	// provider said and not only what Truto inferred about it. Truncated with a trailing
	// `… truncated` marker past 2,048 **bytes** of UTF-8, because this record is
	// deserialized on every proxy and unified call that resolves the account and that cost
	// is what the bound exists to control. Bytes, not characters: 2,048 characters of CJK
	// is about 6 KB stored, so a character bound would charge one language three times
	// what it charges another. Expect fewer characters than 2,048 for any non-ASCII body.
	// The 2,048 covers the marker as well, so the stored value never exceeds it.
	RawResponseExcerpt *string `json:"raw_response_excerpt,omitempty"`
	// When the forbidden response was recorded.
	OccurredAt *string `json:"occurred_at,omitempty"`
}

Details of the most recent `403 Forbidden` returned by the third-party API for this account, or `null` if the most recent call succeeded. Cleared automatically on the next successful call.

type IntegratedAccountMcpCreateRequest

type IntegratedAccountMcpCreateRequest struct {
	// The name of the MCP server.
	Name   string                                  `json:"name"`
	Config IntegratedAccountMcpCreateRequestConfig `json:"config"`
}

IntegratedAccountMcpCreateRequest is a Truto API object.

type IntegratedAccountMcpCreateRequestConfig

type IntegratedAccountMcpCreateRequestConfig struct {
	// The methods allowed for this server.
	Methods []string `json:"methods,omitempty"`
	// The tags associated with this server.
	Tags []string `json:"tags,omitempty"`
}

IntegratedAccountMcpCreateRequestConfig is a Truto API object.

type IntegratedAccountMcpUpdateRequest

type IntegratedAccountMcpUpdateRequest struct {
	// The new name for the MCP server.
	Name *string `json:"name,omitempty"`
	// Updated configuration settings for the MCP server
	Config *IntegratedAccountMcpUpdateRequestConfig `json:"config,omitempty"`
}

IntegratedAccountMcpUpdateRequest is a Truto API object.

type IntegratedAccountMcpUpdateRequestConfig

type IntegratedAccountMcpUpdateRequestConfig struct {
	// The methods allowed for this server.
	Methods []string `json:"methods,omitempty"`
	// The tags associated with this server.
	Tags []string `json:"tags,omitempty"`
}

Updated configuration settings for the MCP server

type IntegratedAccountRefreshCredentialsRequest

type IntegratedAccountRefreshCredentialsRequest struct {
	// The ID of the integrated account you want to refresh the credentials for.
	ID string `json:"id"`
}

IntegratedAccountRefreshCredentialsRequest is a Truto API object.

type IntegratedAccountRefreshCredentialsResponse

type IntegratedAccountRefreshCredentialsResponse struct {
	Success *bool `json:"success,omitempty"`
}

IntegratedAccountRefreshCredentialsResponse is a Truto API object.

type IntegratedAccountRefreshMappingCacheRequest

type IntegratedAccountRefreshMappingCacheRequest struct {
	// The environment whose cache to refresh. Optional when authenticating with an API token, which is already scoped to one environment — required otherwise.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// Restrict the per-connection clears to this integration's connections, and also drop its cached integration configuration. Must be an integration installed in this environment.
	IntegrationID *string `json:"integration_id,omitempty"`
}

IntegratedAccountRefreshMappingCacheRequest is a Truto API object.

type IntegratedAccountRefreshMappingCacheResponse

type IntegratedAccountRefreshMappingCacheResponse struct {
	// The environment the refresh was applied to.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The integration the refresh was narrowed to, if any.
	IntegrationID *string `json:"integration_id,omitempty"`
	// How many shared cache entries were deleted.
	DeletedCacheKeyCount *int64 `json:"deleted_cache_key_count,omitempty"`
	// True when the sweep did not finish — some shared entries are still cached and will expire on their own. Call again to continue.
	CacheKeysTruncated *bool `json:"cache_keys_truncated,omitempty"`
	// How many of the environment's connections are having their per-connection cache cleared.
	IntegratedAccountCount *int64 `json:"integrated_account_count,omitempty"`
	// True when the environment has more connections than one refresh covers, so some keep their cached copy until it expires.
	IntegratedAccountsTruncated *bool `json:"integrated_accounts_truncated,omitempty"`
	// The same caveat in prose, safe to surface to a user.
	Message *string `json:"message,omitempty"`
}

IntegratedAccountRefreshMappingCacheResponse is a Truto API object.

type IntegratedAccountRegion

type IntegratedAccountRegion string

The region where the integrated account is placed.

Values the SDK does not know about decode unchanged.

const (
	IntegratedAccountRegionWnam IntegratedAccountRegion = "wnam"
	IntegratedAccountRegionEnam IntegratedAccountRegion = "enam"
	IntegratedAccountRegionApac IntegratedAccountRegion = "apac"
	IntegratedAccountRegionEu   IntegratedAccountRegion = "eu"
)

Known IntegratedAccountRegion values.

type IntegratedAccountResponse

type IntegratedAccountResponse struct {
	// The ID of the integrated account.
	ID *string `json:"id,omitempty"`
	// The ID of the tenant.
	TenantID *string `json:"tenant_id,omitempty"`
	// The ID of the environment integration (installed integration).
	EnvironmentIntegrationID *string `json:"environment_integration_id,omitempty"`
	// The context of the integrated account. You can find these in the `Variables` section of an integrated account in the Truto UI.
	Context map[string]any `json:"context,omitempty"`
	// Status of the integrated account.
	Status *IntegratedAccountStatus `json:"status,omitempty"`
	// The last error that occurred while running the post install or validation steps.
	LastError *string `json:"last_error,omitempty"`
	// Details of the most recent `403 Forbidden` returned by the third-party API for this
	// account, or `null` if the most recent call succeeded. Cleared automatically on the next
	// successful call.
	LastForbiddenError *IntegratedAccountLastForbiddenError `json:"last_forbidden_error,omitempty"`
	// The results of the post install and validation steps that ran on the integrated account.
	LastActionResult map[string]any `json:"last_action_result,omitempty"`
	// The date and time when the integrated account was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the integrated account was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// Whether the integrated account is in sandbox mode or not. Sandbox integrated accounts do not allow any "write" operations.
	IsSandbox *bool `json:"is_sandbox,omitempty"`
	// Type of authentication used.
	AuthenticationMethod *IntegratedAccountAuthenticationMethod `json:"authentication_method,omitempty"`
	// The region where the integrated account is placed.
	Region *IntegratedAccountRegion `json:"region,omitempty"`
	// The ID of the environment this integrated account belongs to.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The integration associated with this integrated account.
	Integration *IntegrationSchema `json:"integration,omitempty"`
	// The list of context fields that are stored in the object store.
	ObjectStoreContextFields []string `json:"object_store_context_fields,omitempty"`
}

IntegratedAccountResponse is a Truto API object.

type IntegratedAccountRunPostInstallActionsRequest

type IntegratedAccountRunPostInstallActionsRequest struct {
	// The ID of the integrated account you want to the post install actions for.
	ID string `json:"id"`
}

IntegratedAccountRunPostInstallActionsRequest is a Truto API object.

type IntegratedAccountRunPostInstallActionsResponse

type IntegratedAccountRunPostInstallActionsResponse struct {
	Success *bool `json:"success,omitempty"`
}

IntegratedAccountRunPostInstallActionsResponse is a Truto API object.

type IntegratedAccountStatus

type IntegratedAccountStatus string

Status of the integrated account.

Values the SDK does not know about decode unchanged.

const (
	IntegratedAccountStatusActive           IntegratedAccountStatus = "active"
	IntegratedAccountStatusConnecting       IntegratedAccountStatus = "connecting"
	IntegratedAccountStatusPostInstallError IntegratedAccountStatus = "post_install_error"
	IntegratedAccountStatusValidationError  IntegratedAccountStatus = "validation_error"
	IntegratedAccountStatusNeedsReauth      IntegratedAccountStatus = "needs_reauth"
)

Known IntegratedAccountStatus values.

type IntegratedAccountTokenRequest

type IntegratedAccountTokenRequest struct {
	// The ID of the integrated account you want to scope the token to.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
}

IntegratedAccountTokenRequest is a Truto API object.

type IntegratedAccountTokenResponse

type IntegratedAccountTokenResponse struct {
	// The integrated account token that can be used to make API calls.
	IntegratedAccountToken *string `json:"integrated_account_token,omitempty"`
}

IntegratedAccountTokenResponse is a Truto API object.

type IntegratedAccountUnifiedModelOverride

type IntegratedAccountUnifiedModelOverride map[string]map[string]IntegratedAccountUnifiedModelOverrideValueValue

Per-account unified-mapping overrides, keyed by unified model name and then by resource name. Only the method keys `list`, `create`, `get`, `update` and `delete` are read, and each accepts the subset of mapping fields in `IntegratedAccountUnifiedModelOverrideMethod` — any other field is dropped on write.

type IntegratedAccountUnifiedModelOverrideMethod

type IntegratedAccountUnifiedModelOverrideMethod struct {
	// Integration resource to call.
	Resource any `json:"resource,omitempty"`
	// Integration method to call.
	Method any `json:"method,omitempty"`
	// JSONata expression (string) or object-form mapping.
	ResponseMapping       any                                                               `json:"response_mapping,omitempty"`
	ResponseMappingMethod *IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod `json:"response_mapping_method,omitempty"`
	// Static query params merged into the integration request.
	Query              map[string]any                        `json:"query,omitempty"`
	QuerySchema        any                                   `json:"query_schema,omitempty"`
	QueryMapping       any                                   `json:"query_mapping,omitempty"`
	RequestBodyMapping any                                   `json:"request_body_mapping,omitempty"`
	RequestBodySchema  map[string]JsonSchemaObjectProperties `json:"request_body_schema,omitempty"`
	// Static body merged into the integration request.
	Body             map[string]any                             `json:"body,omitempty"`
	FileUpload       any                                        `json:"file_upload,omitempty"`
	Before           any                                        `json:"before,omitempty"`
	After            any                                        `json:"after,omitempty"`
	SideLoad         map[string]EnvironmentUnifiedModelSideLoad `json:"side_load,omitempty"`
	RelatedResources any                                        `json:"related_resources,omitempty"`
}

The mapping fields an account-scoped override may set. Deliberately a subset of `UnifiedModelResourceMethod`: `path_mapping`, `error_mapping`, the header mappings, `is_partial_*`, `static` and `mapping_version` are **not** accepted here — set those on `environment-unified-model-resource-method` instead.

type IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod

type IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod string

IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethodArray IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod = "array"
	IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethodItem  IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod = "item"
)

Known IntegratedAccountUnifiedModelOverrideMethodResponseMappingMethod values.

type IntegratedAccountUnifiedModelOverrideValueValue

type IntegratedAccountUnifiedModelOverrideValueValue struct {
	List   *IntegratedAccountUnifiedModelOverrideMethod `json:"list,omitempty"`
	Create *IntegratedAccountUnifiedModelOverrideMethod `json:"create,omitempty"`
	Get    *IntegratedAccountUnifiedModelOverrideMethod `json:"get,omitempty"`
	Update *IntegratedAccountUnifiedModelOverrideMethod `json:"update,omitempty"`
	Delete *IntegratedAccountUnifiedModelOverrideMethod `json:"delete,omitempty"`
}

IntegratedAccountUnifiedModelOverrideValueValue is a Truto API object.

type IntegratedAccountUpdate

type IntegratedAccountUpdate struct {
	// The ID of the tenant.
	TenantID *string `json:"tenant_id,omitempty"`
	// The context of the integrated account. You can find these in the `Variables` section of an integrated account in the Truto UI.
	Context map[string]any `json:"context,omitempty"`
	// Account-scoped unified-mapping overrides — the narrowest mapping scope there is. Deep-merged on top of the environment and base mappings for this one connected account only. Send `{}` to revert the account to the environment/base mappings.
	UnifiedModelOverride IntegratedAccountUnifiedModelOverride `json:"unified_model_override,omitempty"`
}

IntegratedAccountUpdate is a Truto API object.

type IntegratedAccountValidateResponse

type IntegratedAccountValidateResponse struct {
	// Whether every step passed.
	Success *bool `json:"success,omitempty"`
	// One entry per step, in the order they ran.
	Steps []map[string]any `json:"steps,omitempty"`
	// Present only when `success` is false. The failure that stopped the run, and the same value written to the account's `last_error`.
	Error *string `json:"error,omitempty"`
}

IntegratedAccountValidateResponse is a Truto API object.

type IntegratedAccountWebhookPayload

type IntegratedAccountWebhookPayload struct {
	// The parsed JSON body from the request.
	Body map[string]any `json:"body"`
	// The raw text body as sent by the external service (pre-JSON parsing).
	RawBody string `json:"raw_body"`
	// The inbound request headers.
	Headers map[string]string `json:"headers"`
	// The inbound query parameters from the request URL, if any.
	QueryParams map[string]string `json:"query_params,omitempty"`
	// ID of the integrated account receiving the webhook.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The environment in which this integrated account resides.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// Key/value context fields stored within the integrated account.
	Context map[string]any `json:"context,omitempty"`
	// Optional environment integration ID associated with the integrated account.
	EnvironmentIntegrationID *string `json:"environment_integration_id,omitempty"`
	// The type of this webhook payload, if relevant (e.g. a "verify" event).
	WebhookType *IntegratedAccountWebhookPayloadWebhookType `json:"webhook_type,omitempty"`
}

Internal representation of an inbound webhook event for an integrated account. The code: 1. Validates the request (signature, etc.) 2. Parses it into this payload structure 3. Maps it to a unified resource if appropriate.

type IntegratedAccountWebhookPayloadWebhookType

type IntegratedAccountWebhookPayloadWebhookType string

The type of this webhook payload, if relevant (e.g. a "verify" event).

Values the SDK does not know about decode unchanged.

const (
	IntegratedAccountWebhookPayloadWebhookTypeVerify  IntegratedAccountWebhookPayloadWebhookType = "verify"
	IntegratedAccountWebhookPayloadWebhookTypePayload IntegratedAccountWebhookPayloadWebhookType = "payload"
	IntegratedAccountWebhookPayloadWebhookTypeMeta    IntegratedAccountWebhookPayloadWebhookType = "meta"
)

Known IntegratedAccountWebhookPayloadWebhookType values.

type IntegratedAccountsService

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

IntegratedAccountsService manages integrated accounts: your customers' connected accounts in third-party apps.

func (*IntegratedAccountsService) BulkDelete

func (s *IntegratedAccountsService) BulkDelete(ctx context.Context, body Record, opts ...Option) (*Record, error)

BulkDelete deletes many integrated accounts. See the API reference for the accepted body shapes.

func (*IntegratedAccountsService) Capabilities

func (s *IntegratedAccountsService) Capabilities(ctx context.Context, id string, opts ...Option) (*CapabilitiesResponse, error)

Capabilities describes what the account can do: resources, methods, auth.

func (*IntegratedAccountsService) Create

Create creates (imports) an integrated account from existing credentials.

func (*IntegratedAccountsService) CreateFormToken

CreateFormToken creates a short-lived token for the account's RapidForm.

func (*IntegratedAccountsService) CreateMCPServer

CreateMCPServer creates an MCP server for the account.

func (*IntegratedAccountsService) CreateToken

CreateToken creates an integrated-account token, which can call the Unified and Proxy APIs for this one account only.

func (*IntegratedAccountsService) Delete

func (s *IntegratedAccountsService) Delete(ctx context.Context, id string, opts ...Option) (*DeleteResponse, error)

Delete deletes an integrated account.

func (*IntegratedAccountsService) DeleteMCPServer

func (s *IntegratedAccountsService) DeleteMCPServer(ctx context.Context, id, mcpID string, opts ...Option) (*DeleteResponse, error)

DeleteMCPServer deletes an MCP server of the account.

func (*IntegratedAccountsService) Get

Get fetches an integrated account.

func (*IntegratedAccountsService) GetMCPServer

func (s *IntegratedAccountsService) GetMCPServer(ctx context.Context, id, mcpID string, opts ...Option) (*MCP, error)

GetMCPServer fetches one MCP server of the account.

func (*IntegratedAccountsService) List

List returns an iterator over integrated accounts. Filter with WithQuery, for example truto.Params{"tenant_id": "acme"}.

func (*IntegratedAccountsService) ListMCPServers

func (s *IntegratedAccountsService) ListMCPServers(ctx context.Context, id string, opts ...Option) *Iterator[MCP]

ListMCPServers returns an iterator over the account's MCP servers.

func (*IntegratedAccountsService) RefreshCredentials

RefreshCredentials refreshes the account's OAuth credentials now.

func (*IntegratedAccountsService) RefreshMappingCache

RefreshMappingCache clears cached unified mappings.

func (*IntegratedAccountsService) RunPostInstallActions

RunPostInstallActions runs the integration's post-install actions again.

func (*IntegratedAccountsService) Tools

Tools lists the tools (proxy API methods described for LLM use) available for the account.

func (*IntegratedAccountsService) Update

Update changes an integrated account.

func (*IntegratedAccountsService) UpdateCredentials

UpdateCredentials replaces the credentials stored in the account's context.

func (*IntegratedAccountsService) UpdateMCPServer

func (s *IntegratedAccountsService) UpdateMCPServer(ctx context.Context, id, mcpID string, body IntegratedAccountMcpUpdateRequest, opts ...Option) (*MCP, error)

UpdateMCPServer changes an MCP server of the account.

func (*IntegratedAccountsService) Validate

Validate runs the integration's validation steps against the account.

type IntegrationAction

type IntegrationAction struct {
	// Ordered list of steps to run when the action is invoked.
	Steps []IntegrationActionStep `json:"steps,omitempty"`
	// Optional action type tag (e.g. `request` for single-shot actions). When omitted, `steps` is used.
	Type *string `json:"type,omitempty"`
	// Optional top-level config used when `type` is set instead of `steps`.
	Config map[string]any `json:"config,omitempty"`
}

A named integration action. Built-in actions are `post_install`, `post_connect_user_form`, `refresh_token`, and `validation`; arbitrary names are also allowed for custom flows triggered via the proxy or sync runtime.

type IntegrationActionStep

type IntegrationActionStep struct {
	// Step kind:
	//   * `request` — perform an HTTP call (config matches `IntegrationResourceMethod`).
	//   * `transform` — apply a JSONata expression over the running context.
	//   * `update_context` / `set_context` — write into the shared step context.
	//   * `get_context` — read from the shared step context.
	//   * `form` — pause and ask the connected user to fill a form (post-connect form).
	Type IntegrationActionStepType `json:"type"`
	// Step-specific configuration. For `request`, accepts the same shape as `IntegrationResourceMethod`. For `transform`, a JSONata expression string. For `form`, a fields array.
	Config any `json:"config,omitempty"`
}

A single step in an integration `action` (post-install hook, validation hook, refresh-token override, custom flows). Steps run sequentially with a shared `context`.

type IntegrationActionStepType

type IntegrationActionStepType string

Step kind:

  • `request` — perform an HTTP call (config matches `IntegrationResourceMethod`).
  • `transform` — apply a JSONata expression over the running context.
  • `update_context` / `set_context` — write into the shared step context.
  • `get_context` — read from the shared step context.
  • `form` — pause and ask the connected user to fill a form (post-connect form).

Values the SDK does not know about decode unchanged.

const (
	IntegrationActionStepTypeRequest       IntegrationActionStepType = "request"
	IntegrationActionStepTypeTransform     IntegrationActionStepType = "transform"
	IntegrationActionStepTypeUpdateContext IntegrationActionStepType = "update_context"
	IntegrationActionStepTypeGetContext    IntegrationActionStepType = "get_context"
	IntegrationActionStepTypeSetContext    IntegrationActionStepType = "set_context"
	IntegrationActionStepTypeForm          IntegrationActionStepType = "form"
)

Known IntegrationActionStepType values.

type IntegrationApiKeyCredential

type IntegrationApiKeyCredential struct {
	Format IntegrationApiKeyCredentialFormat `json:"format"`
	Config IntegrationApiKeyCredentialConfig `json:"config"`
}

API-key based credential. Customer pastes one or more secret values that are stored verbatim and templated into request headers/queries.

type IntegrationApiKeyCredentialConfig

type IntegrationApiKeyCredentialConfig struct {
	// Custom label for this authentication method shown in the Connect UI.
	Label *string `json:"label,omitempty"`
	// Short description shown below the label in the Connect UI when choosing between authentication methods.
	HelpText *string `json:"help_text,omitempty"`
	// URL to vendor documentation that helps the customer find their API key.
	DocumentationLink *string `json:"documentation_link,omitempty"`
	// Plain-text description of what permissions the API key needs.
	PermissionsText *string `json:"permissions_text,omitempty"`
	// Fields collected from the customer in the Connect UI.
	Fields []IntegrationField `json:"fields"`
	// Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated.
	GeneratedFields []IntegrationGeneratedField `json:"generated_fields,omitempty"`
	// Optional list of scope strings recorded against the credential (informational only for `api_key`).
	Scope []string `json:"scope,omitempty"`
}

IntegrationApiKeyCredentialConfig is a Truto API object.

type IntegrationApiKeyCredentialFormat

type IntegrationApiKeyCredentialFormat string

IntegrationApiKeyCredentialFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationApiKeyCredentialFormatAPIKey IntegrationApiKeyCredentialFormat = "api_key"
)

Known IntegrationApiKeyCredentialFormat values.

type IntegrationAuthorization

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

How Truto applies the resolved credential to outbound HTTP requests. The `format` discriminator selects which `config` shape applies.

It holds the raw JSON; use the As* methods to decode a specific shape.

func IntegrationAuthorizationFromIntegrationBasicAuthorization

func IntegrationAuthorizationFromIntegrationBasicAuthorization(v IntegrationBasicAuthorization) (IntegrationAuthorization, error)

IntegrationAuthorizationFromIntegrationBasicAuthorization wraps a IntegrationBasicAuthorization.

func IntegrationAuthorizationFromIntegrationBearerAuthorization

func IntegrationAuthorizationFromIntegrationBearerAuthorization(v IntegrationBearerAuthorization) (IntegrationAuthorization, error)

IntegrationAuthorizationFromIntegrationBearerAuthorization wraps a IntegrationBearerAuthorization.

func IntegrationAuthorizationFromIntegrationHeaderAuthorization

func IntegrationAuthorizationFromIntegrationHeaderAuthorization(v IntegrationHeaderAuthorization) (IntegrationAuthorization, error)

IntegrationAuthorizationFromIntegrationHeaderAuthorization wraps a IntegrationHeaderAuthorization.

func (IntegrationAuthorization) AsIntegrationBasicAuthorization

func (u IntegrationAuthorization) AsIntegrationBasicAuthorization() (*IntegrationBasicAuthorization, error)

AsIntegrationBasicAuthorization decodes the value as a IntegrationBasicAuthorization.

func (IntegrationAuthorization) AsIntegrationBearerAuthorization

func (u IntegrationAuthorization) AsIntegrationBearerAuthorization() (*IntegrationBearerAuthorization, error)

AsIntegrationBearerAuthorization decodes the value as a IntegrationBearerAuthorization.

func (IntegrationAuthorization) AsIntegrationHeaderAuthorization

func (u IntegrationAuthorization) AsIntegrationHeaderAuthorization() (*IntegrationHeaderAuthorization, error)

AsIntegrationHeaderAuthorization decodes the value as a IntegrationHeaderAuthorization.

func (IntegrationAuthorization) Discriminator

func (u IntegrationAuthorization) Discriminator() string

Discriminator returns the value of the "format" property, which tells the shapes apart.

func (IntegrationAuthorization) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (IntegrationAuthorization) Raw

Raw returns the JSON this IntegrationAuthorization holds.

func (*IntegrationAuthorization) UnmarshalJSON

func (u *IntegrationAuthorization) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IntegrationAwsStsCredential

type IntegrationAwsStsCredential struct {
	Format IntegrationAwsStsCredentialFormat `json:"format"`
	Config IntegrationAwsStsCredentialConfig `json:"config"`
}

AWS STS credential exchange. A long-lived AWS key signs one `AssumeRole` call and AWS returns a short-lived key belonging to whichever account owns the role.

type IntegrationAwsStsCredentialConfig

type IntegrationAwsStsCredentialConfig struct {
	// Custom label for this authentication method shown in the Connect UI.
	Label *string `json:"label,omitempty"`
	// Short description shown below the label in the Connect UI when choosing between authentication methods.
	HelpText *string `json:"help_text,omitempty"`
	// The IAM key that signs the `AssumeRole` call — a bring-your-own-credential pair on the same footing as an OAuth app's `client.id` / `client.secret`.
	Signing *IntegrationAwsStsCredentialConfigSigning `json:"signing,omitempty"`
	// The role to assume. Every field supports `{{...}}` placeholders, plus `{{token_key}}`, which is bound to the resolved token key.
	Role IntegrationAwsStsCredentialConfigRole  `json:"role"`
	Auth *IntegrationAwsStsCredentialConfigAuth `json:"auth,omitempty"`
	// Which cached credential slot this request uses, as a template resolved against the request context — for example `{{query.truto_account_id}}`.
	TokenKey *string `json:"token_key,omitempty"`
	// The CloudFormation template (an S3 `.yaml` / `.yml` object) the connect form's grant link launches. Not a secret. Available to the connect form and the post-connect form as `{{template_url}}` and, percent-encoded for use inside a URL, `{{template_url_encoded}}`.
	TemplateURL *string `json:"template_url,omitempty"`
	// The 12-digit AWS account the template grants access to — the account that owns the signing key. Not a secret. Available to the connect form and the post-connect form as `{{provider_account_id}}`.
	ProviderAccountID *string            `json:"provider_account_id,omitempty"`
	Fields            []IntegrationField `json:"fields"`
	// Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated.
	GeneratedFields   []IntegrationGeneratedField `json:"generated_fields,omitempty"`
	DocumentationLink *string                     `json:"documentation_link,omitempty"`
	PermissionsText   *string                     `json:"permissions_text,omitempty"`
}

IntegrationAwsStsCredentialConfig is a Truto API object.

type IntegrationAwsStsCredentialConfigAuth

type IntegrationAwsStsCredentialConfigAuth struct {
	// Defaults to `https://sts.amazonaws.com`.
	TokenHost *string `json:"tokenHost,omitempty"`
	// Region the exchange is signed for. Defaults to `us-east-1`.
	Region *string `json:"region,omitempty"`
}

IntegrationAwsStsCredentialConfigAuth is a Truto API object.

type IntegrationAwsStsCredentialConfigRole

type IntegrationAwsStsCredentialConfigRole struct {
	// Role ARN, e.g. `arn:aws:iam::{{token_key}}:role/TrutoCloudRead`.
	Arn string `json:"arn"`
	// `RoleSessionName`. Sanitised to `[\w+=,.@-]{2,64}`, which is all AWS accepts. Defaults to `truto`.
	SessionName *string `json:"session_name,omitempty"`
	// `ExternalId`, when the role's trust policy requires one.
	ExternalID *string `json:"external_id,omitempty"`
	// `DurationSeconds`. Capped by the role's own `MaxSessionDuration`. Defaults to 3600.
	DurationSeconds any `json:"duration_seconds,omitempty"`
}

The role to assume. Every field supports `{{...}}` placeholders, plus `{{token_key}}`, which is bound to the resolved token key.

type IntegrationAwsStsCredentialConfigSigning

type IntegrationAwsStsCredentialConfigSigning struct {
	AccessKeyID     *string `json:"access_key_id,omitempty"`
	SecretAccessKey *string `json:"secret_access_key,omitempty"`
	// Only needed when the signing key is itself temporary.
	SessionToken *string `json:"session_token,omitempty"`
}

The IAM key that signs the `AssumeRole` call — a bring-your-own-credential pair on the same footing as an OAuth app's `client.id` / `client.secret`.

type IntegrationAwsStsCredentialFormat

type IntegrationAwsStsCredentialFormat string

IntegrationAwsStsCredentialFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationAwsStsCredentialFormatAwsSts IntegrationAwsStsCredentialFormat = "aws_sts"
)

Known IntegrationAwsStsCredentialFormat values.

type IntegrationBasicAuthorization

type IntegrationBasicAuthorization struct {
	Format IntegrationBasicAuthorizationFormat `json:"format"`
	Config IntegrationBasicAuthorizationConfig `json:"config"`
}

Adds an HTTP Basic `Authorization: Basic base64(username:password)` header.

type IntegrationBasicAuthorizationConfig

type IntegrationBasicAuthorizationConfig struct {
	// Username, supports placeholders (e.g. `{{api_key}}` for vendors that pass the API key as the username).
	Username *string `json:"username,omitempty"`
	// Password, supports placeholders.
	Password *string `json:"password,omitempty"`
}

IntegrationBasicAuthorizationConfig is a Truto API object.

type IntegrationBasicAuthorizationFormat

type IntegrationBasicAuthorizationFormat string

IntegrationBasicAuthorizationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationBasicAuthorizationFormatBasic IntegrationBasicAuthorizationFormat = "basic"
)

Known IntegrationBasicAuthorizationFormat values.

type IntegrationBearerAuthorization

type IntegrationBearerAuthorization struct {
	Format IntegrationBearerAuthorizationFormat `json:"format"`
	Config IntegrationBearerAuthorizationConfig `json:"config"`
}

Adds `Authorization: Bearer <value>` to every request.

type IntegrationBearerAuthorizationConfig

type IntegrationBearerAuthorizationConfig struct {
	// The bearer token. Almost always a placeholder like `{{oauth.token.access_token}}` (OAuth2) or `{{api_key}}` (api-key fields).
	Value string `json:"value"`
}

IntegrationBearerAuthorizationConfig is a Truto API object.

type IntegrationBearerAuthorizationFormat

type IntegrationBearerAuthorizationFormat string

IntegrationBearerAuthorizationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationBearerAuthorizationFormatBearer IntegrationBearerAuthorizationFormat = "bearer"
)

Known IntegrationBearerAuthorizationFormat values.

type IntegrationConfig

type IntegrationConfig struct {
	// Default base URL prepended to every resource method's `path`.
	BaseURL *string `json:"base_url,omitempty"`
	// Human-readable name shown in the Truto Dashboard and Link UI.
	Label string `json:"label"`
	Logo *string `json:"logo,omitempty"`
	// URL to a smaller monochrome icon used in catalog listings.
	Icon *string `json:"icon,omitempty"`
	// Default HTTP headers merged into every outbound request. Values may be templated with JSONata placeholders.
	Headers map[string]*string `json:"headers,omitempty"`
	// Default query-string params merged into every outbound request.
	Query            map[string]string                  `json:"query,omitempty"`
	QueryArrayFormat *IntegrationConfigQueryArrayFormat `json:"query_array_format,omitempty"`
	// Named integration actions. Reserved keys (`post_install`, `post_connect_user_form`, `refresh_token`, `validation`) hook into specific platform lifecycle events; custom names are callable from the proxy/sync runtime.
	Actions map[string]IntegrationAction `json:"actions,omitempty"`
	// Either a single credential definition (when the integration only supports one auth format) or a map keyed by auth format (when an integration supports multiple, e.g. `api_key` and `oauth2`). For multi-format integrations, the customer picks one in the Connect UI. Each credential's `config.label` and `config.help_text` customize the auth-method card shown in the Connect UI.
	Credentials   any                       `json:"credentials,omitempty"`
	Authorization *IntegrationAuthorization `json:"authorization,omitempty"`
	Pagination    *IntegrationPagination    `json:"pagination,omitempty"`
	RateLimit     *IntegrationRateLimit     `json:"rate_limit,omitempty"`
	// Resource → method tree (e.g. `resources.users.list`). The inner key is one of the canonical methods (`list`, `get`, `create`, `update`, `delete`) or a custom method name. Each method definition matches `IntegrationResourceMethod`.
	Resources map[string]map[string]IntegrationResourceMethod `json:"resources,omitempty"`
	// Optional tag arrays keyed by resource name (`contacts`) or
	// `resource.method` (`contacts.delete`). Method-level tags are unioned
	// with resource-level tags when building MCP tools and filtering by
	// MCP token `config.tags`.
	ToolTags map[string][]string       `json:"tool_tags,omitempty"`
	Webhook  *IntegrationWebhookConfig `json:"webhook,omitempty"`
	// Integration-wide JSONata expression evaluated on every response. Use to detect errors in successful (2xx) responses, normalize error messages, or transform "errors" with `< 400` status into successful responses. Overridden by per-method `IntegrationResourceMethod.error_expression` when set.
	ErrorExpression *string `json:"error_expression,omitempty"`
	// This provider's **browser** file picker cannot run without the connected account's upstream `access_token`, so `GET /integrated-account/me` releases `context.oauth.token.access_token` — and nothing else — to a connect-flow integrated account token. Google Drive and Box need it; their picker SDKs take the token client-side. SharePoint, OneDrive and Dropbox authenticate by other means and must leave this unset.
	BrowserFilePickerRequiresAccessToken *bool `json:"browser_file_picker_requires_access_token,omitempty"`
	// Headers built from the connected account's OAuth app and sent on every request, for providers that want the app's own key next to the user's token. Etsy, for example, needs `{ "x-api-key": "{{client.id}}:{{client.secret}}" }`.
	OAuthAppHeaders map[string]string `json:"oauth_app_headers,omitempty"`
}

Complete integration configuration. Validated by Truto on `POST /integration` and `PATCH /integration/{id}`.

type IntegrationConfigQueryArrayFormat

type IntegrationConfigQueryArrayFormat string

IntegrationConfigQueryArrayFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationConfigQueryArrayFormatComma    IntegrationConfigQueryArrayFormat = "comma"
	IntegrationConfigQueryArrayFormatBrackets IntegrationConfigQueryArrayFormat = "brackets"
	IntegrationConfigQueryArrayFormatIndices  IntegrationConfigQueryArrayFormat = "indices"
	IntegrationConfigQueryArrayFormatRepeat   IntegrationConfigQueryArrayFormat = "repeat"
)

Known IntegrationConfigQueryArrayFormat values.

type IntegrationCreateRequest

type IntegrationCreateRequest struct {
	// The name of your integration.
	Name string `json:"name"`
	// A short descriptor or category.
	Category *string `json:"category,omitempty"`
	// The core configuration object for the integration. See `IntegrationConfig` for the full typed shape (credentials, resources, pagination, webhook, etc.).
	Config IntegrationConfig `json:"config"`
	// Whether the integration is considered beta.
	IsBeta *bool `json:"is_beta,omitempty"`
}

IntegrationCreateRequest is a Truto API object.

type IntegrationCredential

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

A single integration credential definition. The `format` discriminator selects which credential shape applies.

It holds the raw JSON; use the As* methods to decode a specific shape.

func IntegrationCredentialFromIntegrationApiKeyCredential

func IntegrationCredentialFromIntegrationApiKeyCredential(v IntegrationApiKeyCredential) (IntegrationCredential, error)

IntegrationCredentialFromIntegrationApiKeyCredential wraps a IntegrationApiKeyCredential.

func IntegrationCredentialFromIntegrationAwsStsCredential

func IntegrationCredentialFromIntegrationAwsStsCredential(v IntegrationAwsStsCredential) (IntegrationCredential, error)

IntegrationCredentialFromIntegrationAwsStsCredential wraps a IntegrationAwsStsCredential.

func IntegrationCredentialFromIntegrationJwtBearerCredential

func IntegrationCredentialFromIntegrationJwtBearerCredential(v IntegrationJwtBearerCredential) (IntegrationCredential, error)

IntegrationCredentialFromIntegrationJwtBearerCredential wraps a IntegrationJwtBearerCredential.

func IntegrationCredentialFromIntegrationKekaOAuthCredential

func IntegrationCredentialFromIntegrationKekaOAuthCredential(v IntegrationKekaOAuthCredential) (IntegrationCredential, error)

IntegrationCredentialFromIntegrationKekaOAuthCredential wraps a IntegrationKekaOAuthCredential.

func IntegrationCredentialFromIntegrationOAuth2ClientCredential

func IntegrationCredentialFromIntegrationOAuth2ClientCredential(v IntegrationOAuth2ClientCredential) (IntegrationCredential, error)

IntegrationCredentialFromIntegrationOAuth2ClientCredential wraps a IntegrationOAuth2ClientCredential.

func IntegrationCredentialFromIntegrationOAuth2Credential

func IntegrationCredentialFromIntegrationOAuth2Credential(v IntegrationOAuth2Credential) (IntegrationCredential, error)

IntegrationCredentialFromIntegrationOAuth2Credential wraps a IntegrationOAuth2Credential.

func IntegrationCredentialFromIntegrationOAuthCredential

func IntegrationCredentialFromIntegrationOAuthCredential(v IntegrationOAuthCredential) (IntegrationCredential, error)

IntegrationCredentialFromIntegrationOAuthCredential wraps a IntegrationOAuthCredential.

func (IntegrationCredential) AsIntegrationApiKeyCredential

func (u IntegrationCredential) AsIntegrationApiKeyCredential() (*IntegrationApiKeyCredential, error)

AsIntegrationApiKeyCredential decodes the value as a IntegrationApiKeyCredential.

func (IntegrationCredential) AsIntegrationAwsStsCredential

func (u IntegrationCredential) AsIntegrationAwsStsCredential() (*IntegrationAwsStsCredential, error)

AsIntegrationAwsStsCredential decodes the value as a IntegrationAwsStsCredential.

func (IntegrationCredential) AsIntegrationJwtBearerCredential

func (u IntegrationCredential) AsIntegrationJwtBearerCredential() (*IntegrationJwtBearerCredential, error)

AsIntegrationJwtBearerCredential decodes the value as a IntegrationJwtBearerCredential.

func (IntegrationCredential) AsIntegrationKekaOAuthCredential

func (u IntegrationCredential) AsIntegrationKekaOAuthCredential() (*IntegrationKekaOAuthCredential, error)

AsIntegrationKekaOAuthCredential decodes the value as a IntegrationKekaOAuthCredential.

func (IntegrationCredential) AsIntegrationOAuth2ClientCredential

func (u IntegrationCredential) AsIntegrationOAuth2ClientCredential() (*IntegrationOAuth2ClientCredential, error)

AsIntegrationOAuth2ClientCredential decodes the value as a IntegrationOAuth2ClientCredential.

func (IntegrationCredential) AsIntegrationOAuth2Credential

func (u IntegrationCredential) AsIntegrationOAuth2Credential() (*IntegrationOAuth2Credential, error)

AsIntegrationOAuth2Credential decodes the value as a IntegrationOAuth2Credential.

func (IntegrationCredential) AsIntegrationOAuthCredential

func (u IntegrationCredential) AsIntegrationOAuthCredential() (*IntegrationOAuthCredential, error)

AsIntegrationOAuthCredential decodes the value as a IntegrationOAuthCredential.

func (IntegrationCredential) Discriminator

func (u IntegrationCredential) Discriminator() string

Discriminator returns the value of the "format" property, which tells the shapes apart.

func (IntegrationCredential) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (IntegrationCredential) Raw

Raw returns the JSON this IntegrationCredential holds.

func (*IntegrationCredential) UnmarshalJSON

func (u *IntegrationCredential) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IntegrationCursorPagination

type IntegrationCursorPagination struct {
	Format IntegrationCursorPaginationFormat `json:"format"`
	// Cursor pagination options.
	Config IntegrationCursorPaginationConfig `json:"config"`
}

Cursor-based pagination, where the next cursor is read from a path inside the response body or headers.

type IntegrationCursorPaginationConfig

type IntegrationCursorPaginationConfig struct {
	// Dotted-path accessor into the response body (or headers, when `cursor_path_object: header`) that yields the next cursor.
	CursorPath string `json:"cursor_path"`
	// Optional accessor that yields the previous-page cursor.
	PrevCursorPath *string `json:"prev_cursor_path,omitempty"`
	// Query/body key Truto uses to send the cursor on the next request.
	CursorKey *string `json:"cursor_key,omitempty"`
	// Optional accessor that returns a truthy/`"true"`/`"false"` value indicating whether more pages exist.
	HasNextPath *string `json:"has_next_path,omitempty"`
	// Query/body key that holds the page size.
	LimitKey *string `json:"limit_key,omitempty"`
	// Maximum page size Truto will request.
	MaxLimit *int64 `json:"max_limit,omitempty"`
	// Treat the value at `cursor_path` as a fully-qualified URL (or path) rather than an opaque token.
	IsLink *bool `json:"is_link,omitempty"`
	// When `is_link` is true, also overwrite the request path with the link's path (not just the query string).
	IncludePath *bool `json:"include_path,omitempty"`
	// Static or templated headers added to every paginated request. Templated against the request `query` plus a synthetic `limit`.
	Headers map[string]string `json:"headers,omitempty"`
	// Send the cursor in the request body instead of the URL.
	AddToBody *bool `json:"add_to_body,omitempty"`
	// Cast the limit value when sending it in the body.
	LimitDataType *IntegrationCursorPaginationConfigLimitDataType `json:"limit_data_type,omitempty"`
	// Don't re-send `limit_key` after the first page (for APIs that reject it on subsequent calls).
	IgnoreLimitInPagination *bool `json:"ignore_limit_in_pagination,omitempty"`
	// Where to read `cursor_path` from.
	CursorPathObject *IntegrationCursorPaginationConfigCursorPathObject `json:"cursor_path_object,omitempty"`
	// Detect loops by hashing each page's results. Only effective when `cursor_path_object` is `body`.
	UseContentHash *bool `json:"use_content_hash,omitempty"`
	// Add the cursor to the query string.
	AddToQuery *bool `json:"add_to_query,omitempty"`
	// URL-decode the cursor before sending (some upstreams double-encode).
	IsCursorURLEncoded *bool `json:"is_cursor_url_encoded,omitempty"`
	// Don't treat an empty cursor as the end of pagination.
	AllowEmptyPageCursor *bool `json:"allow_empty_page_cursor,omitempty"`
}

Cursor pagination options.

type IntegrationCursorPaginationConfigCursorPathObject

type IntegrationCursorPaginationConfigCursorPathObject string

Where to read `cursor_path` from.

Values the SDK does not know about decode unchanged.

const (
	IntegrationCursorPaginationConfigCursorPathObjectBody   IntegrationCursorPaginationConfigCursorPathObject = "body"
	IntegrationCursorPaginationConfigCursorPathObjectHeader IntegrationCursorPaginationConfigCursorPathObject = "header"
)

Known IntegrationCursorPaginationConfigCursorPathObject values.

type IntegrationCursorPaginationConfigLimitDataType

type IntegrationCursorPaginationConfigLimitDataType string

Cast the limit value when sending it in the body.

Values the SDK does not know about decode unchanged.

const (
	IntegrationCursorPaginationConfigLimitDataTypeNumber IntegrationCursorPaginationConfigLimitDataType = "number"
	IntegrationCursorPaginationConfigLimitDataTypeString IntegrationCursorPaginationConfigLimitDataType = "string"
)

Known IntegrationCursorPaginationConfigLimitDataType values.

type IntegrationCursorPaginationFormat

type IntegrationCursorPaginationFormat string

IntegrationCursorPaginationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationCursorPaginationFormatCursor IntegrationCursorPaginationFormat = "cursor"
)

Known IntegrationCursorPaginationFormat values.

type IntegrationDynamicPagination

type IntegrationDynamicPagination struct {
	Format IntegrationDynamicPaginationFormat `json:"format"`
	Config IntegrationDynamicPaginationConfig `json:"config"`
}

Dynamic pagination driven entirely by JSONata expressions. Use this when none of the canonical strategies fit (e.g. SOAP-style request envelopes, HATEOAS links inside body fields, multi-step resumption tokens).

type IntegrationDynamicPaginationConfig

type IntegrationDynamicPaginationConfig struct {
	// Optional JSONata expression evaluated **before** the first request. Use to seed pagination values (e.g. compute a default `since` window).
	GetInitialPaginationValuesExpression *string `json:"get_initial_pagination_values_expression,omitempty"`
	// JSONata expression evaluated **before each subsequent request** (when `query.next_cursor` is set). Mutates the URL/body/headers/query for the next page.
	GetPaginationValuesExpression string `json:"get_pagination_values_expression"`
	// JSONata expression evaluated **after each response**. Returns the next cursor (Truto then base64-encodes it) and optional loop-detection flags.
	GetCursorFromResponseExpression string `json:"get_cursor_from_response_expression"`
}

IntegrationDynamicPaginationConfig is a Truto API object.

type IntegrationDynamicPaginationFormat

type IntegrationDynamicPaginationFormat string

IntegrationDynamicPaginationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationDynamicPaginationFormatDynamic IntegrationDynamicPaginationFormat = "dynamic"
)

Known IntegrationDynamicPaginationFormat values.

type IntegrationDynamicPaginationRequestContext

type IntegrationDynamicPaginationRequestContext struct {
	// Current request URL.
	URL string `json:"url"`
	// Caller-supplied query params (with `next_cursor` already base64-decoded on subsequent pages).
	Query map[string]string `json:"query"`
	// Current [Fetch `RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) (headers, body, method, etc.). Treat as opaque unless you need to inject vendor-specific options.
	RequestOptions map[string]any `json:"requestOptions"`
}

Input for `pagination.config.get_initial_pagination_values_expression` and `get_pagination_values_expression`.

type IntegrationDynamicPaginationRequestResult

type IntegrationDynamicPaginationRequestResult struct {
	// Replacement request URL for the next page.
	URL *string `json:"url,omitempty"`
	// Query params to merge onto the URL (overwrites existing keys).
	Query map[string]string `json:"query,omitempty"`
	// Replacement request body for the next page.
	Body map[string]any `json:"body,omitempty"`
	// Patch to deep-merge into the current [Fetch `RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit). Useful for adding pagination-specific headers.
	RequestOptions map[string]any `json:"requestOptions,omitempty"`
	// Free-form bag of values Truto echoes back to subsequent expressions (for multi-step cursors that need to remember intermediate state).
	PaginationValues map[string]string `json:"paginationValues,omitempty"`
}

Return value from `pagination.config.get_initial_pagination_values_expression` / `get_pagination_values_expression`. All fields are optional; only what you return is applied.

type IntegrationDynamicPaginationResponseContext

type IntegrationDynamicPaginationResponseContext struct {
	// Final request URL that produced this response.
	URL string `json:"url"`
	// Raw [Fetch `Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object. Headers and status are accessible here when you need to read pagination metadata from headers (e.g. `response.headers`).
	Response map[string]any `json:"response,omitempty"`
	// Parsed response body (object or array). Truto skips the expression if the body isn't an object/array.
	Body any `json:"body"`
	// Caller-supplied query params for this request.
	Query map[string]string `json:"query,omitempty"`
	// `paginationValues` echoed from the most recent `get_pagination_values_expression` invocation.
	PaginationValues map[string]string `json:"paginationValues,omitempty"`
}

Input for `pagination.config.get_cursor_from_response_expression`.

type IntegrationDynamicPaginationResponseResult

type IntegrationDynamicPaginationResponseResult struct {
	// Cursor for the next page. Return `null` to signal "no more pages".
	NextCursor *string `json:"nextCursor,omitempty"`
	// Optional cursor for the previous page (for two-way paginators).
	PrevCursor *string `json:"prevCursor,omitempty"`
	// Set to `true` if the response is identical to the previous one and Truto should stop paginating to avoid an infinite loop.
	IsLooping *bool `json:"isLooping,omitempty"`
}

Return value from `pagination.config.get_cursor_from_response_expression`. Truto base64-encodes `nextCursor` and `prevCursor` before storing them on the synthetic `query.next_cursor` for the next page.

type IntegrationErrorExpressionContext

type IntegrationErrorExpressionContext struct {
	// HTTP status code of the upstream response.
	Status int64 `json:"status"`
	// Lower-cased response headers from the upstream call.
	Headers map[string]string `json:"headers"`
	// Parsed response body. If the body is a plain object with a top-level `data` field, that field is used directly; otherwise the whole parsed body is provided.
	Data any `json:"data"`
	// Raw [Fetch `Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) object. Prefer `headers`, `status`, and `data`; this is exposed for advanced inspection only.
	Response map[string]any `json:"response,omitempty"`
}

Input passed to every `error_expression` JSONata expression.

type IntegrationErrorExpressionResult

type IntegrationErrorExpressionResult struct {
	// HTTP-style status code that Truto should report (e.g. `429`, `404`, `503`). Use `< 400` to convert an upstream "error" into a successful response.
	Status int64 `json:"status"`
	// Human-readable error message attached to the resulting Truto error.
	Message *string `json:"message,omitempty"`
	// Optional headers to attach to the resulting error/response.
	Headers map[string]*string `json:"headers,omitempty"`
	// Optional structured metadata propagated to the dashboard error log and webhook payloads.
	Metadata map[string]any `json:"metadata,omitempty"`
	// Optional payload returned in lieu of the upstream response when `status < 400` (e.g. when the upstream returns 200 with an error envelope, you can normalize the shape here).
	Result any `json:"result,omitempty"`
}

Return value from an `error_expression`. Return `null` (or omit) to indicate "no error". Returning an object short-circuits with that error shape. When `status < 400`, the `result` field is bubbled up as a successful response (useful for vendors that signal "no data" via 200 with an error body).

type IntegrationField

type IntegrationField struct {
	// Stable identifier under which the user-supplied value is stored at the **top level** of the integrated-account context. Referenced from placeholders as `{{<name>}}` (e.g. a field named `subdomain` is read as `{{subdomain}}`).
	Name string `json:"name"`
	// Human-readable label displayed next to the field in the Link UI.
	Label string `json:"label"`
	// How the field is rendered in the Link UI.
	Type IntegrationFieldType `json:"type"`
	// Optional default value pre-filled in the Link UI.
	Default *string `json:"default,omitempty"`
	// Whether the user must provide a value before connecting.
	Required *bool `json:"required,omitempty"`
	// Optional client-side validation hint. Either one of the well-known formats (`email`, `number`, `uuid`, `url`) or a custom regex name.
	Format *string `json:"format,omitempty"`
	// Optional transform applied to the user input before storing.
	Transform *IntegrationFieldTransform `json:"transform,omitempty"`
	// Placeholder text shown in the input.
	Placeholder *string `json:"placeholder,omitempty"`
	// Help text shown below the input.
	HelpText *string `json:"help_text,omitempty"`
	// Regex pattern used for client-side validation.
	Pattern *string `json:"pattern,omitempty"`
	// Options for `single_select` fields.
	Options []IntegrationFieldOptionsItem `json:"options,omitempty"`
}

A single user-facing field rendered in the Truto Link SDK during account connection. Used inside an integration credential's `config.fields` array to collect API keys, subdomains, OAuth client IDs, etc.

type IntegrationFieldOptionsItem

type IntegrationFieldOptionsItem struct {
	Label string `json:"label"`
	Value string `json:"value"`
}

IntegrationFieldOptionsItem is a Truto API object.

type IntegrationFieldTransform

type IntegrationFieldTransform string

Optional transform applied to the user input before storing.

Values the SDK does not know about decode unchanged.

const (
	IntegrationFieldTransformLowercase IntegrationFieldTransform = "lowercase"
	IntegrationFieldTransformUppercase IntegrationFieldTransform = "uppercase"
	IntegrationFieldTransformSha256    IntegrationFieldTransform = "sha256"
)

Known IntegrationFieldTransform values.

type IntegrationFieldType

type IntegrationFieldType string

How the field is rendered in the Link UI.

Values the SDK does not know about decode unchanged.

const (
	IntegrationFieldTypeText         IntegrationFieldType = "text"
	IntegrationFieldTypePassword     IntegrationFieldType = "password"
	IntegrationFieldTypeSingleSelect IntegrationFieldType = "single_select"
)

Known IntegrationFieldType values.

type IntegrationGeneratedField

type IntegrationGeneratedField struct {
	// Stable identifier under which the generated value is stored at the **top level** of the integrated-account context. Must not collide with a `config.fields` name.
	Name string `json:"name"`
	// What is generated.
	Type IntegrationGeneratedFieldType `json:"type"`
	// `uuid` only. Optional literal prefix prepended to the generated value.
	Prefix *string `json:"prefix,omitempty"`
	// `rsa_key_pair` only. Key size in bits.
	ModulusLength *int64 `json:"modulus_length,omitempty"`
}

A single value Truto generates once per connection, declared in a credential's `config.generated_fields` array. Used where the provider requires the value to be produced by Truto rather than by the customer. It is generated for the connection and kept for its life — a reconnect never regenerates it, and a caller-supplied value for the same name is ignored.

type IntegrationGeneratedFieldType

type IntegrationGeneratedFieldType string

What is generated.

Values the SDK does not know about decode unchanged.

const (
	IntegrationGeneratedFieldTypeUUID       IntegrationGeneratedFieldType = "uuid"
	IntegrationGeneratedFieldTypeRsaKeyPair IntegrationGeneratedFieldType = "rsa_key_pair"
)

Known IntegrationGeneratedFieldType values.

type IntegrationHeaderAuthorization

type IntegrationHeaderAuthorization struct {
	Format IntegrationHeaderAuthorizationFormat `json:"format"`
	Config IntegrationHeaderAuthorizationConfig `json:"config"`
}

Adds arbitrary headers to every request. Provide either `headers` (static map) or `expression` (JSONata returning the request to send), but not both.

type IntegrationHeaderAuthorizationConfig

type IntegrationHeaderAuthorizationConfig struct {
	// Map of header name → value. Values support placeholders (e.g. `{ "X-API-Key": "{{api_key}}" }`).
	Headers map[string]string `json:"headers,omitempty"`
	// JSONata expression that fully constructs the outgoing request. Use for advanced cases (request signing, dynamic URL rewrites).
	Expression *string `json:"expression,omitempty"`
}

IntegrationHeaderAuthorizationConfig is a Truto API object.

type IntegrationHeaderAuthorizationContext

type IntegrationHeaderAuthorizationContext struct {
	// Current outbound request URL.
	URL string `json:"url"`
	// Current [Fetch `RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) (headers/body/method).
	RequestOptions map[string]any `json:"requestOptions"`
	// Same request context used for placeholder resolution — credentials, OAuth tokens, env vars, etc.
	Context IntegrationPlaceholderContext `json:"context"`
}

Input for `authorization.config.expression` (only used when `authorization.format` is `header` and the integration needs custom URL/body manipulation alongside the auth header).

type IntegrationHeaderAuthorizationFormat

type IntegrationHeaderAuthorizationFormat string

IntegrationHeaderAuthorizationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationHeaderAuthorizationFormatHeader IntegrationHeaderAuthorizationFormat = "header"
)

Known IntegrationHeaderAuthorizationFormat values.

type IntegrationHeaderAuthorizationResult

type IntegrationHeaderAuthorizationResult struct {
	// New request URL (string or URL object).
	URL any `json:"url"`
	// New [Fetch `RequestInit`](https://developer.mozilla.org/en-US/docs/Web/API/RequestInit) (must include any auth headers you want to send).
	RequestOptions map[string]any `json:"requestOptions"`
}

Return value from `authorization.config.expression`. Both `url` and `requestOptions` are required; Truto throws "Invalid result from custom header jsonata expression" when either is missing.

type IntegrationJwtBearerCredential

type IntegrationJwtBearerCredential struct {
	Format IntegrationJwtBearerCredentialFormat `json:"format"`
	Config IntegrationJwtBearerCredentialConfig `json:"config"`
}

JWT bearer assertion credential. Sign a JWT with a private key (or HMAC secret) and exchange it for an access token. Used for GitHub Apps, Google service accounts, Snowflake, and similar flows.

type IntegrationJwtBearerCredentialConfig

type IntegrationJwtBearerCredentialConfig struct {
	// Custom label for this authentication method shown in the Connect UI.
	Label *string `json:"label,omitempty"`
	// Short description shown below the label in the Connect UI when choosing between authentication methods.
	HelpText *string `json:"help_text,omitempty"`
	// App/service identity and signing material (not OAuth `client_id` / `client_secret`). Set `key`, or `generated` to sign with a key pair Truto made for the connection; when `generated` is set, `key` is ignored.
	Signing     IntegrationJwtBearerCredentialConfigSigning  `json:"signing"`
	JWT         IntegrationJwtBearerCredentialConfigJwt      `json:"jwt"`
	Auth        *IntegrationJwtBearerCredentialConfigAuth    `json:"auth,omitempty"`
	Options     *IntegrationJwtBearerCredentialConfigOptions `json:"options,omitempty"`
	TokenParams map[string]any                               `json:"tokenParams,omitempty"`
	Params      map[string]string                            `json:"params,omitempty"`
	Headers     map[string]*string                           `json:"headers,omitempty"`
	Fields      []IntegrationField                           `json:"fields"`
	// Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated.
	GeneratedFields   []IntegrationGeneratedField `json:"generated_fields,omitempty"`
	DocumentationLink *string                     `json:"documentation_link,omitempty"`
	PermissionsText   *string                     `json:"permissions_text,omitempty"`
	// Refuse a connection that carries no `truto_static_gate_id` — on connect, on `POST /integrated-account`, and on a `PATCH` that would take the gate away. For a provider whose network policy admits only Truto's Static Gate IPs, a connection without a gate could never make a call.
	RequiresStaticGate *bool `json:"requires_static_gate,omitempty"`
}

IntegrationJwtBearerCredentialConfig is a Truto API object.

type IntegrationJwtBearerCredentialConfigAuth

type IntegrationJwtBearerCredentialConfigAuth struct {
	AuthorizeHost *string                                         `json:"authorizeHost,omitempty"`
	AuthorizePath *string                                         `json:"authorizePath,omitempty"`
	TokenHost     *string                                         `json:"tokenHost,omitempty"`
	TokenPath     *string                                         `json:"tokenPath,omitempty"`
	Method        *IntegrationJwtBearerCredentialConfigAuthMethod `json:"method,omitempty"`
}

IntegrationJwtBearerCredentialConfigAuth is a Truto API object.

type IntegrationJwtBearerCredentialConfigAuthMethod

type IntegrationJwtBearerCredentialConfigAuthMethod string

IntegrationJwtBearerCredentialConfigAuthMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationJwtBearerCredentialConfigAuthMethodPOST IntegrationJwtBearerCredentialConfigAuthMethod = "POST"
	IntegrationJwtBearerCredentialConfigAuthMethodGET  IntegrationJwtBearerCredentialConfigAuthMethod = "GET"
)

Known IntegrationJwtBearerCredentialConfigAuthMethod values.

type IntegrationJwtBearerCredentialConfigJwt

type IntegrationJwtBearerCredentialConfigJwt struct {
	Algorithm *IntegrationJwtBearerCredentialConfigJwtAlgorithm `json:"algorithm,omitempty"`
	// JWT claim template. Supports `{{...}}` placeholders (e.g. `iss` from `{{signing.id}}`).
	Claims map[string]any `json:"claims"`
	// JSONata returning an object of claims, merged over `claims`. Evaluated over `{ context, signing: { id, public } }`, where `context` is the connection context without any private key. Never placeholder-substituted. `iat` and `exp` are always set by Truto, after it runs.
	ClaimsExpression *string `json:"claims_expression,omitempty"`
	// Assertion TTL in seconds. `exp` is set to `iat + expires_in` at sign time.
	ExpiresIn      float64        `json:"expires_in"`
	ScopeSeparator *string        `json:"scope_separator,omitempty"`
	Header         map[string]any `json:"header,omitempty"`
}

IntegrationJwtBearerCredentialConfigJwt is a Truto API object.

type IntegrationJwtBearerCredentialConfigJwtAlgorithm

type IntegrationJwtBearerCredentialConfigJwtAlgorithm string

IntegrationJwtBearerCredentialConfigJwtAlgorithm is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationJwtBearerCredentialConfigJwtAlgorithmRS256 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "RS256"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmRS384 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "RS384"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmRS512 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "RS512"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmPS256 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "PS256"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmPS384 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "PS384"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmPS512 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "PS512"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmES256 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "ES256"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmES384 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "ES384"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmES512 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "ES512"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmEdDSA IntegrationJwtBearerCredentialConfigJwtAlgorithm = "EdDSA"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmHS256 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "HS256"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmHS384 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "HS384"
	IntegrationJwtBearerCredentialConfigJwtAlgorithmHS512 IntegrationJwtBearerCredentialConfigJwtAlgorithm = "HS512"
)

Known IntegrationJwtBearerCredentialConfigJwtAlgorithm values.

type IntegrationJwtBearerCredentialConfigOptions

type IntegrationJwtBearerCredentialConfigOptions struct {
	AuthorizationMethod *IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod `json:"authorizationMethod,omitempty"`
	BodyFormat          *IntegrationJwtBearerCredentialConfigOptionsBodyFormat          `json:"bodyFormat,omitempty"`
	AssertionFieldName  *string                                                         `json:"assertion_field_name,omitempty"`
}

IntegrationJwtBearerCredentialConfigOptions is a Truto API object.

type IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod

type IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod string

IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethodHeader IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod = "header"
	IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethodBody   IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod = "body"
	IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethodQs     IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod = "qs"
)

Known IntegrationJwtBearerCredentialConfigOptionsAuthorizationMethod values.

type IntegrationJwtBearerCredentialConfigOptionsBodyFormat

type IntegrationJwtBearerCredentialConfigOptionsBodyFormat string

IntegrationJwtBearerCredentialConfigOptionsBodyFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationJwtBearerCredentialConfigOptionsBodyFormatForm IntegrationJwtBearerCredentialConfigOptionsBodyFormat = "form"
	IntegrationJwtBearerCredentialConfigOptionsBodyFormatJSON IntegrationJwtBearerCredentialConfigOptionsBodyFormat = "json"
)

Known IntegrationJwtBearerCredentialConfigOptionsBodyFormat values.

type IntegrationJwtBearerCredentialConfigSigning

type IntegrationJwtBearerCredentialConfigSigning struct {
	// GitHub App ID, Google service account email, default `iss` claim, etc.
	ID string `json:"id"`
	// PEM, JWK JSON, or HMAC secret.
	Key *string `json:"key,omitempty"`
	// Name of an `rsa_key_pair` entry in this credential's `generated_fields`. The JWT is signed with that key's private half, which is read directly and never through a `{{...}}` placeholder. Its public half is available to the claims as `signing.public` (`fingerprint`, `public_key`, `key_id`). A JWT signed with it lives at most 3600 seconds (`jwt.expires_in`), and `jwt.algorithm` must be `RS256`, `RS384`, `RS512`, `PS256`, `PS384` or `PS512`.
	Generated *string `json:"generated,omitempty"`
}

App/service identity and signing material (not OAuth `client_id` / `client_secret`). Set `key`, or `generated` to sign with a key pair Truto made for the connection; when `generated` is set, `key` is ignored.

type IntegrationJwtBearerCredentialFormat

type IntegrationJwtBearerCredentialFormat string

IntegrationJwtBearerCredentialFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationJwtBearerCredentialFormatJWTBearer IntegrationJwtBearerCredentialFormat = "jwt_bearer"
)

Known IntegrationJwtBearerCredentialFormat values.

type IntegrationKekaOAuthCredential

type IntegrationKekaOAuthCredential struct {
	Format IntegrationKekaOAuthCredentialFormat `json:"format"`
	Config IntegrationKekaOAuthCredentialConfig `json:"config"`
}

Vendor-specific OAuth credential for Keka (HRMS). Combines an API key with an OAuth client.

type IntegrationKekaOAuthCredentialConfig

type IntegrationKekaOAuthCredentialConfig struct {
	Client *IntegrationKekaOAuthCredentialConfigClient `json:"client,omitempty"`
	// Custom label for this authentication method shown in the Connect UI.
	Label *string `json:"label,omitempty"`
	// Short description shown below the label in the Connect UI when choosing between authentication methods.
	HelpText          *string            `json:"help_text,omitempty"`
	DocumentationLink *string            `json:"documentation_link,omitempty"`
	PermissionsText   *string            `json:"permissions_text,omitempty"`
	Fields            []IntegrationField `json:"fields"`
	// Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated.
	GeneratedFields []IntegrationGeneratedField `json:"generated_fields,omitempty"`
}

IntegrationKekaOAuthCredentialConfig is a Truto API object.

type IntegrationKekaOAuthCredentialConfigClient

type IntegrationKekaOAuthCredentialConfigClient struct {
	ID     *string `json:"id,omitempty"`
	Secret *string `json:"secret,omitempty"`
}

IntegrationKekaOAuthCredentialConfigClient is a Truto API object.

type IntegrationKekaOAuthCredentialFormat

type IntegrationKekaOAuthCredentialFormat string

IntegrationKekaOAuthCredentialFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationKekaOAuthCredentialFormatKekaOAuth IntegrationKekaOAuthCredentialFormat = "keka_oauth"
)

Known IntegrationKekaOAuthCredentialFormat values.

type IntegrationLinkHeaderPagination

type IntegrationLinkHeaderPagination struct {
	Format IntegrationLinkHeaderPaginationFormat  `json:"format"`
	Config *IntegrationLinkHeaderPaginationConfig `json:"config,omitempty"`
}

RFC 5988 `Link:` header pagination (e.g. GitHub-style). The `next` and `prev` URLs are extracted from the response `Link` header.

type IntegrationLinkHeaderPaginationConfig

type IntegrationLinkHeaderPaginationConfig struct {
	// Informational only; the actual cursor comes from the `Link` header.
	PageKey *string `json:"page_key,omitempty"`
	// Query key that holds the page size when the caller sets `limit`.
	LimitKey *string `json:"limit_key,omitempty"`
	// Maximum page size Truto will request.
	MaxLimit *int64 `json:"max_limit,omitempty"`
	// Static or templated headers added to every paginated request.
	Headers map[string]string `json:"headers,omitempty"`
	// Don't send `limit_key` even when the caller sets `limit`.
	IgnoreLimit *bool `json:"ignore_limit,omitempty"`
}

IntegrationLinkHeaderPaginationConfig is a Truto API object.

type IntegrationLinkHeaderPaginationFormat

type IntegrationLinkHeaderPaginationFormat string

IntegrationLinkHeaderPaginationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationLinkHeaderPaginationFormatLinkHeader IntegrationLinkHeaderPaginationFormat = "link_header"
)

Known IntegrationLinkHeaderPaginationFormat values.

type IntegrationOAuth2ClientCredential

type IntegrationOAuth2ClientCredential struct {
	Format IntegrationOAuth2ClientCredentialFormat `json:"format"`
	Config IntegrationOAuth2ClientCredentialConfig `json:"config"`
}

OAuth 2.0 client-credentials grant. Used for service-to-service integrations where there is no end-user.

type IntegrationOAuth2ClientCredentialConfig

type IntegrationOAuth2ClientCredentialConfig struct {
	Client *IntegrationOAuth2ClientCredentialConfigClient `json:"client,omitempty"`
	// Custom label for this authentication method shown in the Connect UI.
	Label *string `json:"label,omitempty"`
	// Short description shown below the label in the Connect UI when choosing between authentication methods.
	HelpText          *string                                         `json:"help_text,omitempty"`
	DocumentationLink *string                                         `json:"documentation_link,omitempty"`
	PermissionsText   *string                                         `json:"permissions_text,omitempty"`
	Auth              IntegrationOAuth2ClientCredentialConfigAuth     `json:"auth"`
	Options           *IntegrationOAuth2ClientCredentialConfigOptions `json:"options,omitempty"`
	Params            map[string]string                               `json:"params,omitempty"`
	Fields            []IntegrationField                              `json:"fields"`
	// Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated.
	GeneratedFields     []IntegrationGeneratedField `json:"generated_fields,omitempty"`
	TokenParams         map[string]string           `json:"tokenParams,omitempty"`
	RefreshParams       map[string]string           `json:"refreshParams,omitempty"`
	TokenExpiryDuration *string                     `json:"tokenExpiryDuration,omitempty"`
}

IntegrationOAuth2ClientCredentialConfig is a Truto API object.

type IntegrationOAuth2ClientCredentialConfigAuth

type IntegrationOAuth2ClientCredentialConfigAuth struct {
	TokenHost string `json:"tokenHost"`
	TokenPath string `json:"tokenPath"`
	// Optional. Set if the integration also supports an interactive authorize step before falling back to client_credentials.
	AuthorizeHost *string `json:"authorizeHost,omitempty"`
	AuthorizePath *string `json:"authorizePath,omitempty"`
	RefreshPath   *string `json:"refreshPath,omitempty"`
}

IntegrationOAuth2ClientCredentialConfigAuth is a Truto API object.

type IntegrationOAuth2ClientCredentialConfigClient

type IntegrationOAuth2ClientCredentialConfigClient struct {
	ID     *string `json:"id,omitempty"`
	Secret *string `json:"secret,omitempty"`
}

IntegrationOAuth2ClientCredentialConfigClient is a Truto API object.

type IntegrationOAuth2ClientCredentialConfigOptions

type IntegrationOAuth2ClientCredentialConfigOptions struct {
	ScopeSeparator      *string                                                            `json:"scopeSeparator,omitempty"`
	AuthorizationMethod *IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod `json:"authorizationMethod,omitempty"`
	BodyFormat          *IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat          `json:"bodyFormat,omitempty"`
}

IntegrationOAuth2ClientCredentialConfigOptions is a Truto API object.

type IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod

type IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod string

IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethodHeader IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod = "header"
	IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethodBody   IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod = "body"
	IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethodQs     IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod = "qs"
)

Known IntegrationOAuth2ClientCredentialConfigOptionsAuthorizationMethod values.

type IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat

type IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat string

IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuth2ClientCredentialConfigOptionsBodyFormatForm IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat = "form"
	IntegrationOAuth2ClientCredentialConfigOptionsBodyFormatJSON IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat = "json"
	IntegrationOAuth2ClientCredentialConfigOptionsBodyFormatQs   IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat = "qs"
)

Known IntegrationOAuth2ClientCredentialConfigOptionsBodyFormat values.

type IntegrationOAuth2ClientCredentialFormat

type IntegrationOAuth2ClientCredentialFormat string

IntegrationOAuth2ClientCredentialFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuth2ClientCredentialFormatOAuth2ClientCredentials IntegrationOAuth2ClientCredentialFormat = "oauth2_client_credentials"
)

Known IntegrationOAuth2ClientCredentialFormat values.

type IntegrationOAuth2Credential

type IntegrationOAuth2Credential struct {
	Format IntegrationOAuth2CredentialFormat `json:"format"`
	Config IntegrationOAuth2CredentialConfig `json:"config"`
}

OAuth 2.0 authorization-code flow credential.

type IntegrationOAuth2CredentialConfig

type IntegrationOAuth2CredentialConfig struct {
	// Default Truto-managed OAuth client. Customers may supply their own via BYOA (Bring Your Own App).
	Client *IntegrationOAuth2CredentialConfigClient `json:"client,omitempty"`
	// Endpoint URLs for the OAuth dance.
	Auth    *IntegrationOAuth2CredentialConfigAuth    `json:"auth,omitempty"`
	Options *IntegrationOAuth2CredentialConfigOptions `json:"options,omitempty"`
	// Extra params appended to the authorize URL.
	Params map[string]string `json:"params,omitempty"`
	// Extra params appended to the token-exchange request body.
	TokenParams map[string]string `json:"tokenParams,omitempty"`
	// Extra params appended to the token-refresh request body.
	RefreshParams map[string]string `json:"refreshParams,omitempty"`
	// Custom label for this authentication method shown in the Connect UI.
	Label *string `json:"label,omitempty"`
	// Short description shown below the label in the Connect UI when choosing between authentication methods.
	HelpText          *string `json:"help_text,omitempty"`
	DocumentationLink *string `json:"documentation_link,omitempty"`
	PermissionsText   *string `json:"permissions_text,omitempty"`
	// Optional extra customer-collected fields (e.g. `subdomain` for vendors that need it before the OAuth dance).
	Fields []IntegrationField `json:"fields,omitempty"`
	// Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated.
	GeneratedFields []IntegrationGeneratedField `json:"generated_fields,omitempty"`
	// Required OAuth scopes always requested.
	Scope []string `json:"scope,omitempty"`
	// Scopes that may be requested if available; failures don't abort the dance.
	OptionalScope []string `json:"optional_scope,omitempty"`
	// When true, store the scope returned by the OAuth provider on the credential rather than the requested scope.
	UseOAuthTokenScope *bool `json:"use_oauth_token_scope,omitempty"`
	// Override for the separator used when serializing scopes (defaults to a space).
	OAuthTokenScopeSeparator *string `json:"oauth_token_scope_separator,omitempty"`
	// Optional PKCE configuration. Required by some OAuth 2.0 providers.
	Pkce *IntegrationOAuth2CredentialConfigPkce `json:"pkce,omitempty"`
	// Static token TTL (as a string of seconds) used when the provider doesn't return one.
	TokenExpiryDuration *string `json:"tokenExpiryDuration,omitempty"`
}

IntegrationOAuth2CredentialConfig is a Truto API object.

type IntegrationOAuth2CredentialConfigAuth

type IntegrationOAuth2CredentialConfigAuth struct {
	TokenHost     *string `json:"tokenHost,omitempty"`
	TokenPath     *string `json:"tokenPath,omitempty"`
	AuthorizeHost *string `json:"authorizeHost,omitempty"`
	AuthorizePath *string `json:"authorizePath,omitempty"`
	RevokePath    *string `json:"revokePath,omitempty"`
	RefreshPath   *string `json:"refreshPath,omitempty"`
}

Endpoint URLs for the OAuth dance.

type IntegrationOAuth2CredentialConfigClient

type IntegrationOAuth2CredentialConfigClient struct {
	ID     *string `json:"id,omitempty"`
	Secret *string `json:"secret,omitempty"`
	// Optional override for the OAuth `client_id` parameter name (defaults to `client_id`).
	IDParamName *string `json:"idParamName,omitempty"`
	// Optional override for the OAuth `client_secret` parameter name (defaults to `client_secret`).
	SecretParamName *string `json:"secretParamName,omitempty"`
}

Default Truto-managed OAuth client. Customers may supply their own via BYOA (Bring Your Own App).

type IntegrationOAuth2CredentialConfigOptions

type IntegrationOAuth2CredentialConfigOptions struct {
	ScopeSeparator      *string                                                      `json:"scopeSeparator,omitempty"`
	AuthorizationMethod *IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod `json:"authorizationMethod,omitempty"`
	BodyFormat          *IntegrationOAuth2CredentialConfigOptionsBodyFormat          `json:"bodyFormat,omitempty"`
	// Name of the response property that holds the token TTL in seconds.
	ExpiresInPropertyName *string `json:"expiresInPropertyName,omitempty"`
}

IntegrationOAuth2CredentialConfigOptions is a Truto API object.

type IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod

type IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod string

IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuth2CredentialConfigOptionsAuthorizationMethodHeader IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod = "header"
	IntegrationOAuth2CredentialConfigOptionsAuthorizationMethodBody   IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod = "body"
	IntegrationOAuth2CredentialConfigOptionsAuthorizationMethodQs     IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod = "qs"
)

Known IntegrationOAuth2CredentialConfigOptionsAuthorizationMethod values.

type IntegrationOAuth2CredentialConfigOptionsBodyFormat

type IntegrationOAuth2CredentialConfigOptionsBodyFormat string

IntegrationOAuth2CredentialConfigOptionsBodyFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuth2CredentialConfigOptionsBodyFormatForm IntegrationOAuth2CredentialConfigOptionsBodyFormat = "form"
	IntegrationOAuth2CredentialConfigOptionsBodyFormatJSON IntegrationOAuth2CredentialConfigOptionsBodyFormat = "json"
	IntegrationOAuth2CredentialConfigOptionsBodyFormatQs   IntegrationOAuth2CredentialConfigOptionsBodyFormat = "qs"
)

Known IntegrationOAuth2CredentialConfigOptionsBodyFormat values.

type IntegrationOAuth2CredentialConfigPkce

type IntegrationOAuth2CredentialConfigPkce struct {
	Method               IntegrationOAuth2CredentialConfigPkceMethod `json:"method"`
	ChallengeKey         *string                                     `json:"challengeKey,omitempty"`
	ChallengeMethodKey   *string                                     `json:"challengeMethodKey,omitempty"`
	ChallengeVerifierKey *string                                     `json:"challengeVerifierKey,omitempty"`
}

Optional PKCE configuration. Required by some OAuth 2.0 providers.

type IntegrationOAuth2CredentialConfigPkceMethod

type IntegrationOAuth2CredentialConfigPkceMethod string

IntegrationOAuth2CredentialConfigPkceMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuth2CredentialConfigPkceMethodS256  IntegrationOAuth2CredentialConfigPkceMethod = "S256"
	IntegrationOAuth2CredentialConfigPkceMethodPlain IntegrationOAuth2CredentialConfigPkceMethod = "plain"
)

Known IntegrationOAuth2CredentialConfigPkceMethod values.

type IntegrationOAuth2CredentialFormat

type IntegrationOAuth2CredentialFormat string

IntegrationOAuth2CredentialFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuth2CredentialFormatOAuth2 IntegrationOAuth2CredentialFormat = "oauth2"
)

Known IntegrationOAuth2CredentialFormat values.

type IntegrationOAuthCredential

type IntegrationOAuthCredential struct {
	Format IntegrationOAuthCredentialFormat `json:"format"`
	Config IntegrationOAuthCredentialConfig `json:"config"`
}

OAuth 1.0a credential (rare; used for legacy APIs like older Twitter, Trello).

type IntegrationOAuthCredentialConfig

type IntegrationOAuthCredentialConfig struct {
	Client        IntegrationOAuthCredentialConfigClient   `json:"client"`
	Auth          IntegrationOAuthCredentialConfigAuth     `json:"auth"`
	Options       *IntegrationOAuthCredentialConfigOptions `json:"options,omitempty"`
	Scope         []string                                 `json:"scope,omitempty"`
	Params        map[string]string                        `json:"params,omitempty"`
	TokenParams   map[string]string                        `json:"tokenParams,omitempty"`
	RefreshParams map[string]string                        `json:"refreshParams,omitempty"`
	// Custom label for this authentication method shown in the Connect UI.
	Label *string `json:"label,omitempty"`
	// Short description shown below the label in the Connect UI when choosing between authentication methods.
	HelpText          *string            `json:"help_text,omitempty"`
	DocumentationLink *string            `json:"documentation_link,omitempty"`
	PermissionsText   *string            `json:"permissions_text,omitempty"`
	Fields            []IntegrationField `json:"fields,omitempty"`
	// Values Truto generates once per connection and stores in the integrated-account context under each entry's `name`. Declared instead of a `fields` entry when the provider requires the value to be generated by Truto rather than supplied by the customer — AWS's External ID is the first. A caller-supplied value for one of these names is ignored, and an existing value is never regenerated.
	GeneratedFields []IntegrationGeneratedField `json:"generated_fields,omitempty"`
}

IntegrationOAuthCredentialConfig is a Truto API object.

type IntegrationOAuthCredentialConfigAuth

type IntegrationOAuthCredentialConfigAuth struct {
	RequestTokenURL string `json:"requestTokenUrl"`
	AuthorizeURL    string `json:"authorizeUrl"`
	TokenURL        string `json:"tokenUrl"`
}

IntegrationOAuthCredentialConfigAuth is a Truto API object.

type IntegrationOAuthCredentialConfigClient

type IntegrationOAuthCredentialConfigClient struct {
	ID     string `json:"id"`
	Secret string `json:"secret"`
}

IntegrationOAuthCredentialConfigClient is a Truto API object.

type IntegrationOAuthCredentialConfigOptions

type IntegrationOAuthCredentialConfigOptions struct {
	SignatureMethod *IntegrationOAuthCredentialConfigOptionsSignatureMethod `json:"signatureMethod,omitempty"`
	AddToQuery      *bool                                                   `json:"addToQuery,omitempty"`
}

IntegrationOAuthCredentialConfigOptions is a Truto API object.

type IntegrationOAuthCredentialConfigOptionsSignatureMethod

type IntegrationOAuthCredentialConfigOptionsSignatureMethod string

IntegrationOAuthCredentialConfigOptionsSignatureMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuthCredentialConfigOptionsSignatureMethodHMACSHA1  IntegrationOAuthCredentialConfigOptionsSignatureMethod = "HMAC-SHA1"
	IntegrationOAuthCredentialConfigOptionsSignatureMethodPLAINTEXT IntegrationOAuthCredentialConfigOptionsSignatureMethod = "PLAINTEXT"
)

Known IntegrationOAuthCredentialConfigOptionsSignatureMethod values.

type IntegrationOAuthCredentialFormat

type IntegrationOAuthCredentialFormat string

IntegrationOAuthCredentialFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOAuthCredentialFormatOAuth IntegrationOAuthCredentialFormat = "oauth"
)

Known IntegrationOAuthCredentialFormat values.

type IntegrationOffsetPagination

type IntegrationOffsetPagination struct {
	Format IntegrationOffsetPaginationFormat  `json:"format"`
	Config *IntegrationOffsetPaginationConfig `json:"config,omitempty"`
}

Offset/limit pagination (`?offset=200&limit=100`).

type IntegrationOffsetPaginationConfig

type IntegrationOffsetPaginationConfig struct {
	// Optional dotted-path accessor into the response body that yields the total result count, used to stop paginating early.
	TotalPath *string `json:"total_path,omitempty"`
	// Query/body key that holds the offset.
	OffsetKey *string `json:"offset_key,omitempty"`
	// Query/body key that holds the page size.
	LimitKey *string `json:"limit_key,omitempty"`
	// Maximum page size Truto will request.
	MaxLimit *int64 `json:"max_limit,omitempty"`
	// Static or templated headers added to every paginated request.
	Headers map[string]string `json:"headers,omitempty"`
	// Send pagination params in the request body instead of the query string.
	AddToBody *bool `json:"add_to_body,omitempty"`
	// Offset used for the first request (some APIs are 1-indexed).
	DefaultOffset *string `json:"default_offset,omitempty"`
	// Send pagination params in the query string.
	AddToQuery *bool `json:"add_to_query,omitempty"`
	// Detect loops by hashing each page's results.
	UseContentHash *bool `json:"use_content_hash,omitempty"`
	// Drop `limit_key` from the URL after pagination is applied.
	IgnoreLimit *bool `json:"ignore_limit,omitempty"`
}

IntegrationOffsetPaginationConfig is a Truto API object.

type IntegrationOffsetPaginationFormat

type IntegrationOffsetPaginationFormat string

IntegrationOffsetPaginationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationOffsetPaginationFormatOffset IntegrationOffsetPaginationFormat = "offset"
)

Known IntegrationOffsetPaginationFormat values.

type IntegrationPagePagination

type IntegrationPagePagination struct {
	Format IntegrationPagePaginationFormat `json:"format"`
	// Page-number pagination options. All fields optional; defaults shown.
	Config *IntegrationPagePaginationConfig `json:"config,omitempty"`
}

Page-number pagination (e.g. `?page=2&limit=100`).

type IntegrationPagePaginationConfig

type IntegrationPagePaginationConfig struct {
	// Query/body key that holds the page number.
	PageKey *string `json:"page_key,omitempty"`
	// Query/body key that holds the page size.
	LimitKey *string `json:"limit_key,omitempty"`
	// Maximum page size Truto will request, regardless of the caller's `limit`.
	MaxLimit *int64 `json:"max_limit,omitempty"`
	// Page number used for the first page (some APIs are 0-indexed).
	StartingPage *string `json:"starting_page,omitempty"`
	// Static or templated headers added to every paginated request. Templated against the request `query` plus a synthetic `limit`.
	Headers map[string]string `json:"headers,omitempty"`
	// Drop the `limit_key` from the URL after pagination is applied (for APIs that 400 on it).
	IgnoreLimit *bool `json:"ignore_limit,omitempty"`
	// Add pagination keys to the request body instead of the query string.
	AddToBody *bool `json:"add_to_body,omitempty"`
	// Add pagination keys to the query string. Defaults to `true` when `add_to_body` is false.
	AddToQuery *bool `json:"add_to_query,omitempty"`
	// Stop paginating when consecutive pages return identical results (loop detection). Defaults to `true`.
	UseContentHash *bool `json:"use_content_hash,omitempty"`
}

Page-number pagination options. All fields optional; defaults shown.

type IntegrationPagePaginationFormat

type IntegrationPagePaginationFormat string

IntegrationPagePaginationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationPagePaginationFormatPage IntegrationPagePaginationFormat = "page"
)

Known IntegrationPagePaginationFormat values.

type IntegrationPagination

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

Pagination strategy for an integration or a single resource method. The `format` discriminator selects which `config` shape applies.

It holds the raw JSON; use the As* methods to decode a specific shape.

func IntegrationPaginationFromIntegrationCursorPagination

func IntegrationPaginationFromIntegrationCursorPagination(v IntegrationCursorPagination) (IntegrationPagination, error)

IntegrationPaginationFromIntegrationCursorPagination wraps a IntegrationCursorPagination.

func IntegrationPaginationFromIntegrationDynamicPagination

func IntegrationPaginationFromIntegrationDynamicPagination(v IntegrationDynamicPagination) (IntegrationPagination, error)

IntegrationPaginationFromIntegrationDynamicPagination wraps a IntegrationDynamicPagination.

func IntegrationPaginationFromIntegrationLinkHeaderPagination

func IntegrationPaginationFromIntegrationLinkHeaderPagination(v IntegrationLinkHeaderPagination) (IntegrationPagination, error)

IntegrationPaginationFromIntegrationLinkHeaderPagination wraps a IntegrationLinkHeaderPagination.

func IntegrationPaginationFromIntegrationOffsetPagination

func IntegrationPaginationFromIntegrationOffsetPagination(v IntegrationOffsetPagination) (IntegrationPagination, error)

IntegrationPaginationFromIntegrationOffsetPagination wraps a IntegrationOffsetPagination.

func IntegrationPaginationFromIntegrationPagePagination

func IntegrationPaginationFromIntegrationPagePagination(v IntegrationPagePagination) (IntegrationPagination, error)

IntegrationPaginationFromIntegrationPagePagination wraps a IntegrationPagePagination.

func IntegrationPaginationFromIntegrationRangePagination

func IntegrationPaginationFromIntegrationRangePagination(v IntegrationRangePagination) (IntegrationPagination, error)

IntegrationPaginationFromIntegrationRangePagination wraps a IntegrationRangePagination.

func (IntegrationPagination) AsIntegrationCursorPagination

func (u IntegrationPagination) AsIntegrationCursorPagination() (*IntegrationCursorPagination, error)

AsIntegrationCursorPagination decodes the value as a IntegrationCursorPagination.

func (IntegrationPagination) AsIntegrationDynamicPagination

func (u IntegrationPagination) AsIntegrationDynamicPagination() (*IntegrationDynamicPagination, error)

AsIntegrationDynamicPagination decodes the value as a IntegrationDynamicPagination.

func (IntegrationPagination) AsIntegrationLinkHeaderPagination

func (u IntegrationPagination) AsIntegrationLinkHeaderPagination() (*IntegrationLinkHeaderPagination, error)

AsIntegrationLinkHeaderPagination decodes the value as a IntegrationLinkHeaderPagination.

func (IntegrationPagination) AsIntegrationOffsetPagination

func (u IntegrationPagination) AsIntegrationOffsetPagination() (*IntegrationOffsetPagination, error)

AsIntegrationOffsetPagination decodes the value as a IntegrationOffsetPagination.

func (IntegrationPagination) AsIntegrationPagePagination

func (u IntegrationPagination) AsIntegrationPagePagination() (*IntegrationPagePagination, error)

AsIntegrationPagePagination decodes the value as a IntegrationPagePagination.

func (IntegrationPagination) AsIntegrationRangePagination

func (u IntegrationPagination) AsIntegrationRangePagination() (*IntegrationRangePagination, error)

AsIntegrationRangePagination decodes the value as a IntegrationRangePagination.

func (IntegrationPagination) Discriminator

func (u IntegrationPagination) Discriminator() string

Discriminator returns the value of the "format" property, which tells the shapes apart.

func (IntegrationPagination) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (IntegrationPagination) Raw

Raw returns the JSON this IntegrationPagination holds.

func (*IntegrationPagination) UnmarshalJSON

func (u *IntegrationPagination) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IntegrationPlaceholderContext

type IntegrationPlaceholderContext struct {
	// The path/resource ID for `*.get`/`*.update`/`*.delete` calls. Read as `{{id}}` and auto URL-encoded when used inside `path`.
	ID *string `json:"id,omitempty"`
	// Caller-supplied query params. Read as `{{query.<key>}}`.
	Query map[string]any `json:"query,omitempty"`
	// Caller-supplied request body. Read as `{{body}}` (whole body) or `{{body.<key>}}`.
	Body any `json:"body,omitempty"`
	// OAuth context. Tokens are nested under `oauth.token` (e.g. `{{oauth.token.access_token}}`, `{{oauth.token.refresh_token}}`).
	OAuth *IntegrationPlaceholderContextOauth `json:"oauth,omitempty"`
	// Environment-scoped variables defined under Settings → Environment Variables. Read as `{{environment_variables.<NAME>}}`.
	EnvironmentVariables map[string]string `json:"environment_variables,omitempty"`
	// The authentication format the integrated account was created with (`api_key`, `oauth2`, `oauth`, `oauth2_client_credentials`, `keka_oauth`, `jwt_bearer`, `aws_sts`). Useful when the same integration supports multiple credential formats.
	TrutoAuthenticationMethod *string `json:"truto_authentication_method,omitempty"`
	// The credential slot this request resolved to, on an `aws_sts` connection. An `authorization` expression selects the credential with `$lookup(context.oauth.tokens, context.truto_token_key)`.
	TrutoTokenKey *string `json:"truto_token_key,omitempty"`
	// When the request is routed via a static-gate environment variable, this holds the gate ID.
	TrutoStaticGateID *string `json:"truto_static_gate_id,omitempty"`
}

Runtime request context used to resolve every `{{...}}` placeholder in an integration config (`headers`, `query`, `body`, `path`, etc.) and to seed every `update_context` action step. Built per request from the integrated-account context plus the current call's parameters.

type IntegrationPlaceholderContextOauth

type IntegrationPlaceholderContextOauth struct {
	// OAuth token bag merged from the most recent token-refresh response.
	Token *IntegrationPlaceholderContextOauthToken `json:"token,omitempty"`
}

OAuth context. Tokens are nested under `oauth.token` (e.g. `{{oauth.token.access_token}}`, `{{oauth.token.refresh_token}}`).

type IntegrationPlaceholderContextOauthToken

type IntegrationPlaceholderContextOauthToken struct {
	AccessToken  *string `json:"access_token,omitempty"`
	RefreshToken *string `json:"refresh_token,omitempty"`
	ExpiresIn    *int64  `json:"expires_in,omitempty"`
	TokenType    *string `json:"token_type,omitempty"`
}

OAuth token bag merged from the most recent token-refresh response.

type IntegrationRangePagination

type IntegrationRangePagination struct {
	Format IntegrationRangePaginationFormat  `json:"format"`
	Config *IntegrationRangePaginationConfig `json:"config,omitempty"`
}

Half-open `[start, end)` range pagination (e.g. `?start=0&end=100` then `?start=100&end=200`).

type IntegrationRangePaginationConfig

type IntegrationRangePaginationConfig struct {
	// Optional dotted-path accessor into the response body that yields the total result count, used to stop paginating early.
	TotalPath *string `json:"total_path,omitempty"`
	// Query/body key that holds the start of the range.
	StartKey *string `json:"start_key,omitempty"`
	// Query/body key that holds the end of the range (exclusive).
	EndKey *string `json:"end_key,omitempty"`
	// Maximum range size Truto will request.
	MaxLimit *int64 `json:"max_limit,omitempty"`
	// Static or templated headers added to every paginated request.
	Headers map[string]string `json:"headers,omitempty"`
	// Send pagination params in the request body instead of the query string.
	AddToBody *bool `json:"add_to_body,omitempty"`
	// Send pagination params in the query string.
	AddToQuery *bool `json:"add_to_query,omitempty"`
	// Start value used for the first request.
	DefaultStart *string `json:"default_start,omitempty"`
	// Drop `start_key`, `end_key`, and `limit` from the URL after pagination is applied.
	IgnoreLimit *bool `json:"ignore_limit,omitempty"`
}

IntegrationRangePaginationConfig is a Truto API object.

type IntegrationRangePaginationFormat

type IntegrationRangePaginationFormat string

IntegrationRangePaginationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationRangePaginationFormatRange IntegrationRangePaginationFormat = "range"
)

Known IntegrationRangePaginationFormat values.

type IntegrationRateLimit

type IntegrationRateLimit struct {
	// JSONata expression returning a truthy value when the response should be treated as rate-limited. When omitted, Truto falls back to `status === 429`.
	IsRateLimited *string `json:"is_rate_limited,omitempty"`
	// JSONata expression returning the seconds to wait before retrying. When omitted, Truto reads the standard `Retry-After` header.
	RetryAfterHeaderExpression *string `json:"retry_after_header_expression,omitempty"`
	// JSONata expression returning the current rate-limit window state. Truto forwards this as `RateLimit-Limit` / `RateLimit-Remaining` / `RateLimit-Reset` headers in the proxy response.
	RateLimitHeaderExpression *string `json:"rate_limit_header_expression,omitempty"`
}

How Truto detects and reacts to upstream rate-limiting. All fields are JSONata expressions evaluated against the upstream response.

type IntegrationRateLimitExpressionContext

type IntegrationRateLimitExpressionContext struct {
	// HTTP status code of the upstream response.
	Status int64 `json:"status"`
	// Lower-cased response headers from the upstream call.
	Headers map[string]string `json:"headers"`
}

Input passed to `rate_limit.is_rate_limited`, `rate_limit.retry_after_header_expression`, and `rate_limit.rate_limit_header_expression`.

type IntegrationRateLimitHeaderValues

type IntegrationRateLimitHeaderValues struct {
	// Total requests allowed in the current window.
	Limit string `json:"limit"`
	// Requests remaining in the current window.
	Remaining string `json:"remaining"`
	// When the current window resets — typically a Unix timestamp or ISO date string, exactly as the upstream returned it.
	Reset string `json:"reset"`
}

Return value from `rate_limit.rate_limit_header_expression`. Truto rewrites these into the standard `ratelimit-limit`, `ratelimit-remaining`, and `ratelimit-reset` response headers.

type IntegrationResourceMethod

type IntegrationResourceMethod struct {
	// Override the integration-level `base_url` for this single method. Supports placeholders.
	BaseURL *string `json:"base_url,omitempty"`
	// HTTP method. Includes WebDAV/CalDAV verbs (e.g. `propfind`, `report`) for integrations such as Apple/iCloud Calendar.
	Method *IntegrationResourceMethodMethod `json:"method,omitempty"`
	// URL path appended to `base_url`. Supports placeholders — `{{id}}` for the path parameter (auto URL-encoded), `{{query.foo}}` for caller query params, `{{<field-name>}}` for credential fields, `{{environment_variables.MY_VAR}}` for env-vars, etc.
	Path string `json:"path"`
	// Optional alternate path to call when paginating (e.g. when the first page comes from `/users` but subsequent pages come from a `next_url` field). Supports placeholders.
	PaginationPath *string `json:"pagination_path,omitempty"`
	// Override the integration-level `authorization` for this method (e.g. a method that uses a different credential format than the rest of the integration).
	Authorization *IntegrationAuthorization `json:"authorization,omitempty"`
	// Static or templated request headers merged with the integration-level `headers`. Values are templated with placeholders; `null` removes the inherited header.
	Headers map[string]*string `json:"headers,omitempty"`
	// Static or templated query-string params merged with caller-supplied `query`. Values may be strings, numbers, booleans, arrays, or placeholders. Array serialization is controlled by `query_array_format`.
	Query map[string]any `json:"query,omitempty"`
	// How array values are serialized in the query string. `comma` → `?a=1,2`; `brackets` → `?a[]=1&a[]=2`; `indices` → `?a[0]=1&a[1]=2`; `repeat` → `?a=1&a=2`.
	QueryArrayFormat *IntegrationResourceMethodQueryArrayFormat `json:"query_array_format,omitempty"`
	// JSON-schema-style declaration of supported query params used by Truto's MCP/tooling. May be a JSONata string for dynamic schemas, or a `JsonSchemaObject`.
	QuerySchema any `json:"query_schema,omitempty"`
	// JSON-schema-style declaration of the supported request body used by Truto's MCP/tooling. May be a JSONata string for dynamic schemas, or a `JsonSchemaObject`. The runtime (see `src/mcp/mcpRouter.ts`) reads `body_schema.properties`, so callers should emit the wrapped `JsonSchemaObject` shape `{ type "object", properties { ... } }` rather than a flat `{ name { type "string" } }` map.
	BodySchema any `json:"body_schema,omitempty"`
	// How the request body is serialized:
	//   * `json` — JSON-encoded (default).
	//   * `form` — `application/x-www-form-urlencoded`.
	//   * `multipart` — `multipart/form-data`. See `IntegrationResourceMethodBodyFormatConfigMultipart` for tuning options. The file field is declared in `body_schema` as `type: string, format: binary`.
	//   * `raw` — sent verbatim, with `Content-Type` set from `body_format_config.content_type`. For a file upload `body_schema` has exactly one property, `file` as `type: string, format: binary`; for a raw text body, a single plain `type: string` property. `raw` is also used to send a structured body under its own content type (for example `application/vnd.api+json` or `application/scim+json`), which is not a file and keeps an ordinary `body_schema`.
	//   * `xml` — converted to XML and sent as `application/xml`.
	BodyFormat *IntegrationResourceMethodBodyFormat `json:"body_format,omitempty"`
	// Extra options for the chosen `body_format`. Discriminated by the sibling `body_format` field — see `IntegrationResourceMethodBodyFormatConfigRaw` (for `raw`) and `IntegrationResourceMethodBodyFormatConfigMultipart` (for `multipart`). Ignored for `json`/`form`/`xml`. `anyOf`, not `oneOf`: the multipart shape has no required keys and no `additionalProperties: false`, so a raw config (`{ content_type }`) also satisfies it and `oneOf` rejected every raw method.
	BodyFormatConfig *IntegrationResourceMethodBodyFormatConfig `json:"body_format_config,omitempty"`
	// JSON-schema-style declaration of the response payload used by Truto's MCP/tooling.
	ResponseSchema any `json:"response_schema,omitempty"`
	// Dotted-path accessor (e.g. `data.results`, `payload.users.*`, `result.0.items`) into the parsed response that contains the canonical resource (or array of resources). Defaults to the root. This is a path lookup, **not** a JSONata expression.
	ResponsePath *string `json:"response_path,omitempty"`
	// Override the integration-level pagination for this single method. Set to `null` to disable pagination on a method that would otherwise inherit it.
	Pagination *IntegrationPagination `json:"pagination,omitempty"`
	// For `post`/`put`/`patch` methods, copy the caller-supplied query params into the body before sending.
	AddQueryToBody *bool `json:"add_query_to_body,omitempty"`
	// Don't re-send the body when fetching subsequent pagination pages.
	IgnoreBodyInPagination *bool `json:"ignore_body_in_pagination,omitempty"`
	// Drop the body entirely (useful for vendors that 400 on empty bodies).
	IgnoreBody *bool `json:"ignore_body,omitempty"`
	// Send a literal JSON `null` instead of an empty body.
	SetBodyToNull *bool `json:"set_body_to_null,omitempty"`
	// Skip applying the integration's authorization to this method (e.g. a public health check).
	NoAuth   *bool                             `json:"no_auth,omitempty"`
	Examples *IntegrationResourceMethodExample `json:"examples,omitempty"`
	// Strip the Authorization header when the upstream issues a redirect to a different host.
	IgnoreCredentialsOnRedirect *bool `json:"ignore_credentials_on_redirect,omitempty"`
	// Override the response parser (e.g. `xml`, `text`).
	APIResponseFormat *string `json:"api_response_format,omitempty"`
	// When true, fail loudly if the response can't be parsed; otherwise return a structured error.
	ThrowErrorOnParseError *bool `json:"throw_error_on_parse_error,omitempty"`
	// JSONata expression evaluated on every response (success or failure). Use to detect errors in successful (2xx) responses, normalize error messages, or transform "errors" with `< 400` status into successful responses with the `result` you return.
	ErrorExpression *string `json:"error_expression,omitempty"`
	// Human-readable description of the method, used in MCP tool listings.
	Description *string `json:"description,omitempty"`
	// URL to the upstream vendor's documentation for this method.
	APIDocumentationURL *string `json:"api_documentation_url,omitempty"`
	// Permissions required to call this method, **all** of which are needed. Usually OAuth
	// scopes, but an integration that issues no OAuth grant, or whose permissions are role
	// names, writes those here instead — which vocabulary is in use is derived from the
	// integration, or declared here with `permission_vocabulary`.
	Scopes []string `json:"scopes,omitempty"`
	// Permissions of which holding **any one** is enough, kept apart from `scopes` (which is
	// all-of). Providers say so explicitly — Microsoft Graph answers a 403 with "API requires
	// one of 'Chat.ReadBasic.All, Chat.Read.All, Chat.ReadWrite.All'" — and treating that as
	// all-of reports scopes as missing that the operation never needed.
	ScopesAnyOf []string `json:"scopes_any_of,omitempty"`
	// Which vocabulary `scopes` and `scopes_any_of` above are written in, declared rather
	// than inferred. Normally omitted: Truto derives this from configuration that already
	// exists, so every integration is classified without anyone labelling it. Set it only to
	// correct a derivation that reads an integration wrongly.
	PermissionVocabulary *IntegrationResourceMethodPermissionVocabulary `json:"permission_vocabulary,omitempty"`
	// Hints mirroring MCP `ToolAnnotations` for this method's tool, read by consumers that
	// classify tools (e.g. Elaichi) to decide read, write or destructive. Keys keep the MCP
	// spec's camelCase spelling on purpose. Absent means "no hint": consumers fall back to
	// their existing rules, and a missing flag is not read as `false`. `readOnlyHint` and
	// `destructiveHint` cannot both be `true`.
	MCPAnnotations *IntegrationResourceMethodMcpAnnotations `json:"mcp_annotations,omitempty"`
	// Steps to run before this method's own request: an array of steps run in order, or a
	// string naming a sibling method whose steps are reused. Same step shape as a unified
	// model mapping's `before`. Accepted and stored so engines that run proxy configs can
	// execute it; **Truto's own proxy does not run it yet**, so on Truto this is inert.
	// Each step's `run_if` must parse as JSONata, or the write is a 400.
	Before any `json:"before,omitempty"`
	// Static or templated request body for `post`/`put`/`patch` methods. Any JSON value (usually an object, sometimes an array) and may include placeholders. Use `$truto_merge` with `:json` to deep-merge an entire object; see placeholder syntax.
	Body any `json:"body,omitempty"`
}

Definition of a single resource method (e.g. `users.list`) for an integration.

type IntegrationResourceMethodBodyFormat

type IntegrationResourceMethodBodyFormat string

How the request body is serialized:

  • `json` — JSON-encoded (default).
  • `form` — `application/x-www-form-urlencoded`.
  • `multipart` — `multipart/form-data`. See `IntegrationResourceMethodBodyFormatConfigMultipart` for tuning options. The file field is declared in `body_schema` as `type: string, format: binary`.
  • `raw` — sent verbatim, with `Content-Type` set from `body_format_config.content_type`. For a file upload `body_schema` has exactly one property, `file` as `type: string, format: binary`; for a raw text body, a single plain `type: string` property. `raw` is also used to send a structured body under its own content type (for example `application/vnd.api+json` or `application/scim+json`), which is not a file and keeps an ordinary `body_schema`.
  • `xml` — converted to XML and sent as `application/xml`.

Values the SDK does not know about decode unchanged.

const (
	IntegrationResourceMethodBodyFormatJSON      IntegrationResourceMethodBodyFormat = "json"
	IntegrationResourceMethodBodyFormatForm      IntegrationResourceMethodBodyFormat = "form"
	IntegrationResourceMethodBodyFormatMultipart IntegrationResourceMethodBodyFormat = "multipart"
	IntegrationResourceMethodBodyFormatRaw       IntegrationResourceMethodBodyFormat = "raw"
	IntegrationResourceMethodBodyFormatXml       IntegrationResourceMethodBodyFormat = "xml"
)

Known IntegrationResourceMethodBodyFormat values.

type IntegrationResourceMethodBodyFormatConfig

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

Extra options for the chosen `body_format`. Discriminated by the sibling `body_format` field — see `IntegrationResourceMethodBodyFormatConfigRaw` (for `raw`) and `IntegrationResourceMethodBodyFormatConfigMultipart` (for `multipart`). Ignored for `json`/`form`/`xml`. `anyOf`, not `oneOf`: the multipart shape has no required keys and no `additionalProperties: false`, so a raw config (`{ content_type }`) also satisfies it and `oneOf` rejected every raw method.

It holds the raw JSON; use the As* methods to decode a specific shape.

func IntegrationResourceMethodBodyFormatConfigFromIntegrationResourceMethodBodyFormatConfigMultipart

func IntegrationResourceMethodBodyFormatConfigFromIntegrationResourceMethodBodyFormatConfigMultipart(v IntegrationResourceMethodBodyFormatConfigMultipart) (IntegrationResourceMethodBodyFormatConfig, error)

IntegrationResourceMethodBodyFormatConfigFromIntegrationResourceMethodBodyFormatConfigMultipart wraps a IntegrationResourceMethodBodyFormatConfigMultipart.

func IntegrationResourceMethodBodyFormatConfigFromIntegrationResourceMethodBodyFormatConfigRaw

func IntegrationResourceMethodBodyFormatConfigFromIntegrationResourceMethodBodyFormatConfigRaw(v IntegrationResourceMethodBodyFormatConfigRaw) (IntegrationResourceMethodBodyFormatConfig, error)

IntegrationResourceMethodBodyFormatConfigFromIntegrationResourceMethodBodyFormatConfigRaw wraps a IntegrationResourceMethodBodyFormatConfigRaw.

func (IntegrationResourceMethodBodyFormatConfig) AsIntegrationResourceMethodBodyFormatConfigMultipart

func (u IntegrationResourceMethodBodyFormatConfig) AsIntegrationResourceMethodBodyFormatConfigMultipart() (*IntegrationResourceMethodBodyFormatConfigMultipart, error)

AsIntegrationResourceMethodBodyFormatConfigMultipart decodes the value as a IntegrationResourceMethodBodyFormatConfigMultipart.

func (IntegrationResourceMethodBodyFormatConfig) AsIntegrationResourceMethodBodyFormatConfigRaw

func (u IntegrationResourceMethodBodyFormatConfig) AsIntegrationResourceMethodBodyFormatConfigRaw() (*IntegrationResourceMethodBodyFormatConfigRaw, error)

AsIntegrationResourceMethodBodyFormatConfigRaw decodes the value as a IntegrationResourceMethodBodyFormatConfigRaw.

func (IntegrationResourceMethodBodyFormatConfig) MarshalJSON

MarshalJSON implements json.Marshaler.

func (IntegrationResourceMethodBodyFormatConfig) Raw

Raw returns the JSON this IntegrationResourceMethodBodyFormatConfig holds.

func (*IntegrationResourceMethodBodyFormatConfig) UnmarshalJSON

UnmarshalJSON implements json.Unmarshaler.

type IntegrationResourceMethodBodyFormatConfigMultipart

type IntegrationResourceMethodBodyFormatConfigMultipart struct {
	// When true (the default), indexed leaf arrays are serialized as `field[0]=a&field[1]=b`; when false, as `field[]=a&field[]=b`.
	ShowLeafArrayIndexes *bool `json:"showLeafArrayIndexes,omitempty"`
	// When true, `null` values are sent as the literal string `"null"`. Defaults to `false` (omitted).
	IncludeNullValues *bool `json:"includeNullValues,omitempty"`
	// Optional pre-serialization value mapper. Keyed by JSON type; each value is a function that returns a string. Rarely needed.
	Mapping map[string]any `json:"mapping,omitempty"`
}

`body_format_config` shape when `body_format` is `multipart`. Tunes how nested JSON values are serialized into multipart fields.

type IntegrationResourceMethodBodyFormatConfigRaw

type IntegrationResourceMethodBodyFormatConfigRaw struct {
	// `Content-Type` header to attach to the raw body.
	ContentType string `json:"content_type"`
}

`body_format_config` shape when `body_format` is `raw`. The body is sent verbatim with the configured `content_type`.

type IntegrationResourceMethodExample

type IntegrationResourceMethodExample struct {
	// Sample response body (typically pretty-printed JSON, stored as a string).
	Response *string `json:"response,omitempty"`
	// Sample query-string params (stored as a string).
	Query *string `json:"query,omitempty"`
	// Sample request body (typically pretty-printed JSON, stored as a string).
	Body *string `json:"body,omitempty"`
}

Sample request/response payloads used by docs and the Truto MCP for tool descriptions.

type IntegrationResourceMethodMcpAnnotations

type IntegrationResourceMethodMcpAnnotations struct {
	// The tool does not modify its environment.
	ReadOnlyHint *bool `json:"readOnlyHint,omitempty"`
	// The tool may perform destructive updates (as opposed to purely additive ones).
	DestructiveHint *bool `json:"destructiveHint,omitempty"`
	// Calling the tool repeatedly with the same arguments has no additional effect.
	IdempotentHint *bool `json:"idempotentHint,omitempty"`
	// The tool interacts with an open world of external entities (as opposed to a closed domain).
	OpenWorldHint *bool `json:"openWorldHint,omitempty"`
}

Hints mirroring MCP `ToolAnnotations` for this method's tool, read by consumers that classify tools (e.g. Elaichi) to decide read, write or destructive. Keys keep the MCP spec's camelCase spelling on purpose. Absent means "no hint": consumers fall back to their existing rules, and a missing flag is not read as `false`. `readOnlyHint` and `destructiveHint` cannot both be `true`.

type IntegrationResourceMethodMethod

type IntegrationResourceMethodMethod string

HTTP method. Includes WebDAV/CalDAV verbs (e.g. `propfind`, `report`) for integrations such as Apple/iCloud Calendar.

Values the SDK does not know about decode unchanged.

const (
	IntegrationResourceMethodMethodGet        IntegrationResourceMethodMethod = "get"
	IntegrationResourceMethodMethodPost       IntegrationResourceMethodMethod = "post"
	IntegrationResourceMethodMethodPut        IntegrationResourceMethodMethod = "put"
	IntegrationResourceMethodMethodPatch      IntegrationResourceMethodMethod = "patch"
	IntegrationResourceMethodMethodDelete     IntegrationResourceMethodMethod = "delete"
	IntegrationResourceMethodMethodOptions    IntegrationResourceMethodMethod = "options"
	IntegrationResourceMethodMethodPropfind   IntegrationResourceMethodMethod = "propfind"
	IntegrationResourceMethodMethodReport     IntegrationResourceMethodMethod = "report"
	IntegrationResourceMethodMethodProppatch  IntegrationResourceMethodMethod = "proppatch"
	IntegrationResourceMethodMethodMkcalendar IntegrationResourceMethodMethod = "mkcalendar"
	IntegrationResourceMethodMethodMkcol      IntegrationResourceMethodMethod = "mkcol"
)

Known IntegrationResourceMethodMethod values.

type IntegrationResourceMethodPermissionVocabulary

type IntegrationResourceMethodPermissionVocabulary string

Which vocabulary `scopes` and `scopes_any_of` above are written in, declared rather than inferred. Normally omitted: Truto derives this from configuration that already exists, so every integration is classified without anyone labelling it. Set it only to correct a derivation that reads an integration wrongly.

Values the SDK does not know about decode unchanged.

const (
	IntegrationResourceMethodPermissionVocabularyOAuthScope       IntegrationResourceMethodPermissionVocabulary = "oauth_scope"
	IntegrationResourceMethodPermissionVocabularyAPIKeyPermission IntegrationResourceMethodPermissionVocabulary = "api_key_permission"
	IntegrationResourceMethodPermissionVocabularyRoleLabel        IntegrationResourceMethodPermissionVocabulary = "role_label"
)

Known IntegrationResourceMethodPermissionVocabulary values.

type IntegrationResourceMethodQueryArrayFormat

type IntegrationResourceMethodQueryArrayFormat string

How array values are serialized in the query string. `comma` → `?a=1,2`; `brackets` → `?a[]=1&a[]=2`; `indices` → `?a[0]=1&a[1]=2`; `repeat` → `?a=1&a=2`.

Values the SDK does not know about decode unchanged.

const (
	IntegrationResourceMethodQueryArrayFormatComma    IntegrationResourceMethodQueryArrayFormat = "comma"
	IntegrationResourceMethodQueryArrayFormatBrackets IntegrationResourceMethodQueryArrayFormat = "brackets"
	IntegrationResourceMethodQueryArrayFormatIndices  IntegrationResourceMethodQueryArrayFormat = "indices"
	IntegrationResourceMethodQueryArrayFormatRepeat   IntegrationResourceMethodQueryArrayFormat = "repeat"
)

Known IntegrationResourceMethodQueryArrayFormat values.

type IntegrationResponse

type IntegrationResponse struct {
	// The ID of the integration.
	ID *string `json:"id,omitempty"`
	// The name of the integration.
	Name *string `json:"name,omitempty"`
	// The category of the integration.
	Category *string `json:"category,omitempty"`
	// Whether the integration is in beta or not. Beta integrations might not have been tested completely and are not recommended for production environments.
	IsBeta *bool `json:"is_beta,omitempty"`
	// The configuration object defining the underlying API of the integration.
	Config *IntegrationConfig `json:"config,omitempty"`
	// The ID of the team that owns this integration.
	TeamID *string `json:"team_id,omitempty"`
	// The sharing policy of the integration.
	Sharing *IntegrationSchemaSharing `json:"sharing,omitempty"`
	// The date and time when the integration was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the integration was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// A list of environment IDs where this integration is installed.
	InstalledEnvironment []string `json:"installed_environment,omitempty"`
	// The team that owns this integration.
	Team *TeamSchema `json:"team,omitempty"`
}

IntegrationResponse is a Truto API object.

type IntegrationSchema

type IntegrationSchema struct {
	// The ID of the integration.
	ID *string `json:"id,omitempty"`
	// The name of the integration.
	Name *string `json:"name,omitempty"`
	// The category of the integration.
	Category *string `json:"category,omitempty"`
	// Whether the integration is in beta or not. Beta integrations might not have been tested completely and are not recommended for production environments.
	IsBeta *bool `json:"is_beta,omitempty"`
	// The configuration object defining the underlying API of the integration.
	Config *IntegrationConfig `json:"config,omitempty"`
	// The ID of the team that owns this integration.
	TeamID *string `json:"team_id,omitempty"`
	// The sharing policy of the integration.
	Sharing *IntegrationSchemaSharing `json:"sharing,omitempty"`
	// The date and time when the integration was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the integration was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

IntegrationSchema is a Truto API object.

type IntegrationSchemaSharing

type IntegrationSchemaSharing string

The sharing policy of the integration.

Values the SDK does not know about decode unchanged.

const (
	IntegrationSchemaSharingAllow IntegrationSchemaSharing = "allow"
	IntegrationSchemaSharingAsk   IntegrationSchemaSharing = "ask"
	IntegrationSchemaSharingDeny  IntegrationSchemaSharing = "deny"
)

Known IntegrationSchemaSharing values.

type IntegrationToolsResponse

type IntegrationToolsResponse struct {
	Result []IntegrationToolsResponseResultItem `json:"result,omitempty"`
}

IntegrationToolsResponse is a Truto API object.

type IntegrationToolsResponseResultItem

type IntegrationToolsResponseResultItem struct {
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
}

IntegrationToolsResponseResultItem is a Truto API object.

type IntegrationUnifiedApisResponse

type IntegrationUnifiedApisResponse struct {
	Result []IntegrationUnifiedApisResponseResultItem `json:"result,omitempty"`
}

IntegrationUnifiedApisResponse is a Truto API object.

type IntegrationUnifiedApisResponseResultItem

type IntegrationUnifiedApisResponseResultItem struct {
	APIName   *string                                                 `json:"api_name,omitempty"`
	Resources []IntegrationUnifiedApisResponseResultItemResourcesItem `json:"resources,omitempty"`
}

IntegrationUnifiedApisResponseResultItem is a Truto API object.

type IntegrationUnifiedApisResponseResultItemResourcesItem

type IntegrationUnifiedApisResponseResultItemResourcesItem struct {
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
	DocsURL     *string `json:"docs_url,omitempty"`
}

IntegrationUnifiedApisResponseResultItemResourcesItem is a Truto API object.

type IntegrationUpdateRequest

type IntegrationUpdateRequest struct {
	// The name of your integration.
	Name *string `json:"name,omitempty"`
	// A short descriptor or category.
	Category *string `json:"category,omitempty"`
	// The updated configuration object for the integration. See `IntegrationConfig` for the full typed shape.
	Config *IntegrationConfig `json:"config,omitempty"`
	// Whether the integration is considered beta.
	IsBeta *bool `json:"is_beta,omitempty"`
	// The current version of the integration. Required for concurrency control.
	Version float64 `json:"version"`
}

IntegrationUpdateRequest is a Truto API object.

type IntegrationWebhookBasicVerification

type IntegrationWebhookBasicVerification struct {
	Format IntegrationWebhookBasicVerificationFormat `json:"format"`
	Config IntegrationWebhookBasicVerificationConfig `json:"config"`
}

HTTP Basic signature verification.

type IntegrationWebhookBasicVerificationConfig

type IntegrationWebhookBasicVerificationConfig struct {
	// Expected username. Supports placeholders.
	Username string `json:"username"`
	// Expected password. Supports placeholders.
	Password string `json:"password"`
	// The full `Authorization` header value, e.g. `{{headers.authorization}}`.
	CompareWith string `json:"compare_with"`
}

HTTP Basic signature verification. Truto base64-encodes `username:password` and compares it with the second word of `compare_with` (i.e. `Authorization: Basic <token>`).

type IntegrationWebhookBasicVerificationFormat

type IntegrationWebhookBasicVerificationFormat string

IntegrationWebhookBasicVerificationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationWebhookBasicVerificationFormatBasic IntegrationWebhookBasicVerificationFormat = "basic"
)

Known IntegrationWebhookBasicVerificationFormat values.

type IntegrationWebhookBearerVerification

type IntegrationWebhookBearerVerification struct {
	Format IntegrationWebhookBearerVerificationFormat `json:"format"`
	Config IntegrationWebhookBearerVerificationConfig `json:"config"`
}

Bearer-token signature verification.

type IntegrationWebhookBearerVerificationConfig

type IntegrationWebhookBearerVerificationConfig struct {
	// Expected bearer token. Supports placeholders.
	Secret string `json:"secret"`
	// The full `Authorization` header value, e.g. `{{headers.authorization}}`.
	CompareWith string `json:"compare_with"`
}

Bearer-token signature verification. Truto compares `secret` (constant-time) with the second word of `compare_with` (i.e. `Authorization: Bearer <token>`).

type IntegrationWebhookBearerVerificationFormat

type IntegrationWebhookBearerVerificationFormat string

IntegrationWebhookBearerVerificationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationWebhookBearerVerificationFormatBearer IntegrationWebhookBearerVerificationFormat = "bearer"
)

Known IntegrationWebhookBearerVerificationFormat values.

type IntegrationWebhookConfig

type IntegrationWebhookConfig struct {
	// Strategy used to verify the webhook signature before accepting it. Runs **after** `payload_transform` and **after** `handle_verification` returns `{ type: 'payload' }`.
	SignatureVerification *IntegrationWebhookSignatureVerification `json:"signature_verification,omitempty"`
	// JSONata expression evaluated on **every** inbound webhook before signature verification. Use to:
	//   * Respond to handshake pings (return `{ type: 'verify', verification_response: { status_code, body, headers } }`).
	//   * Surface meta-events that should not fan out (return `{ type: 'meta' }`).
	//   * Update the integrated account context (return `{ type: 'verify' \| 'payload' \| 'meta', update_context: { ... } }`).
	//   * Pass through to fan-out (return `{ type: 'payload' }` or omit entirely — defaults to `payload`).
	HandleVerification *string `json:"handle_verification,omitempty"`
	// JSONata expression that transforms the raw inbound payload **before** `handle_verification` and `signature_verification` see it. Use to normalize vendor-specific envelopes (e.g. unwrap a Salesforce `payloads[]` array, decode a base64 body).
	PayloadTransform *string `json:"payload_transform,omitempty"`
}

How Truto receives and verifies inbound webhooks for this integration. **Not** to be confused with `WebhookSchema` elsewhere in this spec, which describes Truto's _outbound_ webhook delivered to your application.

type IntegrationWebhookHandleVerificationResult

type IntegrationWebhookHandleVerificationResult struct {
	// Branch selector — `verify` returns `verification_response` directly to the vendor; `payload` falls through to normal event handling.
	Type IntegrationWebhookHandleVerificationResultType `json:"type"`
	// Used when `type: "verify"`. Truto sends this back as the HTTP response to the vendor's handshake.
	VerificationResponse *IntegrationWebhookHandleVerificationResultVerificationResponse `json:"verification_response,omitempty"`
	// Optional patch to merge into the integrated-account context after handling this verification. Useful for storing vendor-issued subscription IDs, signing secrets, etc.
	UpdateContext map[string]any `json:"update_context,omitempty"`
}

Return value from `webhook.handle_verification`.

type IntegrationWebhookHandleVerificationResultType

type IntegrationWebhookHandleVerificationResultType string

Branch selector — `verify` returns `verification_response` directly to the vendor; `payload` falls through to normal event handling.

Values the SDK does not know about decode unchanged.

const (
	IntegrationWebhookHandleVerificationResultTypeVerify  IntegrationWebhookHandleVerificationResultType = "verify"
	IntegrationWebhookHandleVerificationResultTypePayload IntegrationWebhookHandleVerificationResultType = "payload"
	IntegrationWebhookHandleVerificationResultTypeMeta    IntegrationWebhookHandleVerificationResultType = "meta"
)

Known IntegrationWebhookHandleVerificationResultType values.

type IntegrationWebhookHandleVerificationResultVerificationResponse

type IntegrationWebhookHandleVerificationResultVerificationResponse struct {
	// HTTP status code (default 200).
	StatusCode *int64 `json:"status_code,omitempty"`
	// Response headers.
	Headers map[string]string `json:"headers,omitempty"`
	// Response body (serialized as JSON unless the headers say otherwise).
	Body map[string]any `json:"body,omitempty"`
}

Used when `type: "verify"`. Truto sends this back as the HTTP response to the vendor's handshake.

type IntegrationWebhookHmacVerification

type IntegrationWebhookHmacVerification struct {
	Format IntegrationWebhookHmacVerificationFormat `json:"format"`
	Config IntegrationWebhookHmacVerificationConfig `json:"config"`
}

HMAC signature verification. Truto computes `hmac(algorithm, secret, signed_string)` and compares it (constant-time) with `compare_with`.

type IntegrationWebhookHmacVerificationConfig

type IntegrationWebhookHmacVerificationConfig struct {
	// Shared HMAC secret. Typically a placeholder like `{{context.webhook_secret}}` or `{{environment_variables.WEBHOOK_SECRET_secret}}`.
	Secret string `json:"secret"`
	// Hashing algorithm.
	Algorithm string `json:"algorithm"`
	// Output encoding for the computed digest.
	StringType *string `json:"string_type,omitempty"`
	// The signature value from the request to compare against. Usually a placeholder like `{{headers.x-signature}}`.
	CompareWith string `json:"compare_with"`
	// Ordered list of `IntegrationWebhookPayloadContext` field names to concatenate as the signed string (e.g. `["raw_body"]` or `["timestamp", "raw_body"]`). Mutually exclusive with `verification_content`.
	Parts []string `json:"parts,omitempty"`
	// Ordered list of placeholders to concatenate as the signed string (e.g. `["{{headers.x-timestamp}}", ".", "{{raw_body}}"]`). Mutually exclusive with `parts`.
	VerificationContent []string `json:"verification_content,omitempty"`
}

HMAC signature verification. Truto computes `hmac(algorithm, secret, signed_string)` and compares it (constant-time) with `compare_with`.

type IntegrationWebhookHmacVerificationFormat

type IntegrationWebhookHmacVerificationFormat string

IntegrationWebhookHmacVerificationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationWebhookHmacVerificationFormatHMAC IntegrationWebhookHmacVerificationFormat = "hmac"
)

Known IntegrationWebhookHmacVerificationFormat values.

type IntegrationWebhookJwtVerification

type IntegrationWebhookJwtVerification struct {
	Format IntegrationWebhookJwtVerificationFormat `json:"format"`
	Config IntegrationWebhookJwtVerificationConfig `json:"config"`
}

JWT signature verification.

type IntegrationWebhookJwtVerificationConfig

type IntegrationWebhookJwtVerificationConfig struct {
	// Shared signing secret for HS256. Supports placeholders. Not used when `jwks_uri` is set.
	Secret *string `json:"secret,omitempty"`
	// The JWT to verify, typically a placeholder like `{{headers.authorization}}` or `{{body.token}}`. With `jwks_uri`, an `Authorization: Bearer <jwt>` value is accepted as-is.
	CompareWith string `json:"compare_with"`
	// HTTPS URL of the issuer's JSON Web Key Set. Setting it selects the issuer-key-set mode. Keys are cached for an hour.
	JwksURI *string `json:"jwks_uri,omitempty"`
	// Asymmetric algorithm the token must use (`RS256`, `RS384`, `RS512`, `PS256`, `PS384`, `PS512`, `ES256`, `ES384`, `ES512` or `EdDSA`). Defaults to `RS256`. Used with `jwks_uri` only.
	Algorithm *string `json:"algorithm,omitempty"`
	// Required `iss` claim, e.g. `https://accounts.google.com`. Used with `jwks_uri` only.
	Issuer *string `json:"issuer,omitempty"`
	// Required `aud` claim. Supports placeholders, e.g. `https://api.truto.one/environment-integration-webhook/{{environment_integration_id}}`. Used with `jwks_uri` only.
	Audience *string `json:"audience,omitempty"`
	// Required `email` claim, e.g. the push subscription's service account. The token's `email_verified` must also be true. Used with `jwks_uri` only.
	Email *string `json:"email,omitempty"`
	// Required `sub` claim. Use instead of, or together with, `email`. Used with `jwks_uri` only.
	Subject *string `json:"subject,omitempty"`
}

JWT signature verification, in one of two modes.

type IntegrationWebhookJwtVerificationFormat

type IntegrationWebhookJwtVerificationFormat string

IntegrationWebhookJwtVerificationFormat is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	IntegrationWebhookJwtVerificationFormatJWT IntegrationWebhookJwtVerificationFormat = "jwt"
)

Known IntegrationWebhookJwtVerificationFormat values.

type IntegrationWebhookPayloadContext

type IntegrationWebhookPayloadContext struct {
	// Parsed JSON body of the inbound webhook request.
	Body map[string]any `json:"body,omitempty"`
	// Raw (unparsed) request body. Required for HMAC verification of vendors that sign the exact byte stream.
	RawBody *string `json:"raw_body,omitempty"`
	// Lower-cased request headers.
	Headers map[string]string `json:"headers,omitempty"`
	// Query-string params from the webhook callback URL (e.g. Truto's signed handshake parameters).
	QueryParams map[string]string `json:"query_params,omitempty"`
	// The integrated account this webhook was delivered to. Present for per-account webhook URLs.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The environment ID resolved from the webhook URL.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The environment-integration ID. Present for environment-level webhook URLs.
	EnvironmentIntegrationID *string `json:"environment_integration_id,omitempty"`
	// `verify` for handshake/challenge requests, `payload` for real event deliveries, `meta` for Truto metadata pings.
	WebhookType *IntegrationWebhookPayloadContextWebhookType `json:"webhook_type,omitempty"`
	// The full integrated-account context (credentials, OAuth tokens, env vars, etc.). Same shape as the request context used elsewhere.
	Context *IntegrationPlaceholderContext `json:"context,omitempty"`
}

Input passed to `webhook.handle_verification`, `webhook.payload_transform`, and the `webhook.signature_verification.config` placeholder resolver.

type IntegrationWebhookPayloadContextWebhookType

type IntegrationWebhookPayloadContextWebhookType string

`verify` for handshake/challenge requests, `payload` for real event deliveries, `meta` for Truto metadata pings.

Values the SDK does not know about decode unchanged.

const (
	IntegrationWebhookPayloadContextWebhookTypeVerify  IntegrationWebhookPayloadContextWebhookType = "verify"
	IntegrationWebhookPayloadContextWebhookTypePayload IntegrationWebhookPayloadContextWebhookType = "payload"
	IntegrationWebhookPayloadContextWebhookTypeMeta    IntegrationWebhookPayloadContextWebhookType = "meta"
)

Known IntegrationWebhookPayloadContextWebhookType values.

type IntegrationWebhookSignatureVerification

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

Strategy used to verify an inbound webhook's signature. The `format` discriminator selects which `config` shape applies.

It holds the raw JSON; use the As* methods to decode a specific shape.

func IntegrationWebhookSignatureVerificationFromIntegrationWebhookBasicVerification

func IntegrationWebhookSignatureVerificationFromIntegrationWebhookBasicVerification(v IntegrationWebhookBasicVerification) (IntegrationWebhookSignatureVerification, error)

IntegrationWebhookSignatureVerificationFromIntegrationWebhookBasicVerification wraps a IntegrationWebhookBasicVerification.

func IntegrationWebhookSignatureVerificationFromIntegrationWebhookBearerVerification

func IntegrationWebhookSignatureVerificationFromIntegrationWebhookBearerVerification(v IntegrationWebhookBearerVerification) (IntegrationWebhookSignatureVerification, error)

IntegrationWebhookSignatureVerificationFromIntegrationWebhookBearerVerification wraps a IntegrationWebhookBearerVerification.

func IntegrationWebhookSignatureVerificationFromIntegrationWebhookHmacVerification

func IntegrationWebhookSignatureVerificationFromIntegrationWebhookHmacVerification(v IntegrationWebhookHmacVerification) (IntegrationWebhookSignatureVerification, error)

IntegrationWebhookSignatureVerificationFromIntegrationWebhookHmacVerification wraps a IntegrationWebhookHmacVerification.

func IntegrationWebhookSignatureVerificationFromIntegrationWebhookJwtVerification

func IntegrationWebhookSignatureVerificationFromIntegrationWebhookJwtVerification(v IntegrationWebhookJwtVerification) (IntegrationWebhookSignatureVerification, error)

IntegrationWebhookSignatureVerificationFromIntegrationWebhookJwtVerification wraps a IntegrationWebhookJwtVerification.

func (IntegrationWebhookSignatureVerification) AsIntegrationWebhookBasicVerification

func (u IntegrationWebhookSignatureVerification) AsIntegrationWebhookBasicVerification() (*IntegrationWebhookBasicVerification, error)

AsIntegrationWebhookBasicVerification decodes the value as a IntegrationWebhookBasicVerification.

func (IntegrationWebhookSignatureVerification) AsIntegrationWebhookBearerVerification

func (u IntegrationWebhookSignatureVerification) AsIntegrationWebhookBearerVerification() (*IntegrationWebhookBearerVerification, error)

AsIntegrationWebhookBearerVerification decodes the value as a IntegrationWebhookBearerVerification.

func (IntegrationWebhookSignatureVerification) AsIntegrationWebhookHmacVerification

func (u IntegrationWebhookSignatureVerification) AsIntegrationWebhookHmacVerification() (*IntegrationWebhookHmacVerification, error)

AsIntegrationWebhookHmacVerification decodes the value as a IntegrationWebhookHmacVerification.

func (IntegrationWebhookSignatureVerification) AsIntegrationWebhookJwtVerification

func (u IntegrationWebhookSignatureVerification) AsIntegrationWebhookJwtVerification() (*IntegrationWebhookJwtVerification, error)

AsIntegrationWebhookJwtVerification decodes the value as a IntegrationWebhookJwtVerification.

func (IntegrationWebhookSignatureVerification) Discriminator

Discriminator returns the value of the "format" property, which tells the shapes apart.

func (IntegrationWebhookSignatureVerification) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (IntegrationWebhookSignatureVerification) Raw

Raw returns the JSON this IntegrationWebhookSignatureVerification holds.

func (*IntegrationWebhookSignatureVerification) UnmarshalJSON

func (u *IntegrationWebhookSignatureVerification) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type IntegrationsService

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

IntegrationsService manages integration definitions.

func (*IntegrationsService) Capabilities

func (s *IntegrationsService) Capabilities(ctx context.Context, id string, opts ...Option) (*CapabilitiesResponse, error)

Capabilities describes the integration's resources, methods and auth.

func (*IntegrationsService) Create

Create creates a private integration.

func (*IntegrationsService) Delete

func (s *IntegrationsService) Delete(ctx context.Context, id string, opts ...Option) (*DeleteResponse, error)

Delete deletes an integration.

func (*IntegrationsService) Get

Get fetches an integration.

func (*IntegrationsService) Install

func (s *IntegrationsService) Install(ctx context.Context, integrationID string, isEnabled bool, opts ...Option) (*EnvironmentIntegrationResponse, error)

Install installs the integration in the environment the token belongs to.

func (*IntegrationsService) List

List returns an iterator over integrations.

func (*IntegrationsService) Tools

Tools lists the tools the integration exposes.

func (*IntegrationsService) UnifiedAPIs

UnifiedAPIs lists the unified models and resources the integration supports.

func (*IntegrationsService) Uninstall

func (s *IntegrationsService) Uninstall(ctx context.Context, integrationID string, opts ...Option) ([]EnvironmentIntegrationDeleteResponse, error)

Uninstall removes the integration from the environment. It looks up the environment integrations for integrationID and deletes each one.

func (*IntegrationsService) Update

Update changes an integration.

type Iterator

type Iterator[T any] struct {
	// contains filtered or unexported fields
}

Iterator walks a cursor-paginated list endpoint. It is lazy: no request is made until the first call to Next, NextPage, All, First or Seq.

it := client.IntegratedAccounts.List(ctx)
for {
	acct, err := it.Next()
	if err == truto.Done {
		break
	}
	if err != nil {
		return err
	}
	fmt.Println(*acct.ID)
}

Or with Go 1.23 range-over-func:

for acct, err := range client.IntegratedAccounts.List(ctx).Seq() { ... }

An Iterator is not safe for concurrent use.

func (*Iterator[T]) All

func (it *Iterator[T]) All() ([]T, error)

All fetches every remaining page and returns all items.

func (*Iterator[T]) First

func (it *Iterator[T]) First() (*T, error)

First returns the first item of the first page, or Done if the list is empty.

func (*Iterator[T]) Next

func (it *Iterator[T]) Next() (*T, error)

Next returns the next item, fetching pages as needed. It returns Done after the last item.

func (*Iterator[T]) NextPage

func (it *Iterator[T]) NextPage() (*Page[T], error)

NextPage fetches the next page. After the last page it returns Done.

func (*Iterator[T]) Seq

func (it *Iterator[T]) Seq() iter.Seq2[T, error]

Seq returns a range-over-func sequence of the remaining items. Iteration stops after the first error, which is yielded with a zero item.

type JsonSchemaObject

type JsonSchemaObject struct {
	Type JsonSchemaObjectType `json:"type"`
	Ref  *string              `json:"$ref,omitempty"`
	// Map of property name → `JsonSchemaObjectProperties`.
	Properties           map[string]JsonSchemaObjectProperties `json:"properties"`
	Description          *string                               `json:"description,omitempty"`
	Required             *bool                                 `json:"required,omitempty"`
	Default              any                                   `json:"default,omitempty"`
	AdditionalProperties *bool                                 `json:"additionalProperties,omitempty"`
}

Top-level JSON Schema object used by Truto's unified-model resource definitions.

type JsonSchemaObjectProperties

type JsonSchemaObjectProperties struct {
	Type *JsonSchemaObjectPropertiesType `json:"type,omitempty"`
	// JSON Schema `$ref` pointer (used when this property references another schema).
	Ref         *string `json:"$ref,omitempty"`
	Description *string `json:"description,omitempty"`
	// Whether this property is required. Truto uses a boolean per-property convention rather than the standard JSON Schema `required` array.
	Required *bool `json:"required,omitempty"`
	// When `type=array`, the element schema (only `type` is enforced).
	Items *JsonSchemaObjectPropertiesItems `json:"items,omitempty"`
	// When `type=object`, the nested property map.
	Properties map[string]any `json:"properties,omitempty"`
	// JSONata expression (string) or an object-form mapping describing how to project this property out of the integration response.
	Mapping any `json:"mapping,omitempty"`
	// Default value used when the caller omits this field.
	Default any `json:"default,omitempty"`
	// Optional format hint (e.g. `date-time`, `uuid`). On a `body_schema` property, `type: string` + `format: binary` declares FILE BYTES. The rule, exactly: the property is TOP-LEVEL (or the `items` of a top-level array of files, `multipart` only; Elaichi does not send multipart arrays as files yet, which needs `noSquareBrackets: true` on the method and cardamom#30, so a single file field works today and the lint warns on an array) and is `type: string` (an untyped `{format: binary}` is not a file), and the method's effective body is `multipart` (a file part named after the property) or `raw` (the ONE property of the body, under a content type that is not a data format; an array of files is not read under `raw`). The effective body is the engine's: an unset `body_format` means `json` for a `list` method and a DELETE `delete`, and NO body for every other method, and `multipart` on list/get/delete or `raw` on get/delete is not built at all. `format: binary` on a `json`/`form`/`xml` body (or a method that sends no body) is not read as a file; a file carried as base64 text in a `json`/`form` body uses `contentEncoding` instead.
	Format *string `json:"format,omitempty"`
	// JSON Schema `contentEncoding`. On a TOP-LEVEL `type: string` property (or the `items` of a top-level array) of a `json` or `form` `body_schema`, `base64` / `base64url` (case-insensitive) declares that the string carries a file's content encoded as text (for example Microsoft Graph `contentBytes`). Elaichi reads it in `json` and `form` bodies and also as a scalar part in `multipart`; it is not read in `raw` (the body is the bytes, declared with `format: binary`) or `xml`, and a multipart ARRAY of encoded parts is deferred like an array of files. `format: byte` alone is not a file. Never combine it with `format: binary`.
	ContentEncoding *string `json:"contentEncoding,omitempty"`
	// Allowed values for the property.
	Enum                 []any   `json:"enum,omitempty"`
	AdditionalProperties *bool   `json:"additionalProperties,omitempty"`
	Example              *string `json:"example,omitempty"`
	// Free-form description shown when the property is required only in certain contexts.
	ConditionallyRequiredDescription *string `json:"conditionallyRequiredDescription,omitempty"`
	// Truto-specific cross-resource reference metadata. Either a single reference object, an array of references, or omitted entirely. Explicit `null` is also accepted to clear any inherited reference.
	XTrutoReference any `json:"xTrutoReference,omitempty"`
}

A single property entry in a JSON Schema-style declaration. Used for `query_schema`, `body_schema`, `request_body_schema`, and the inner `properties` map of `JsonSchemaObject`.

type JsonSchemaObjectPropertiesItems

type JsonSchemaObjectPropertiesItems struct {
	Type *JsonSchemaObjectPropertiesItemsType `json:"type,omitempty"`
}

When `type=array`, the element schema (only `type` is enforced).

type JsonSchemaObjectPropertiesItemsType

type JsonSchemaObjectPropertiesItemsType string

JsonSchemaObjectPropertiesItemsType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	JsonSchemaObjectPropertiesItemsTypeString  JsonSchemaObjectPropertiesItemsType = "string"
	JsonSchemaObjectPropertiesItemsTypeNumber  JsonSchemaObjectPropertiesItemsType = "number"
	JsonSchemaObjectPropertiesItemsTypeBoolean JsonSchemaObjectPropertiesItemsType = "boolean"
	JsonSchemaObjectPropertiesItemsTypeArray   JsonSchemaObjectPropertiesItemsType = "array"
	JsonSchemaObjectPropertiesItemsTypeObject  JsonSchemaObjectPropertiesItemsType = "object"
	JsonSchemaObjectPropertiesItemsTypeInteger JsonSchemaObjectPropertiesItemsType = "integer"
)

Known JsonSchemaObjectPropertiesItemsType values.

type JsonSchemaObjectPropertiesType

type JsonSchemaObjectPropertiesType string

JsonSchemaObjectPropertiesType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	JsonSchemaObjectPropertiesTypeString  JsonSchemaObjectPropertiesType = "string"
	JsonSchemaObjectPropertiesTypeNumber  JsonSchemaObjectPropertiesType = "number"
	JsonSchemaObjectPropertiesTypeBoolean JsonSchemaObjectPropertiesType = "boolean"
	JsonSchemaObjectPropertiesTypeArray   JsonSchemaObjectPropertiesType = "array"
	JsonSchemaObjectPropertiesTypeObject  JsonSchemaObjectPropertiesType = "object"
	JsonSchemaObjectPropertiesTypeInteger JsonSchemaObjectPropertiesType = "integer"
)

Known JsonSchemaObjectPropertiesType values.

type JsonSchemaObjectType

type JsonSchemaObjectType string

JsonSchemaObjectType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	JsonSchemaObjectTypeObject JsonSchemaObjectType = "object"
)

Known JsonSchemaObjectType values.

type LinkToken

type LinkToken struct {
	// The link token that can be used to initiate a connection flow.
	LinkToken *string `json:"link_token,omitempty"`
}

LinkToken is a Truto API object.

type LinkTokenRequest

type LinkTokenRequest struct {
	// The ID of the tenant you want to create a link token for. Required if you are creating a link token for a new integrated account. Free-form up to 255 characters, excluding control characters, leading or trailing whitespace, and the dot segments `.` and `..`.
	TenantID *string `json:"tenant_id,omitempty"`
	// The ID of the integrated account you want to reauthorize. Do NOT specify `tenant_id` if you are reauthorizing an integrated account.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The context of the integrated account. You can find these in the `Variables` section of an integrated account in the Truto UI.
	Context map[string]any `json:"context,omitempty"`
	// The URI where the user should be redirected after the connection flow is complete. This is especially useful when you are authenticating via a Desktop app.
	RedirectURI *string `json:"redirect_uri,omitempty"`
	// IDs of environment unified models (installed unified models) whose OAuth scopes should be used during the connection flow. When omitted, integration default scopes are used unless overridden by `scopes`.
	EnvironmentUnifiedModelID []string `json:"environment_unified_model_id,omitempty"`
	// OAuth scopes to request during authentication. These scopes will take precedence over unified model scopes and integration default scopes.
	Scopes []string `json:"scopes,omitempty"`
	// If set to true, the context of the integrated account will be persisted when reconnecting. Set to false by default.
	PersistPreviousContext *bool `json:"persist_previous_context,omitempty"`
	// The ID of the static gate to associate with this integrated account. The static gate must be one you can see. For a link token that names an `environment_id`, it must also be in an environment of that environment's team, or it's a `404`. Whatever the token, a connection only ever uses a gate of its own team, and another team's gate is ignored when its requests are made.
	TrutoStaticGateID *string `json:"truto_static_gate_id,omitempty"`
	// The region where the new integrated account will be placed. Only applies when creating a new integrated account via the link token (ignored for reauthorization).
	Region *LinkTokenRequestRegion `json:"region,omitempty"`
}

LinkTokenRequest is a Truto API object.

type LinkTokenRequestRegion

type LinkTokenRequestRegion string

The region where the new integrated account will be placed. Only applies when creating a new integrated account via the link token (ignored for reauthorization).

Values the SDK does not know about decode unchanged.

const (
	LinkTokenRequestRegionWnam LinkTokenRequestRegion = "wnam"
	LinkTokenRequestRegionEnam LinkTokenRequestRegion = "enam"
	LinkTokenRequestRegionApac LinkTokenRequestRegion = "apac"
	LinkTokenRequestRegionEu   LinkTokenRequestRegion = "eu"
)

Known LinkTokenRequestRegion values.

type LinkTokensService

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

LinkTokensService creates link tokens, which start the Truto Link connection flow in your frontend.

func (*LinkTokensService) Create

func (s *LinkTokensService) Create(ctx context.Context, body LinkTokenRequest, opts ...Option) (*LinkToken, error)

Create creates a link token.

type Log

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

A single log entry returned by `GET /log`. The `log_type` field on each row matches the `log_type` query parameter that was used to fetch it, and identifies which variant schema applies. Variants share the `LogBase` fields and may carry additional fields not enumerated in the spec — clients should treat unknown fields as opaque.

It holds the raw JSON; use the As* methods to decode a specific shape.

func LogFromMcpLog

func LogFromMcpLog(v McpLog) (Log, error)

LogFromMcpLog wraps a McpLog.

func LogFromRapidBridgeLog

func LogFromRapidBridgeLog(v RapidBridgeLog) (Log, error)

LogFromRapidBridgeLog wraps a RapidBridgeLog.

func LogFromSyncJobCronTriggerLog

func LogFromSyncJobCronTriggerLog(v SyncJobCronTriggerLog) (Log, error)

LogFromSyncJobCronTriggerLog wraps a SyncJobCronTriggerLog.

func LogFromUnifiedProxyApiLog

func LogFromUnifiedProxyApiLog(v UnifiedProxyApiLog) (Log, error)

LogFromUnifiedProxyApiLog wraps a UnifiedProxyApiLog.

func LogFromWebhookLog

func LogFromWebhookLog(v WebhookLog) (Log, error)

LogFromWebhookLog wraps a WebhookLog.

func (Log) AsMcpLog

func (u Log) AsMcpLog() (*McpLog, error)

AsMcpLog decodes the value as a McpLog.

func (Log) AsRapidBridgeLog

func (u Log) AsRapidBridgeLog() (*RapidBridgeLog, error)

AsRapidBridgeLog decodes the value as a RapidBridgeLog.

func (Log) AsSyncJobCronTriggerLog

func (u Log) AsSyncJobCronTriggerLog() (*SyncJobCronTriggerLog, error)

AsSyncJobCronTriggerLog decodes the value as a SyncJobCronTriggerLog.

func (Log) AsUnifiedProxyApiLog

func (u Log) AsUnifiedProxyApiLog() (*UnifiedProxyApiLog, error)

AsUnifiedProxyApiLog decodes the value as a UnifiedProxyApiLog.

func (Log) AsWebhookLog

func (u Log) AsWebhookLog() (*WebhookLog, error)

AsWebhookLog decodes the value as a WebhookLog.

func (Log) Discriminator

func (u Log) Discriminator() string

Discriminator returns the value of the "log_type" property, which tells the shapes apart.

func (Log) MarshalJSON

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

MarshalJSON implements json.Marshaler.

func (Log) Raw

func (u Log) Raw() json.RawMessage

Raw returns the JSON this Log holds.

func (*Log) UnmarshalJSON

func (u *Log) UnmarshalJSON(b []byte) error

UnmarshalJSON implements json.Unmarshaler.

type LogBase

type LogBase struct {
	// The time at which the log entry was recorded.
	Timestamp *string `json:"timestamp,omitempty"`
	// Human-readable summary of the log event.
	Message *string `json:"message,omitempty"`
	// The service that generated the log.
	Service *string `json:"service,omitempty"`
	// The deployment that wrote the log (`production`, `staging`,
	// `staging2`, `thoropass-production`, and per-developer preview
	// deployments). Distinct from `environment_id`, which is the Truto
	// environment the log belongs to: a single `environment_id` can be
	// served by more than one deployment, and `app_env` is what tells
	// them apart. Not an enumerated set — new deployments add values.
	AppEnv *string `json:"app_env,omitempty"`
	// The Truto environment in which the log was generated.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// Discriminator. Echoed from the `log_type` query parameter so each
	// row is self-describing. Use this to switch on variant when
	// consuming the response programmatically.
	LogType *LogBaseLogType `json:"log_type,omitempty"`
	// Internal log messages captured during request/job processing.
	Logs []string `json:"logs,omitempty"`
}

Common fields present on every log entry returned by `GET /log`. Each concrete variant (e.g. `UnifiedProxyApiLog`, `WebhookLog`) extends this base with type-specific fields via `allOf`.

type LogBaseLogType

type LogBaseLogType string

Discriminator. Echoed from the `log_type` query parameter so each row is self-describing. Use this to switch on variant when consuming the response programmatically.

Values the SDK does not know about decode unchanged.

const (
	LogBaseLogTypeUnifiedProxyAPI    LogBaseLogType = "unified_proxy_api"
	LogBaseLogTypeRapidBridge        LogBaseLogType = "rapid_bridge"
	LogBaseLogTypeWebhook            LogBaseLogType = "webhook"
	LogBaseLogTypeMCP                LogBaseLogType = "mcp"
	LogBaseLogTypeSyncJobCronTrigger LogBaseLogType = "sync_job_cron_trigger"
)

Known LogBaseLogType values.

type LogsService

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

LogsService manages logs. The API requires the log_type query parameter (unified_proxy_api, rapid_bridge, webhook, mcp, sync_job_cron_trigger), for example WithQuery(truto.Params{"log_type": "unified_proxy_api"}).

func (*LogsService) List

func (s *LogsService) List(ctx context.Context, opts ...Option) *Iterator[Log]

List returns an iterator over the items. Filter with WithQuery.

type MCP

type MCP struct {
	// Unique identifier for the MCP server.
	ID *string `json:"id,omitempty"`
	// Human-readable name for the MCP server.
	Name *string `json:"name,omitempty"`
	// The integrated account this MCP server is bound to.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// Optional scoping for the MCP server. When omitted, all available tools for the integrated account are exposed.
	Config *MCPConfig `json:"config,omitempty"`
	// Optional expiry timestamp. When set, the MCP server's token is invalidated after this time.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// ID of the user who created the MCP server.
	CreatedBy *string `json:"created_by,omitempty"`
	// Time at which the MCP server was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// Time at which the MCP server was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

An MCP server attached to an integrated account. Each integrated account can have multiple MCP servers, each with its own scoping (`config.methods` and `config.tags`), tool exposure mode, and optional expiry.

type MCPConfig

type MCPConfig struct {
	// Restrict the MCP server to these Truto method names. Combined with `tags` using AND semantics.
	Methods []string `json:"methods,omitempty"`
	// Restrict the MCP server to tools whose effective tags (resource-level and optional resource.method tags) intersect these values.
	Tags []string `json:"tags,omitempty"`
	// How tools are exposed on `tools/list`.
	// - `all` (default): every matching tool schema is listed.
	// - `discovery`: only three meta-tools are listed (`search_tools`, `get_tool_schema`, `call_tool`). The client discovers and calls real tools through those.
	ToolExposure *MCPConfigToolExposure `json:"tool_exposure,omitempty"`
	// When true, MCP requests also require a valid Truto API token in the Authorization Bearer header.
	RequireAPITokenAuth *bool `json:"require_api_token_auth,omitempty"`
}

Optional scoping for the MCP server. When omitted, all available tools for the integrated account are exposed.

type MCPConfigToolExposure

type MCPConfigToolExposure string

How tools are exposed on `tools/list`. - `all` (default): every matching tool schema is listed. - `discovery`: only three meta-tools are listed (`search_tools`, `get_tool_schema`, `call_tool`). The client discovers and calls real tools through those.

Values the SDK does not know about decode unchanged.

const (
	MCPConfigToolExposureAll       MCPConfigToolExposure = "all"
	MCPConfigToolExposureDiscovery MCPConfigToolExposure = "discovery"
)

Known MCPConfigToolExposure values.

type MCPCreateResponse

type MCPCreateResponse struct {
	// Unique identifier for the MCP server.
	ID *string `json:"id,omitempty"`
	// Human-readable name for the MCP server.
	Name *string `json:"name,omitempty"`
	// The integrated account this MCP server is bound to.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// Optional scoping for the MCP server. When omitted, all available tools for the integrated account are exposed.
	Config *MCPConfig `json:"config,omitempty"`
	// Optional expiry timestamp. When set, the MCP server's token is invalidated after this time.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// ID of the user who created the MCP server.
	CreatedBy *string `json:"created_by,omitempty"`
	// Time at which the MCP server was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// Time at which the MCP server was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// Bearer token used to authenticate MCP requests. Treat this as a secret; it is not retrievable after creation.
	Token *string `json:"token,omitempty"`
	// Full MCP endpoint URL. Configure your MCP client with this URL to connect to the server.
	URL *string `json:"url,omitempty"`
}

Response returned by `POST /integrated-account/{integrated_account_id}/mcp`. Includes the MCP server fields, the freshly minted bearer `token`, and the full `url` to use when configuring an MCP client. The token is only returned at creation time and cannot be retrieved later.

type MCPService

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

MCPService talks JSON-RPC to a Truto MCP server, addressed by its token (see IntegratedAccountsService.CreateMCPServer).

func (*MCPService) Call

func (s *MCPService) Call(ctx context.Context, token string, payload any, opts ...Option) (*Record, error)

Call sends a raw JSON-RPC payload.

func (*MCPService) CallTool

func (s *MCPService) CallTool(ctx context.Context, token, name string, args any, opts ...Option) (*Record, error)

CallTool calls one tool with arguments.

func (*MCPService) Initialize

func (s *MCPService) Initialize(ctx context.Context, token, clientName, clientVersion string, opts ...Option) (*Record, error)

Initialize starts an MCP session.

func (*MCPService) ListTools

func (s *MCPService) ListTools(ctx context.Context, token string, opts ...Option) (*Record, error)

ListTools lists the server's tools.

type McpLog

type McpLog struct {
	// The time at which the log entry was recorded.
	Timestamp *string `json:"timestamp,omitempty"`
	// Human-readable summary of the log event.
	Message *string `json:"message,omitempty"`
	// The service that generated the log.
	Service *string `json:"service,omitempty"`
	// The deployment that wrote the log (`production`, `staging`,
	// `staging2`, `thoropass-production`, and per-developer preview
	// deployments). Distinct from `environment_id`, which is the Truto
	// environment the log belongs to: a single `environment_id` can be
	// served by more than one deployment, and `app_env` is what tells
	// them apart. Not an enumerated set — new deployments add values.
	AppEnv *string `json:"app_env,omitempty"`
	// The Truto environment in which the log was generated.
	EnvironmentID *string        `json:"environment_id,omitempty"`
	LogType       *McpLogLogType `json:"log_type,omitempty"`
	// Internal log messages captured during request/job processing.
	Logs []string `json:"logs,omitempty"`
	// The hostname that served the request.
	Host *string `json:"host,omitempty"`
	// The full URL of the request (with sensitive paths masked).
	HTTPURL *string `json:"http_url,omitempty"`
	// The HTTP status code of the response.
	HTTPStatusCode *int64 `json:"http_status_code,omitempty"`
	// The HTTP method of the request.
	HTTPMethod *string `json:"http_method,omitempty"`
	// The IP address of the client.
	HTTPIP *string `json:"http_ip,omitempty"`
	// The Cloudflare Ray ID for the request.
	HTTPRequestID *string `json:"http_request_id,omitempty"`
	// The country code of the client (from Cloudflare).
	HTTPCountry *string `json:"http_country,omitempty"`
	// The User-Agent header of the request.
	HTTPUseragent *string `json:"http_useragent,omitempty"`
	// The hostname portion of the request URL.
	HTTPURLDetailsHost *string `json:"http_url_details_host,omitempty"`
	// The path portion of the request URL. On `mcp` rows the token
	// segment is masked in full, so the value is always
	// `/mcp/[redacted]` and identifies nothing — use
	// `mcp_server_id` / `mcp_server_name` instead.
	HTTPURLDetailsPath *string `json:"http_url_details_path,omitempty"`
	// The parsed query string parameters of the request URL.
	HTTPURLDetailsQueryString map[string]any `json:"http_url_details_query_string,omitempty"`
	// The URL scheme.
	HTTPURLDetailsScheme *string `json:"http_url_details_scheme,omitempty"`
	// The HTTP protocol version.
	HTTPVersion *string `json:"http_version,omitempty"`
	// How the request was authenticated.
	AuthenticationType *HttpRequestFieldsAuthenticationType `json:"authentication_type,omitempty"`
	// The ID of the authenticated user, if applicable.
	UserID *string `json:"user_id,omitempty"`
	// The response headers returned to the client.
	ResponseHeaders map[string]string  `json:"response_headers,omitempty"`
	RequestType     *McpLogRequestType `json:"request_type,omitempty"`
	// Total time in milliseconds between Truto receiving the MCP request and sending the response.
	Duration *float64 `json:"duration,omitempty"`
	// Time in milliseconds spent fetching data from the upstream API while servicing the MCP request.
	FetchDuration *float64 `json:"fetch_duration,omitempty"`
	// The integrated account this MCP server is bound to.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The integration name that handled the MCP request.
	Integration *string `json:"integration,omitempty"`
	// The MCP server ID.
	MCPServerID *string `json:"mcp_server_id,omitempty"`
	// The MCP server name.
	MCPServerName *string `json:"mcp_server_name,omitempty"`
	// The MCP protocol method.
	MCPMethod *McpLogMcpMethod `json:"mcp_method,omitempty"`
	// The name of the MCP client.
	ClientName *string `json:"client_name,omitempty"`
	// The version of the MCP client.
	ClientVersion *string `json:"client_version,omitempty"`
	// The MCP tool that was called (only set for `tools/call`).
	ToolName *string `json:"tool_name,omitempty"`
	// The Truto resource backing the called tool.
	Resource *string `json:"resource,omitempty"`
	// The Truto method backing the called tool.
	Method *string `json:"method,omitempty"`
}

Log entry produced by an MCP request handled by Truto's MCP server.

type McpLogLogType

type McpLogLogType string

McpLogLogType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	McpLogLogTypeMCP McpLogLogType = "mcp"
)

Known McpLogLogType values.

type McpLogMcpMethod

type McpLogMcpMethod string

The MCP protocol method.

Values the SDK does not know about decode unchanged.

const (
	McpLogMcpMethodInitialize               McpLogMcpMethod = "initialize"
	McpLogMcpMethodNotificationsInitialized McpLogMcpMethod = "notifications/initialized"
	McpLogMcpMethodToolsList                McpLogMcpMethod = "tools/list"
	McpLogMcpMethodToolsCall                McpLogMcpMethod = "tools/call"
	McpLogMcpMethodPromptsList              McpLogMcpMethod = "prompts/list"
	McpLogMcpMethodResourcesList            McpLogMcpMethod = "resources/list"
	McpLogMcpMethodPing                     McpLogMcpMethod = "ping"
)

Known McpLogMcpMethod values.

type McpLogRequestType

type McpLogRequestType string

McpLogRequestType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	McpLogRequestTypeMCP McpLogRequestType = "mcp"
)

Known McpLogRequestType values.

type ObservabilityDestinationCreateRequest

type ObservabilityDestinationCreateRequest struct {
	EnvironmentID string                                    `json:"environment_id"`
	Type          ObservabilityDestinationCreateRequestType `json:"type"`
	Name          string                                    `json:"name"`
	IsActive      *bool                                     `json:"is_active,omitempty"`
	Config        map[string]any                            `json:"config"`
	// Secret bag stored as a single encrypted JSON blob. Use `api_key` for Datadog, `token` for Splunk HEC, `client_secret` for Microsoft Sentinel, `token` or `username` + `password` for OTLP, `api_key` or `username` + `password` for Elasticsearch, and `access_key_id` + `secret_access_key` for S3. Never returned by the API.
	Secrets map[string]string `json:"secrets,omitempty"`
}

ObservabilityDestinationCreateRequest is a Truto API object.

type ObservabilityDestinationCreateRequestType

type ObservabilityDestinationCreateRequestType string

ObservabilityDestinationCreateRequestType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	ObservabilityDestinationCreateRequestTypeDatadog       ObservabilityDestinationCreateRequestType = "datadog"
	ObservabilityDestinationCreateRequestTypeSplunkHec     ObservabilityDestinationCreateRequestType = "splunk_hec"
	ObservabilityDestinationCreateRequestTypeSentinel      ObservabilityDestinationCreateRequestType = "sentinel"
	ObservabilityDestinationCreateRequestTypeOTLP          ObservabilityDestinationCreateRequestType = "otlp"
	ObservabilityDestinationCreateRequestTypeElasticsearch ObservabilityDestinationCreateRequestType = "elasticsearch"
	ObservabilityDestinationCreateRequestTypeS3            ObservabilityDestinationCreateRequestType = "s3"
)

Known ObservabilityDestinationCreateRequestType values.

type ObservabilityDestinationResponse

type ObservabilityDestinationResponse struct {
	// The ID of the observability destination.
	ID string `json:"id"`
	// The environment whose logs are forwarded.
	EnvironmentID string `json:"environment_id"`
	// Destination type.
	Type ObservabilityDestinationResponseType `json:"type"`
	// Human-readable destination name.
	Name string `json:"name"`
	// Whether forwarding is enabled.
	IsActive bool `json:"is_active"`
	// Non-secret destination configuration. Datadog: `site`, `tags`. Splunk HEC: `hec_url`, `index`, `source`, `sourcetype`. Microsoft Sentinel: `tenant_id`, `client_id`, `dce_endpoint`, `dcr_immutable_id`, `stream_name`, `cloud`. OTLP: `endpoint`, `resource_attributes`. Elasticsearch: `url`, `index`, `pipeline`. S3: `bucket`, `region`, `endpoint` (S3-compatible storage such as GCS or R2), `prefix`. All types accept a `log_types` filter.
	Config    map[string]any `json:"config"`
	CreatedAt string         `json:"created_at"`
	UpdatedAt string         `json:"updated_at"`
}

ObservabilityDestinationResponse is a Truto API object.

type ObservabilityDestinationResponseType

type ObservabilityDestinationResponseType string

Destination type.

Values the SDK does not know about decode unchanged.

const (
	ObservabilityDestinationResponseTypeDatadog       ObservabilityDestinationResponseType = "datadog"
	ObservabilityDestinationResponseTypeSplunkHec     ObservabilityDestinationResponseType = "splunk_hec"
	ObservabilityDestinationResponseTypeSentinel      ObservabilityDestinationResponseType = "sentinel"
	ObservabilityDestinationResponseTypeOTLP          ObservabilityDestinationResponseType = "otlp"
	ObservabilityDestinationResponseTypeElasticsearch ObservabilityDestinationResponseType = "elasticsearch"
	ObservabilityDestinationResponseTypeS3            ObservabilityDestinationResponseType = "s3"
)

Known ObservabilityDestinationResponseType values.

type ObservabilityDestinationTestRequest

type ObservabilityDestinationTestRequest struct {
	// A complete config for the destination type.
	Config  map[string]any    `json:"config,omitempty"`
	Secrets map[string]string `json:"secrets,omitempty"`
}

ObservabilityDestinationTestRequest is a Truto API object.

type ObservabilityDestinationTestResponse

type ObservabilityDestinationTestResponse struct {
	Ok     *bool    `json:"ok,omitempty"`
	Status *float64 `json:"status,omitempty"`
	Error  *string  `json:"error,omitempty"`
}

ObservabilityDestinationTestResponse is a Truto API object.

type ObservabilityDestinationUpdateRequest

type ObservabilityDestinationUpdateRequest struct {
	// Changing the type requires `config` and `secrets` for the new type in the same request.
	Type     *ObservabilityDestinationUpdateRequestType `json:"type,omitempty"`
	Name     *string                                    `json:"name,omitempty"`
	IsActive *bool                                      `json:"is_active,omitempty"`
	// Replaces the whole stored config when provided (fields are not merged), so it must be a complete config for the destination type. For example, a Datadog update must include `site` even when only `tags` change; a partial config is rejected with a 400.
	Config map[string]any `json:"config,omitempty"`
	// Secret bag stored as a single encrypted JSON blob. Replaces the stored secrets when provided, and must include the secrets the destination type requires. Never returned by the API.
	Secrets map[string]string `json:"secrets,omitempty"`
}

ObservabilityDestinationUpdateRequest is a Truto API object.

type ObservabilityDestinationUpdateRequestType

type ObservabilityDestinationUpdateRequestType string

Changing the type requires `config` and `secrets` for the new type in the same request.

Values the SDK does not know about decode unchanged.

const (
	ObservabilityDestinationUpdateRequestTypeDatadog       ObservabilityDestinationUpdateRequestType = "datadog"
	ObservabilityDestinationUpdateRequestTypeSplunkHec     ObservabilityDestinationUpdateRequestType = "splunk_hec"
	ObservabilityDestinationUpdateRequestTypeSentinel      ObservabilityDestinationUpdateRequestType = "sentinel"
	ObservabilityDestinationUpdateRequestTypeOTLP          ObservabilityDestinationUpdateRequestType = "otlp"
	ObservabilityDestinationUpdateRequestTypeElasticsearch ObservabilityDestinationUpdateRequestType = "elasticsearch"
	ObservabilityDestinationUpdateRequestTypeS3            ObservabilityDestinationUpdateRequestType = "s3"
)

Known ObservabilityDestinationUpdateRequestType values.

type ObservabilityDestinationsService

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

ObservabilityDestinationsService manages where Truto ships logs.

func (*ObservabilityDestinationsService) Create

Create creates an observability destination.

func (*ObservabilityDestinationsService) Delete

Delete deletes an observability destination.

func (*ObservabilityDestinationsService) Get

Get fetches an observability destination.

func (*ObservabilityDestinationsService) List

List returns an iterator over observability destinations.

func (*ObservabilityDestinationsService) Test

Test sends a test event to the destination, optionally with new config and secrets that are not saved.

func (*ObservabilityDestinationsService) Update

Update changes an observability destination.

type Option

type Option func(*settings)

Option configures the Client (when passed to NewClient) or a single request (when passed to any API method). Request options override client options for that call only.

func WithBaseURL

func WithBaseURL(url string) Option

WithBaseURL points the client at another Truto API host.

func WithDefaultRetryAfter

func WithDefaultRetryAfter(d time.Duration) Option

WithDefaultRetryAfter sets the wait used for a 429 response that has no usable Retry-After header.

func WithHTTPClient

func WithHTTPClient(c *http.Client) Option

WithHTTPClient sets the *http.Client used to send requests.

func WithHeader

func WithHeader(key, value string) Option

WithHeader adds a request header.

func WithMaxRetries

func WithMaxRetries(n int) Option

WithMaxRetries sets how many times a failed request is retried.

func WithNoRetry

func WithNoRetry() Option

WithNoRetry turns retries off.

func WithOnRateLimited

func WithOnRateLimited(fn func(RateLimitInfo)) Option

WithOnRateLimited registers a hook called when the API answers 429, before the client waits.

func WithOnRetry

func WithOnRetry(fn func(RetryInfo)) Option

WithOnRetry registers a hook called before each retry.

func WithQuery

func WithQuery(q Params) Option

WithQuery adds query parameters. Nested maps and slices are encoded the way the Truto API expects (filter[status]=open, ids[0]=a). Calling it more than once merges the parameters; later values win.

func WithRetryStatusCodes

func WithRetryStatusCodes(codes ...int) Option

WithRetryStatusCodes adds status codes that are retried, on top of 408, 409, 425, 429, 502, 503 and 504.

func WithTimeout

func WithTimeout(d time.Duration) Option

WithTimeout limits each attempt of a request. A timed-out attempt is not retried; the call returns an error that matches ErrTimeout.

type Page

type Page[T any] struct {
	Items []T
	// NextCursor is empty on the last page.
	NextCursor string
}

Page is one page of a list endpoint.

type Params

type Params map[string]any

Params holds query parameters. Values may be strings, numbers, booleans, nil, slices, maps, or any value that encodes to JSON.

type Passkey

type Passkey struct {
	// The unique ID of the passkey. Use this to rename or delete it.
	ID string `json:"id"`
	// User-supplied label, or `null` when the passkey was registered without one.
	Name *string `json:"name,omitempty"`
	// `multiDevice` for a synced passkey (iCloud Keychain, Google Password Manager); `singleDevice` for a device-bound one (a security key, or a platform authenticator that does not sync).
	DeviceType *string `json:"device_type,omitempty"`
	// Whether the credential is currently synced into a backup (the WebAuthn BS flag). Refreshed on every sign-in.
	BackupState bool `json:"backup_state"`
	// ISO-8601 UTC timestamp of the last successful sign-in with this passkey; `null` if it has never been used.
	LastUsedAt *string `json:"last_used_at,omitempty"`
	// ISO-8601 UTC timestamp of registration.
	CreatedAt string `json:"created_at"`
}

A registered WebAuthn credential, sanitized for display. Credential material (`credential_id`, `public_key`) is never returned.

type PasskeyAuthenticationOptions

type PasskeyAuthenticationOptions struct {
	// The environment's `APP_URL` host.
	RpID string `json:"rpId"`
	// base64url challenge. Single-use, stored server-side for 5 minutes under `handle`.
	Challenge string `json:"challenge"`
	// Always empty — sign-in is usernameless, so the browser offers whichever discoverable credential it holds for this `rpId`. Naming credentials here would leak which accounts exist.
	AllowCredentials []map[string]any                             `json:"allowCredentials"`
	Timeout          *float64                                     `json:"timeout,omitempty"`
	UserVerification PasskeyAuthenticationOptionsUserVerification `json:"userVerification"`
}

A bare `PublicKeyCredentialRequestOptionsJSON` — pass it straight to `navigator.credentials.get({ publicKey })`. Note `rpId` is flat here, unlike the nested `rp` object on registration options.

type PasskeyAuthenticationOptionsUserVerification

type PasskeyAuthenticationOptionsUserVerification string

PasskeyAuthenticationOptionsUserVerification is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	PasskeyAuthenticationOptionsUserVerificationRequired PasskeyAuthenticationOptionsUserVerification = "required"
)

Known PasskeyAuthenticationOptionsUserVerification values.

type PasskeyAuthenticationResponse

type PasskeyAuthenticationResponse struct {
	// base64url credential ID. Max 64 KB.
	ID string `json:"id"`
	// base64url credential ID. Max 64 KB.
	RawID string `json:"rawId"`
	// Always `public-key`. Max 64 characters.
	Type     string                                `json:"type"`
	Response PasskeyAuthenticationResponseResponse `json:"response"`
}

The `PublicKeyCredential` returned by `navigator.credentials.get()`, JSON-serialized (base64url). Extra fields the browser adds are accepted and ignored.

type PasskeyAuthenticationResponseResponse

type PasskeyAuthenticationResponseResponse struct {
	// base64url. Max 64 KB.
	ClientDataJSON string `json:"clientDataJSON"`
	// base64url. Max 64 KB.
	AuthenticatorData string `json:"authenticatorData"`
	// base64url. Max 64 KB.
	Signature string `json:"signature"`
	// base64url. Max 64 KB. Ignored — the credential ID resolves the user.
	UserHandle *string `json:"userHandle,omitempty"`
}

PasskeyAuthenticationResponseResponse is a Truto API object.

type PasskeyRegistrationOptions

type PasskeyRegistrationOptions struct {
	// Relying party. `id` is the environment's `APP_URL` host, so a passkey registered on one environment is never offered on another.
	Rp PasskeyRegistrationOptionsRp `json:"rp"`
	// User handle the authenticator groups credentials under. `id` is the base64url-encoded Truto user id.
	User PasskeyRegistrationOptionsUser `json:"user"`
	// base64url challenge. Single-use, stored server-side for 5 minutes.
	Challenge string `json:"challenge"`
	// Offered algorithms — Ed25519 (-8), ES256 (-7), RS256 (-257).
	PubKeyCredParams []PasskeyRegistrationOptionsPubKeyCredParamsItem `json:"pubKeyCredParams"`
	// Browser-side ceremony timeout in milliseconds.
	Timeout *float64 `json:"timeout,omitempty"`
	// v1 asks for no attestation.
	Attestation *PasskeyRegistrationOptionsAttestation `json:"attestation,omitempty"`
	// The user's existing credentials, so an authenticator they already enrolled refuses to register a duplicate.
	ExcludeCredentials []PasskeyRegistrationOptionsExcludeCredentialsItem `json:"excludeCredentials,omitempty"`
	// `residentKey: required` because sign-in is usernameless, and `userVerification: required` so every assertion carries a second factor — which is what lets a passkey login satisfy `mfa_required`.
	AuthenticatorSelection *PasskeyRegistrationOptionsAuthenticatorSelection `json:"authenticatorSelection,omitempty"`
	// Client extensions the library asks for. `credProps` lets the browser report back whether the credential really was created as discoverable.
	Extensions *PasskeyRegistrationOptionsExtensions `json:"extensions,omitempty"`
	// Always empty — v1 gives the browser no authenticator hints.
	Hints []string `json:"hints,omitempty"`
}

A bare `PublicKeyCredentialCreationOptionsJSON` — pass it straight to `navigator.credentials.create({ publicKey })`. Serialized by `@simplewebauthn/server`; the fields below are the ones the ceremony depends on.

type PasskeyRegistrationOptionsAttestation

type PasskeyRegistrationOptionsAttestation string

v1 asks for no attestation.

Values the SDK does not know about decode unchanged.

const (
	PasskeyRegistrationOptionsAttestationNone PasskeyRegistrationOptionsAttestation = "none"
)

Known PasskeyRegistrationOptionsAttestation values.

type PasskeyRegistrationOptionsAuthenticatorSelection

type PasskeyRegistrationOptionsAuthenticatorSelection struct {
	ResidentKey        *string `json:"residentKey,omitempty"`
	RequireResidentKey *bool   `json:"requireResidentKey,omitempty"`
	UserVerification   *string `json:"userVerification,omitempty"`
}

`residentKey: required` because sign-in is usernameless, and `userVerification: required` so every assertion carries a second factor — which is what lets a passkey login satisfy `mfa_required`.

type PasskeyRegistrationOptionsExcludeCredentialsItem

type PasskeyRegistrationOptionsExcludeCredentialsItem struct {
	ID         *string  `json:"id,omitempty"`
	Type       *string  `json:"type,omitempty"`
	Transports []string `json:"transports,omitempty"`
}

PasskeyRegistrationOptionsExcludeCredentialsItem is a Truto API object.

type PasskeyRegistrationOptionsExtensions

type PasskeyRegistrationOptionsExtensions struct {
	CredProps *bool `json:"credProps,omitempty"`
}

Client extensions the library asks for. `credProps` lets the browser report back whether the credential really was created as discoverable.

type PasskeyRegistrationOptionsPubKeyCredParamsItem

type PasskeyRegistrationOptionsPubKeyCredParamsItem struct {
	Alg  *float64 `json:"alg,omitempty"`
	Type *string  `json:"type,omitempty"`
}

PasskeyRegistrationOptionsPubKeyCredParamsItem is a Truto API object.

type PasskeyRegistrationOptionsRp

type PasskeyRegistrationOptionsRp struct {
	ID   *string `json:"id,omitempty"`
	Name *string `json:"name,omitempty"`
}

Relying party. `id` is the environment's `APP_URL` host, so a passkey registered on one environment is never offered on another.

type PasskeyRegistrationOptionsUser

type PasskeyRegistrationOptionsUser struct {
	ID          *string `json:"id,omitempty"`
	Name        *string `json:"name,omitempty"`
	DisplayName *string `json:"displayName,omitempty"`
}

User handle the authenticator groups credentials under. `id` is the base64url-encoded Truto user id.

type PasskeyRegistrationResponse

type PasskeyRegistrationResponse struct {
	// base64url credential ID. Max 64 KB.
	ID string `json:"id"`
	// base64url credential ID. Max 64 KB.
	RawID string `json:"rawId"`
	// Always `public-key`. Max 64 characters.
	Type     string                              `json:"type"`
	Response PasskeyRegistrationResponseResponse `json:"response"`
}

The `PublicKeyCredential` returned by `navigator.credentials.create()`, JSON-serialized (base64url). Extra fields the browser adds (`clientExtensionResults`, `authenticatorAttachment`) are accepted and ignored.

type PasskeyRegistrationResponseResponse

type PasskeyRegistrationResponseResponse struct {
	// base64url. Max 64 KB.
	ClientDataJSON string `json:"clientDataJSON"`
	// base64url. Max 64 KB.
	AttestationObject string `json:"attestationObject"`
	// Transport hints reported by the authenticator. Max 16 entries of 64 characters each.
	Transports []string `json:"transports,omitempty"`
}

PasskeyRegistrationResponseResponse is a Truto API object.

type Ping

type Ping struct {
	// Always returns the string `pong` when the API is reachable.
	Message *string `json:"message,omitempty"`
}

Health check response for the Truto API.

type ProxyAPIService

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

ProxyAPIService calls the Proxy API: the integration's own resources and fields, with Truto handling auth and pagination.

func (*ProxyAPIService) Create

func (s *ProxyAPIService) Create(ctx context.Context, r ProxyResource, body any, opts ...Option) (*Record, error)

Create creates a record.

func (*ProxyAPIService) CustomMethod

func (s *ProxyAPIService) CustomMethod(ctx context.Context, r ProxyResource, method string, body any, opts ...Option) (*Record, error)

CustomMethod calls a non-CRUD method of the resource (POST /proxy/{resource}/{method}). body may be nil.

func (*ProxyAPIService) Delete

func (s *ProxyAPIService) Delete(ctx context.Context, r ProxyResource, id string, opts ...Option) (*Record, error)

Delete deletes a record.

func (*ProxyAPIService) Get

func (s *ProxyAPIService) Get(ctx context.Context, r ProxyResource, id string, opts ...Option) (*Record, error)

Get fetches one record.

func (*ProxyAPIService) List

func (s *ProxyAPIService) List(ctx context.Context, r ProxyResource, opts ...Option) *Iterator[Record]

List returns an iterator over the resource.

func (*ProxyAPIService) Update

func (s *ProxyAPIService) Update(ctx context.Context, r ProxyResource, id string, body any, opts ...Option) (*Record, error)

Update changes a record.

type ProxyResource

type ProxyResource struct {
	// Resource is the integration's own resource name, e.g. "contacts".
	Resource string
	// IntegratedAccountID is the account to call. Sent as a query parameter.
	IntegratedAccountID string
}

ProxyResource identifies a proxy API resource for one integrated account.

type RapidBridgeLog

type RapidBridgeLog struct {
	// The time at which the log entry was recorded.
	Timestamp *string `json:"timestamp,omitempty"`
	// Human-readable summary of the log event.
	Message *string `json:"message,omitempty"`
	// The service that generated the log.
	Service *string `json:"service,omitempty"`
	// The deployment that wrote the log (`production`, `staging`,
	// `staging2`, `thoropass-production`, and per-developer preview
	// deployments). Distinct from `environment_id`, which is the Truto
	// environment the log belongs to: a single `environment_id` can be
	// served by more than one deployment, and `app_env` is what tells
	// them apart. Not an enumerated set — new deployments add values.
	AppEnv *string `json:"app_env,omitempty"`
	// The Truto environment in which the log was generated.
	EnvironmentID *string                `json:"environment_id,omitempty"`
	LogType       *RapidBridgeLogLogType `json:"log_type,omitempty"`
	// Internal log messages captured during request/job processing.
	Logs []string `json:"logs,omitempty"`
	// The Durable Object class that emitted the log.
	DurableObject *RapidBridgeLogDurableObject `json:"durable_object,omitempty"`
	// The integrated account the sync job is running against.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The integration the sync job is running against.
	Integration *string `json:"integration,omitempty"`
	// The sync job that was triggered.
	SyncJobID *string `json:"sync_job_id,omitempty"`
	// The specific sync job run.
	SyncJobRunID *string `json:"sync_job_run_id,omitempty"`
	// The lifecycle event being logged for the sync job run. This is
	// the field that carries run outcome on this log type — there is
	// no `status` field on these rows.
	SyncJobRunEvent *string `json:"sync_job_run_event,omitempty"`
	// The sync-job runtime version that produced the run.
	Version *int64 `json:"version,omitempty"`
	// The resource this sync step fetched or transformed.
	Resource *string `json:"resource,omitempty"`
	// Ambiguous by design — this stream is written by two loggers.
	// On a row emitted by the Durable Object's own logger (the
	// `fetch` entrypoint) this is the **HTTP verb** the object was
	// invoked with (`PUT`, `DELETE`). On a per-request row (the bulk
	// of the stream) it is the **Truto method** executed by that sync
	// step (`list`, `get`, `create`, ...), and is paired with
	// `resource`. Rows emitted by the alarm entrypoint carry no
	// `method` at all.
	Method *string `json:"method,omitempty"`
	// The number of records produced by this sync step.
	NumRecords *int64 `json:"num_records,omitempty"`
	// Time in milliseconds spent fetching data from the upstream API for this sync step.
	FetchDuration *float64 `json:"fetch_duration,omitempty"`
	// When the sync job was triggered by a webhook, the originating webhook ID.
	WebhookID *string `json:"webhook_id,omitempty"`
	// The HTTP status code returned when the sync job posted to its
	// configured webhook. Unrelated to the outcome of the run itself.
	WebhookStatus *int64 `json:"webhook_status,omitempty"`
}

Log entry produced by a RapidBridge sync job run. These logs come from Durable Objects that drive sync jobs (rather than from inbound HTTP requests).

type RapidBridgeLogDurableObject

type RapidBridgeLogDurableObject string

The Durable Object class that emitted the log.

Values the SDK does not know about decode unchanged.

const (
	RapidBridgeLogDurableObjectSyncJobRun RapidBridgeLogDurableObject = "sync_job_run"
)

Known RapidBridgeLogDurableObject values.

type RapidBridgeLogLogType

type RapidBridgeLogLogType string

RapidBridgeLogLogType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	RapidBridgeLogLogTypeRapidBridge RapidBridgeLogLogType = "rapid_bridge"
)

Known RapidBridgeLogLogType values.

type RateLimitInfo

type RateLimitInfo struct {
	// RetryAfter is how long the client waits, from the Retry-After header.
	RetryAfter time.Duration
	// RetryCount is the number of retries already made for this request.
	RetryCount int
}

RateLimitInfo is passed to the OnRateLimited hook when the API answers 429.

type RawResponse

type RawResponse struct {
	StatusCode  int
	ContentType string
	Body        []byte
}

RawResponse is a response returned as bytes, for endpoints that may answer with something other than JSON (files, CSV, HTML).

type Record

type Record map[string]any

Record is a JSON object whose shape depends on the integration or resource: unified, proxy and custom API results, and resources the API spec does not describe. Use Decode to turn it into your own type.

type RecordService

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

RecordService is a CRUD service for resources the API spec does not describe yet; items are Records. Use Decode for your own types.

func (*RecordService) Create

func (s *RecordService) Create(ctx context.Context, body Record, opts ...Option) (*Record, error)

Create creates an item.

func (*RecordService) Delete

func (s *RecordService) Delete(ctx context.Context, id string, opts ...Option) (*Record, error)

Delete deletes an item.

func (*RecordService) Get

func (s *RecordService) Get(ctx context.Context, id string, opts ...Option) (*Record, error)

Get fetches one item by ID.

func (*RecordService) List

func (s *RecordService) List(ctx context.Context, opts ...Option) *Iterator[Record]

List returns an iterator over the items.

func (*RecordService) Update

func (s *RecordService) Update(ctx context.Context, id string, body Record, opts ...Option) (*Record, error)

Update changes an item.

type RemoteErrorResponseSchema

type RemoteErrorResponseSchema struct {
	StatusCode int64   `json:"statusCode"`
	Error      *string `json:"error,omitempty"`
	// The human text pulled out of the provider's own error body.
	Message string `json:"message"`
	// `true` when the third-party API produced this error. When absent or `false`, Truto
	// rejected the request before it left the edge.
	TrutoIsRemoteError *bool `json:"truto_is_remote_error,omitempty"`
	// The integration's error body, verbatim and uninterpreted. An object for a JSON body, a
	// string for a plain-text or HTML one. Present on every remote error.
	RawResponse       any                      `json:"raw_response,omitempty"`
	TrutoErrorInsight *TrutoErrorInsightSchema `json:"truto_error_insight,omitempty"`
}

The body Truto returns when a **third-party API** refused the call, rather than Truto itself. Identified by `truto_is_remote_error`.

type RetryInfo

type RetryInfo struct {
	// RetryCount is the number of the retry about to happen, starting at 1.
	RetryCount int
	// StatusCode is the status that triggered the retry, or 0 for a network error.
	StatusCode int
	// Wait is how long the client sleeps before retrying.
	Wait time.Duration
}

RetryInfo is passed to the OnRetry hook before each retry.

type SandboxIntegratedAccountsService

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

SandboxIntegratedAccountsService manages sandbox integrated accounts.

func (*SandboxIntegratedAccountsService) Create

func (s *SandboxIntegratedAccountsService) Create(ctx context.Context, body Record, opts ...Option) (*Record, error)

Create creates an item.

func (*SandboxIntegratedAccountsService) Delete

func (s *SandboxIntegratedAccountsService) Delete(ctx context.Context, id string, opts ...Option) (*Record, error)

Delete deletes an item.

func (*SandboxIntegratedAccountsService) Get

Get fetches one item by ID.

func (*SandboxIntegratedAccountsService) List

List returns an iterator over the items. Filter with WithQuery.

type ScimGroupResponse

type ScimGroupResponse struct {
	// The ID of the SCIM group.
	ID *string `json:"id,omitempty"`
	// The ID of the team that owns this SCIM group.
	TeamID *string `json:"team_id,omitempty"`
	// The group's identifier in the upstream identity provider.
	ExternalID *string `json:"external_id,omitempty"`
	// The human-readable name of the group, as pushed by the IdP.
	DisplayName *string `json:"display_name,omitempty"`
	// Number of users currently in this group.
	MemberCount *float64 `json:"member_count,omitempty"`
	// The date and time when the group was first provisioned.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the group was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

ScimGroupResponse is a Truto API object.

type ScimTokenResponse

type ScimTokenResponse struct {
	// The ID of the SCIM token.
	ID *string `json:"id,omitempty"`
	// The ID of the team that owns this SCIM token.
	TeamID *string `json:"team_id,omitempty"`
	// A descriptive name for the SCIM token.
	Name *string `json:"name,omitempty"`
	// The ID of the user who created this token.
	CreatedBy *string `json:"created_by,omitempty"`
	// The date and time the IdP last authenticated against /scim/v2 with this token. Null if never used.
	LastUsedAt *string `json:"last_used_at,omitempty"`
	// The date and time when the token was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the token was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

ScimTokenResponse is a Truto API object.

type SessionTokenDeleteRequest

type SessionTokenDeleteRequest struct {
	// The tenant whose sessions should be revoked.
	TenantID string `json:"tenant_id"`
	// The environment to revoke in. Required for user-session auth. Defaults to the API token's own environment for API-token auth.
	EnvironmentID *string `json:"environment_id,omitempty"`
}

SessionTokenDeleteRequest is a Truto API object.

type SessionTokenDeleteResponse

type SessionTokenDeleteResponse struct {
	// How many live sessions were revoked. Zero when the tenant had none.
	RevokedCount *int64 `json:"revoked_count,omitempty"`
}

SessionTokenDeleteResponse is a Truto API object.

type SessionTokenMeResponse

type SessionTokenMeResponse struct {
	// Which kind of credential this is. `tenant` is a session token minted by `POST /session-token` — the credential this resource is named for. `api_token` is an admin API key, and `session` is a signed-in dashboard user, neither of which is a session token in the sense used here. An integrated-account token never appears: it cannot reach this route at all (see the `403` below).
	Type SessionTokenMeResponseType `json:"type"`
	// The subject the credential resolves to — the tenant id when `type` is `tenant`, otherwise the API token id or the user id.
	ID string `json:"id"`
	// Session tokens only. What this session is confined to.
	Scope *SessionTokenMeResponseScope `json:"scope,omitempty"`
	// Session tokens only. When the session was minted.
	IssuedAt *string `json:"issued_at,omitempty"`
	// Session tokens only. Moves forward on every renewal.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// Session tokens only. Fixed at mint time.
	MaxLifetimeAt *string `json:"max_lifetime_at,omitempty"`
	// Session tokens only. Whether `POST /session-token/renew` will work.
	IsRefreshable *bool `json:"is_refreshable,omitempty"`
	// Session tokens only. The credential that minted this session.
	Issuer *SessionTokenMeResponseIssuer `json:"issuer,omitempty"`
	// Session tokens only. How many origins govern this session. The list itself is never returned. Zero means nothing may frame the widget.
	AllowedOriginsCount *int64 `json:"allowed_origins_count,omitempty"`
	// Session tokens only. The name of the team that owns the environment — what the connect flow falls back to when the Link UI has no `brand_name`, so the widget can name the same party when it tells an end user who to contact.
	TeamName *string `json:"team_name,omitempty"`
	// Session tokens only. The environment's resolved connections configuration — the same answer every server-side gate uses.
	Capabilities *SessionTokenMeResponseCapabilities `json:"capabilities,omitempty"`
	// Session tokens only. The environment's presentation defaults for the catalog. Not a security boundary — the SDK may override them per embed and the end user may change them in the widget's own toolbar — but they belong to the environment, so they arrive with the session rather than being guessed client-side.
	Layout *SessionTokenMeResponseLayout `json:"layout,omitempty"`
}

SessionTokenMeResponse is a Truto API object.

type SessionTokenMeResponseCapabilities

type SessionTokenMeResponseCapabilities struct {
	// Whether the widget may start a new connection.
	AllowConnect *bool `json:"allow_connect,omitempty"`
	// Whether the widget may reconnect an existing account.
	AllowReauth *bool `json:"allow_reauth,omitempty"`
	// Whether the widget may refresh an account's credentials.
	AllowRefresh *bool `json:"allow_refresh,omitempty"`
	// Whether the widget may remove a connection.
	AllowDelete *bool `json:"allow_delete,omitempty"`
	// Whether one tenant may hold more than one account per integration.
	AllowMultiplePerIntegration *bool `json:"allow_multiple_per_integration,omitempty"`
	// Whether raw upstream error details are included in the widget's connection reads.
	ShowErrorDetails *bool `json:"show_error_details,omitempty"`
	// Whether the widget may reopen an existing connection's post-connect form via `POST /integrated-account/form-token`.
	AllowConfigure *bool `json:"allow_configure,omitempty"`
}

Session tokens only. The environment's resolved connections configuration — the same answer every server-side gate uses.

type SessionTokenMeResponseIssuer

type SessionTokenMeResponseIssuer struct {
	Type *SessionTokenMeResponseIssuerType `json:"type,omitempty"`
	ID   *string                           `json:"id,omitempty"`
}

Session tokens only. The credential that minted this session.

type SessionTokenMeResponseIssuerType

type SessionTokenMeResponseIssuerType string

SessionTokenMeResponseIssuerType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	SessionTokenMeResponseIssuerTypeAPIToken SessionTokenMeResponseIssuerType = "api_token"
	SessionTokenMeResponseIssuerTypeSession  SessionTokenMeResponseIssuerType = "session"
)

Known SessionTokenMeResponseIssuerType values.

type SessionTokenMeResponseLayout

type SessionTokenMeResponseLayout struct {
	// Which catalog layout the widget opens in.
	DefaultView *SessionTokenMeResponseLayoutDefaultView `json:"default_view,omitempty"`
	// How the catalog is grouped when it opens.
	DefaultGroupBy *SessionTokenMeResponseLayoutDefaultGroupBy `json:"default_group_by,omitempty"`
	// Whether the catalog's search box is shown. A catalog small enough not to need it hides the toolbar anyway.
	ShowSearch *bool `json:"show_search,omitempty"`
}

Session tokens only. The environment's presentation defaults for the catalog. Not a security boundary — the SDK may override them per embed and the end user may change them in the widget's own toolbar — but they belong to the environment, so they arrive with the session rather than being guessed client-side.

type SessionTokenMeResponseLayoutDefaultGroupBy

type SessionTokenMeResponseLayoutDefaultGroupBy string

How the catalog is grouped when it opens.

Values the SDK does not know about decode unchanged.

const (
	SessionTokenMeResponseLayoutDefaultGroupByNone     SessionTokenMeResponseLayoutDefaultGroupBy = "none"
	SessionTokenMeResponseLayoutDefaultGroupByCategory SessionTokenMeResponseLayoutDefaultGroupBy = "category"
	SessionTokenMeResponseLayoutDefaultGroupByStatus   SessionTokenMeResponseLayoutDefaultGroupBy = "status"
)

Known SessionTokenMeResponseLayoutDefaultGroupBy values.

type SessionTokenMeResponseLayoutDefaultView

type SessionTokenMeResponseLayoutDefaultView string

Which catalog layout the widget opens in.

Values the SDK does not know about decode unchanged.

const (
	SessionTokenMeResponseLayoutDefaultViewCards SessionTokenMeResponseLayoutDefaultView = "cards"
	SessionTokenMeResponseLayoutDefaultViewList  SessionTokenMeResponseLayoutDefaultView = "list"
)

Known SessionTokenMeResponseLayoutDefaultView values.

type SessionTokenMeResponseScope

type SessionTokenMeResponseScope struct {
	TenantID      *string `json:"tenant_id,omitempty"`
	EnvironmentID *string `json:"environment_id,omitempty"`
}

Session tokens only. What this session is confined to.

type SessionTokenMeResponseType

type SessionTokenMeResponseType string

Which kind of credential this is. `tenant` is a session token minted by `POST /session-token` — the credential this resource is named for. `api_token` is an admin API key, and `session` is a signed-in dashboard user, neither of which is a session token in the sense used here. An integrated-account token never appears: it cannot reach this route at all (see the `403` below).

Values the SDK does not know about decode unchanged.

const (
	SessionTokenMeResponseTypeTenant   SessionTokenMeResponseType = "tenant"
	SessionTokenMeResponseTypeAPIToken SessionTokenMeResponseType = "api_token"
	SessionTokenMeResponseTypeSession  SessionTokenMeResponseType = "session"
)

Known SessionTokenMeResponseType values.

type SessionTokenRenewResponse

type SessionTokenRenewResponse struct {
	// The same secret that was sent in. Renewal does not rotate it.
	SessionToken *string `json:"session_token,omitempty"`
	// The new expiry.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// Unchanged from when the session was minted.
	MaxLifetimeAt *string `json:"max_lifetime_at,omitempty"`
}

SessionTokenRenewResponse is a Truto API object.

type SessionTokenRequest

type SessionTokenRequest struct {
	// The tenant this session is scoped to. The tenant must already exist in the environment unless `create_tenant_if_missing` is true.
	TenantID string `json:"tenant_id"`
	// The environment the tenant belongs to. Required for user-session auth. Defaults to the API token's own environment for API-token auth.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// Seconds until the token expires. Clamped to `max_lifetime` when that is smaller.
	ExpiresIn *int64 `json:"expires_in,omitempty"`
	// Whether `POST /session-token/renew` may slide this token forward. A non-refreshable session must be re-minted instead.
	IsRefreshable *bool `json:"is_refreshable,omitempty"`
	// Seconds from issue until the absolute ceiling on this session. Renewal can never extend past it.
	MaxLifetime *int64 `json:"max_lifetime,omitempty"`
	// Narrows the environment's allowed origins for this session only. Intersected with the environment's list — entries it does not already allow are dropped. Omit to inherit the environment's list.
	AllowedOrigins []string `json:"allowed_origins,omitempty"`
	// Create the tenant when it does not exist yet, instead of failing with `404`. Useful for first-run customers whose tenant row has not materialized.
	CreateTenantIfMissing *bool `json:"create_tenant_if_missing,omitempty"`
}

SessionTokenRequest is a Truto API object.

type SessionTokenResponse

type SessionTokenResponse struct {
	// The session token. Send it in the `Authorization` header as a bearer token.
	SessionToken *string `json:"session_token,omitempty"`
	// When this token stops authenticating unless it is renewed.
	ExpiresAt *string `json:"expires_at,omitempty"`
	// The absolute ceiling. No renewal can carry the session past this.
	MaxLifetimeAt *string `json:"max_lifetime_at,omitempty"`
}

SessionTokenResponse is a Truto API object.

type SessionTokensService

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

SessionTokensService manages short-lived session tokens scoped to a tenant.

func (*SessionTokensService) Create

Create mints a session token.

func (*SessionTokensService) Me

Me describes the credential the client is authenticated with.

func (*SessionTokensService) Renew

Renew renews the session token the client is authenticated with.

func (*SessionTokensService) Revoke

Revoke revokes the session tokens that match body.

type SsoConnectionResponse

type SsoConnectionResponse struct {
	// The ID of the SSO connection.
	ID *string `json:"id,omitempty"`
	// The ID of the team that owns this SSO connection.
	TeamID *string `json:"team_id,omitempty"`
	// The SSO protocol used by this connection.
	Protocol *SsoConnectionResponseProtocol `json:"protocol,omitempty"`
	// Whether this SSO connection is active.
	IsActive *bool `json:"is_active,omitempty"`
	// Whether SSO login is enforced for users on the connection's verified domains.
	Enforced *bool `json:"enforced,omitempty"`
	// Whether this is the team's default SSO connection.
	IsDefault *bool `json:"is_default,omitempty"`
	// Non-secret protocol settings. Secret values (the OIDC client secret and SAML SP keys) are never returned.
	Config *SsoConnectionResponseConfig `json:"config,omitempty"`
	// The role assigned to users provisioned through this connection.
	DefaultRole *string `json:"default_role,omitempty"`
	// Environment IDs that provisioned users are granted access to by default.
	DefaultEnvironmentIDs []string `json:"default_environment_ids,omitempty"`
	// The date and time when the SSO connection was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the SSO connection was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

SsoConnectionResponse is a Truto API object.

type SsoConnectionResponseConfig

type SsoConnectionResponseConfig struct {
	// SAML IdP entity ID.
	IdpEntityID *string `json:"idp_entity_id,omitempty"`
	// SAML IdP single sign-on URL.
	IdpSSOURL *string `json:"idp_sso_url,omitempty"`
	// SAML IdP X.509 signing certificate (PEM).
	IdpX509Cert *string `json:"idp_x509_cert,omitempty"`
	// OIDC issuer URL.
	Issuer *string `json:"issuer,omitempty"`
	// OIDC relying-party client ID.
	ClientID *string `json:"client_id,omitempty"`
	// OIDC discovery document URL.
	DiscoveryURL *string `json:"discovery_url,omitempty"`
	// SAML only — sign SP-initiated AuthnRequests with the SP key (HTTP-Redirect binding).
	SignAuthnRequests *bool `json:"sign_authn_requests,omitempty"`
	// SAML only — accept unsolicited (IdP-initiated) responses at the ACS. Defaults to false (unsolicited responses rejected) when omitted.
	AllowIdpInitiated *bool `json:"allow_idp_initiated,omitempty"`
}

Non-secret protocol settings. Secret values (the OIDC client secret and SAML SP keys) are never returned.

type SsoConnectionResponseProtocol

type SsoConnectionResponseProtocol string

The SSO protocol used by this connection.

Values the SDK does not know about decode unchanged.

const (
	SsoConnectionResponseProtocolSaml SsoConnectionResponseProtocol = "saml"
	SsoConnectionResponseProtocolOidc SsoConnectionResponseProtocol = "oidc"
)

Known SsoConnectionResponseProtocol values.

type SsoDomainResponse

type SsoDomainResponse struct {
	// The ID of the team that owns this domain.
	TeamID *string `json:"team_id,omitempty"`
	// The email domain associated with the SSO connection.
	Domain *string `json:"domain,omitempty"`
	// The ID of the SSO connection this domain belongs to.
	SSOConnectionID *string `json:"sso_connection_id,omitempty"`
	// Whether this domain has been verified via the DNS TXT challenge.
	Verified *bool `json:"verified,omitempty"`
	// The DNS TXT challenge token. Publish a TXT record `truto-domain-verification=<verification_token>` on the domain, then call the verify endpoint.
	VerificationToken *string `json:"verification_token,omitempty"`
	// The date and time when the domain was added.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the domain was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

SsoDomainResponse is a Truto API object.

type StaticGateCreateRequest

type StaticGateCreateRequest struct {
	// A descriptive name for the static gate.
	Name string `json:"name"`
	// The domain this static gate will proxy requests for.
	Domain string `json:"domain"`
	// The ID of the environment this static gate will be scoped to.
	EnvironmentID string `json:"environment_id"`
	// Optional API token secret. If not provided, one will be generated automatically.
	APITokenSecret *string `json:"api_token_secret,omitempty"`
}

StaticGateCreateRequest is a Truto API object.

type StaticGateCreateResponse

type StaticGateCreateResponse struct {
	// The ID of the static gate.
	ID string `json:"id"`
	// A descriptive name for the static gate.
	Name string `json:"name"`
	// The domain this static gate will proxy requests for.
	Domain string `json:"domain"`
	// The ID of the user who created this static gate.
	CreatedBy *string `json:"created_by,omitempty"`
	// The ID of the environment this static gate is scoped to.
	EnvironmentID string `json:"environment_id"`
	// The date and time when the static gate was created.
	CreatedAt string `json:"created_at"`
	// The date and time when the static gate was last updated.
	UpdatedAt string `json:"updated_at"`
	// The generated API token for this static gate.
	APIToken *string `json:"api_token,omitempty"`
}

StaticGateCreateResponse is a Truto API object.

type StaticGateResponse

type StaticGateResponse struct {
	// The ID of the static gate.
	ID string `json:"id"`
	// A descriptive name for the static gate.
	Name string `json:"name"`
	// The domain this static gate will proxy requests for.
	Domain string `json:"domain"`
	// The ID of the user who created this static gate.
	CreatedBy *string `json:"created_by,omitempty"`
	// The ID of the environment this static gate is scoped to.
	EnvironmentID string `json:"environment_id"`
	// The date and time when the static gate was created.
	CreatedAt string `json:"created_at"`
	// The date and time when the static gate was last updated.
	UpdatedAt string `json:"updated_at"`
}

StaticGateResponse is a Truto API object.

type StaticGateUpdateRequest

type StaticGateUpdateRequest struct {
	// A descriptive name for the static gate.
	Name *string `json:"name,omitempty"`
	// The domain this static gate will proxy requests for.
	Domain *string `json:"domain,omitempty"`
}

StaticGateUpdateRequest is a Truto API object.

type StaticGatesService

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

StaticGatesService manages static gates.

func (*StaticGatesService) Create

Create creates an item.

func (*StaticGatesService) Delete

func (s *StaticGatesService) Delete(ctx context.Context, id string, opts ...Option) (*DeleteResponse, error)

Delete deletes an item.

func (*StaticGatesService) Get

Get fetches one item by ID.

func (*StaticGatesService) List

List returns an iterator over the items. Filter with WithQuery.

func (*StaticGatesService) Update

Update changes an item. Only the fields that are set are sent.

type SyncJobArgsSchemaSchema

type SyncJobArgsSchemaSchema struct {
	Type JsonSchemaObjectType `json:"type"`
	Ref  *string              `json:"$ref,omitempty"`
	// Map of property name → `JsonSchemaObjectProperties`.
	Properties           map[string]JsonSchemaObjectProperties `json:"properties"`
	Description          *string                               `json:"description,omitempty"`
	Required             *bool                                 `json:"required,omitempty"`
	Default              any                                   `json:"default,omitempty"`
	AdditionalProperties *bool                                 `json:"additionalProperties,omitempty"`
}

Top-level JSON Schema object used by Truto's unified-model resource definitions.

type SyncJobCreateRequest

type SyncJobCreateRequest struct {
	// The name of the integration that this sync job interacts with.
	IntegrationName string                   `json:"integration_name"`
	ArgsSchema      *SyncJobArgsSchemaSchema `json:"args_schema,omitempty"`
	Resources       []SyncJobResourceSchema  `json:"resources"`
}

SyncJobCreateRequest is a Truto API object.

type SyncJobCronTriggerCreateRequest

type SyncJobCronTriggerCreateRequest struct {
	// The ID of the sync job to run.
	SyncJobID string `json:"sync_job_id"`
	// The arguments passed to the sync job run.
	Args map[string]any `json:"args,omitempty"`
	// The ID of the integrated account that this sync job run belongs to.
	IntegratedAccountID string `json:"integrated_account_id"`
	// The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	DaemonGroupKey *string `json:"daemon_group_key,omitempty"`
	// The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	WebhookID *string `json:"webhook_id,omitempty"`
	// The cron expression that defines when the sync job should be run. The timezone used is UTC. Runs must be at least 5 minutes apart. When the trigger is saved, the gap between its next two runs is checked.
	CronExpression string `json:"cron_expression"`
}

SyncJobCronTriggerCreateRequest is a Truto API object.

type SyncJobCronTriggerLog

type SyncJobCronTriggerLog struct {
	// The time at which the log entry was recorded.
	Timestamp *string `json:"timestamp,omitempty"`
	// Human-readable summary of the log event.
	Message *string `json:"message,omitempty"`
	// The service that generated the log.
	Service *string `json:"service,omitempty"`
	// The deployment that wrote the log (`production`, `staging`,
	// `staging2`, `thoropass-production`, and per-developer preview
	// deployments). Distinct from `environment_id`, which is the Truto
	// environment the log belongs to: a single `environment_id` can be
	// served by more than one deployment, and `app_env` is what tells
	// them apart. Not an enumerated set — new deployments add values.
	AppEnv *string `json:"app_env,omitempty"`
	// The Truto environment in which the log was generated.
	EnvironmentID *string                       `json:"environment_id,omitempty"`
	LogType       *SyncJobCronTriggerLogLogType `json:"log_type,omitempty"`
	// Internal log messages captured during request/job processing.
	Logs []string `json:"logs,omitempty"`
	// The alarm classifier emitted by the underlying Durable Object.
	AlarmType *SyncJobCronTriggerLogAlarmType `json:"alarm_type,omitempty"`
	// The sync job cron trigger whose alarm fired.
	EntityID *string `json:"entity_id,omitempty"`
	// The status Truto returned for the internal alarm delivery. `200` means the tick was accepted and a sync job run was created.
	HTTPStatusCode *int64 `json:"http_status_code,omitempty"`
	// The HTTP method of the internal alarm delivery. Always `POST`.
	HTTPMethod *string `json:"http_method,omitempty"`
	// Time in milliseconds Truto spent handling the alarm tick.
	Duration *float64 `json:"duration,omitempty"`
}

Log entry produced when a sync job's cron alarm fires (one row per scheduled sync trigger). The Alarm Durable Object delivers the tick as an inbound `POST /alarm`, so these rows also carry the HTTP fields of that internal call — `http_status_code` reflects whether Truto accepted the tick, not anything about the upstream integration.

type SyncJobCronTriggerLogAlarmType

type SyncJobCronTriggerLogAlarmType string

The alarm classifier emitted by the underlying Durable Object.

Values the SDK does not know about decode unchanged.

const (
	SyncJobCronTriggerLogAlarmTypeSyncJobCronTrigger SyncJobCronTriggerLogAlarmType = "sync_job_cron_trigger"
)

Known SyncJobCronTriggerLogAlarmType values.

type SyncJobCronTriggerLogLogType

type SyncJobCronTriggerLogLogType string

SyncJobCronTriggerLogLogType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	SyncJobCronTriggerLogLogTypeSyncJobCronTrigger SyncJobCronTriggerLogLogType = "sync_job_cron_trigger"
)

Known SyncJobCronTriggerLogLogType values.

type SyncJobCronTriggerSchema

type SyncJobCronTriggerSchema struct {
	// The ID of the sync job cron trigger.
	ID *string `json:"id,omitempty"`
	// The arguments passed to the sync job cron trigger.
	Args      map[string]any          `json:"args,omitempty"`
	Resources []SyncJobResourceSchema `json:"resources,omitempty"`
	// The cron expression defining when the sync job should run, in UTC.
	CronExpression *string `json:"cron_expression,omitempty"`
	// The ID of the sync job that this sync job cron trigger should run.
	SyncJobID *string `json:"sync_job_id,omitempty"`
	// The ID of the integrated account that this sync job cron trigger should run.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	DaemonGroupKey *string `json:"daemon_group_key,omitempty"`
	// The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	WebhookID *string `json:"webhook_id,omitempty"`
	// The date and time when the sync job run was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the sync job run was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

SyncJobCronTriggerSchema is a Truto API object.

type SyncJobCronTriggerUpdateRequest

type SyncJobCronTriggerUpdateRequest struct {
	// The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	DaemonGroupKey *string `json:"daemon_group_key,omitempty"`
	// The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	WebhookID *string `json:"webhook_id,omitempty"`
	// The cron expression that defines when the sync job should be run. The timezone used is UTC. A new value must have runs at least 5 minutes apart; the gap between its next two runs is checked. Sending the value the trigger already has is not checked again.
	CronExpression *string `json:"cron_expression,omitempty"`
}

SyncJobCronTriggerUpdateRequest is a Truto API object.

type SyncJobCronTriggersService

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

SyncJobCronTriggersService manages cron schedules for sync jobs.

func (*SyncJobCronTriggersService) Create

Create creates a sync job cron trigger.

func (*SyncJobCronTriggersService) Delete

Delete deletes a sync job cron trigger.

func (*SyncJobCronTriggersService) Get

Get fetches a sync job cron trigger.

func (*SyncJobCronTriggersService) List

List returns an iterator over sync job cron triggers.

func (*SyncJobCronTriggersService) Schedule

func (s *SyncJobCronTriggersService) Schedule(ctx context.Context, id string, opts ...Option) (*Record, error)

Schedule (re)schedules the trigger's next run.

func (*SyncJobCronTriggersService) Update

Update changes a sync job cron trigger.

type SyncJobResourceSchema

type SyncJobResourceSchema struct {
	// The name of the resource to sync. For Unified APIs, it should be in the format `unified_api_name/resource_name`. For Proxy API, it can just be `resource_name`.
	Resource string `json:"resource"`
	// The method to call on the resource.
	Method string `json:"method"`
	// The ID of the resource to sync. This is optional and can be used to sync a single resource. It also supports placeholders.
	ID *string `json:"id,omitempty"`
	// The query parameters to pass to the resource method. It supports placeholders for values.
	Query map[string]any `json:"query,omitempty"`
	// When a particular placeholder argument is an array and you want to repeat the request for each element in that array, you can set this parameter. For example, if you accept an argument called `user_ids` which is an array of strings, and you want to fetch each user's details, you can set this parameter to `user_ids` and the request will be repeated for each element in the `user_ids` array.
	LoopOn *string `json:"loop_on,omitempty"`
	// The resource that this resource depends on (parent resource). This is optional and can be used to sync a resource only after another resource has been synced. Each object synced for the parent resource is available as the resources object in placeholders for the child resource, e.g. `{{resources.crm.contacts.id}}` if depends on is `crm/contacts` resource.
	DependsOn *string `json:"depends_on,omitempty"`
	// Whether to persist the resource in the database or not in case of a Daemon sync job run or send as a payload in case of RapidBridge sync job run. The Proxy API resources are by default NOT persisted and this parameter can be set to `true` to persist them. Unified API resources are always persisted.
	Persist *bool `json:"persist,omitempty"`
}

SyncJobResourceSchema is a Truto API object.

type SyncJobRunCreateRequest

type SyncJobRunCreateRequest struct {
	// The ID of the sync job to run.
	SyncJobID string `json:"sync_job_id"`
	// The arguments passed to the sync job run.
	Args map[string]any `json:"args,omitempty"`
	// The ID of the integrated account that this sync job run belongs to.
	IntegratedAccountID string `json:"integrated_account_id"`
	// The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	DaemonGroupKey *string `json:"daemon_group_key,omitempty"`
	// The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	WebhookID *string `json:"webhook_id,omitempty"`
	// Specify how to handle errors while running the sync job. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2. By default, `ignore` is used.
	ErrorHandling *SyncJobRunCreateRequestErrorHandling `json:"error_handling,omitempty"`
	// If your Sync Job uses `previous_run_date` placeholder for incremental sync, you can choose to ignore the previous run and run a full sync instead by setting this parameter to `true`. By default, `false` is used.
	IgnorePreviousRun *bool `json:"ignore_previous_run,omitempty"`
}

SyncJobRunCreateRequest is a Truto API object.

type SyncJobRunCreateRequestErrorHandling

type SyncJobRunCreateRequestErrorHandling string

Specify how to handle errors while running the sync job. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2. By default, `ignore` is used.

Values the SDK does not know about decode unchanged.

const (
	SyncJobRunCreateRequestErrorHandlingFailFast SyncJobRunCreateRequestErrorHandling = "fail_fast"
	SyncJobRunCreateRequestErrorHandlingIgnore   SyncJobRunCreateRequestErrorHandling = "ignore"
	SyncJobRunCreateRequestErrorHandlingBatch    SyncJobRunCreateRequestErrorHandling = "batch"
)

Known SyncJobRunCreateRequestErrorHandling values.

type SyncJobRunResourceStats

type SyncJobRunResourceStats map[string]map[string]SyncJobRunResourceStatsValueValue

Per-resource, per-method counters describing how much data the sync job moved. The outer keys are resource names (matching the `resources[].name` field of the sync job), the inner keys are the integration method invoked (`list`, `get`, etc.). Updated approximately every 10 seconds while the sync job run is in flight.

type SyncJobRunResourceStatsValueValue

type SyncJobRunResourceStatsValueValue struct {
	// Number of records pulled from the upstream integration.
	Fetched int64 `json:"fetched"`
	// Number of records actually written to the destination (datastore, super-query, or webhook).
	Persisted int64 `json:"persisted"`
}

SyncJobRunResourceStatsValueValue is a Truto API object.

type SyncJobRunResponse

type SyncJobRunResponse struct {
	// The ID of the sync job run.
	ID *string `json:"id,omitempty"`
	// The arguments passed to the sync job run.
	Args      map[string]any          `json:"args,omitempty"`
	Resources []SyncJobResourceSchema `json:"resources,omitempty"`
	// The ID of the sync job that this sync job run belongs to.
	SyncJobID *string `json:"sync_job_id,omitempty"`
	// The ID of the integrated account that this sync job run belongs to.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The status of the sync job run. `created` - waiting to run, `running` - running, `rate_limited` - temporarily paused after an upstream rate-limit response and will resume automatically after backoff, `completed` - completed successfully, `failed` - failed, `stopped` - stopped by the user.
	Status *SyncJobRunSchemaStatus `json:"status,omitempty"`
	// The daemon_id attribute of a daemon that is running this sync job.
	DaemonID *string `json:"daemon_id,omitempty"`
	// The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	DaemonGroupKey *string `json:"daemon_group_key,omitempty"`
	// The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	WebhookID *string `json:"webhook_id,omitempty"`
	// Specifies the error handling strategy used for the sync job run. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2.
	ErrorHandling *SyncJobRunSchemaErrorHandling `json:"error_handling,omitempty"`
	// Specifies if the sync job run was started ignoring the previous run date.
	IgnorePreviousRun *bool `json:"ignore_previous_run,omitempty"`
	// The runtime version of the sync job run. The version 1 is the default version and the version 2 is the new version which supports batch error handling and other enhancements.
	Version *int64 `json:"version,omitempty"`
	// The statistics of the resources synced in the sync job run. This will have information around how many records were fetched and persisted by the sync job run -- grouped by the resource and method. The data is updated every 10 seconds while the sync job run is running.
	ResourceStats SyncJobRunResourceStats `json:"resource_stats,omitempty"`
	// The date and time when the sync job run was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the sync job run was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// The date and time when the sync job run was started.
	StartedAt *string `json:"started_at,omitempty"`
	// The date and time when the sync job run was finished.
	FinishedAt *string `json:"finished_at,omitempty"`
	// The sync job that this sync job run belongs to.
	SyncJob *SyncJobSchema `json:"sync_job,omitempty"`
}

SyncJobRunResponse is a Truto API object.

type SyncJobRunSchema

type SyncJobRunSchema struct {
	// The ID of the sync job run.
	ID *string `json:"id,omitempty"`
	// The arguments passed to the sync job run.
	Args      map[string]any          `json:"args,omitempty"`
	Resources []SyncJobResourceSchema `json:"resources,omitempty"`
	// The ID of the sync job that this sync job run belongs to.
	SyncJobID *string `json:"sync_job_id,omitempty"`
	// The ID of the integrated account that this sync job run belongs to.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The status of the sync job run. `created` - waiting to run, `running` - running, `rate_limited` - temporarily paused after an upstream rate-limit response and will resume automatically after backoff, `completed` - completed successfully, `failed` - failed, `stopped` - stopped by the user.
	Status *SyncJobRunSchemaStatus `json:"status,omitempty"`
	// The daemon_id attribute of a daemon that is running this sync job.
	DaemonID *string `json:"daemon_id,omitempty"`
	// The name of the daemon group that this sync job run should be assigned to. Used while creating a sync job run. Truto find a daemon in the group that is available to run the sync job. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	DaemonGroupKey *string `json:"daemon_group_key,omitempty"`
	// The ID of the webhook where the sync job records need to be sent. You can either specify `daemon_group_key` (Daemon) or `webhook_id` (RapidBridge), but NOT both while creating a Sync Job Run.
	WebhookID *string `json:"webhook_id,omitempty"`
	// Specifies the error handling strategy used for the sync job run. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2.
	ErrorHandling *SyncJobRunSchemaErrorHandling `json:"error_handling,omitempty"`
	// Specifies if the sync job run was started ignoring the previous run date.
	IgnorePreviousRun *bool `json:"ignore_previous_run,omitempty"`
	// The runtime version of the sync job run. The version 1 is the default version and the version 2 is the new version which supports batch error handling and other enhancements.
	Version *int64 `json:"version,omitempty"`
	// The statistics of the resources synced in the sync job run. This will have information around how many records were fetched and persisted by the sync job run -- grouped by the resource and method. The data is updated every 10 seconds while the sync job run is running.
	ResourceStats SyncJobRunResourceStats `json:"resource_stats,omitempty"`
	// The date and time when the sync job run was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the sync job run was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// The date and time when the sync job run was started.
	StartedAt *string `json:"started_at,omitempty"`
	// The date and time when the sync job run was finished.
	FinishedAt *string `json:"finished_at,omitempty"`
}

SyncJobRunSchema is a Truto API object.

type SyncJobRunSchemaErrorHandling

type SyncJobRunSchemaErrorHandling string

Specifies the error handling strategy used for the sync job run. `fail_fast` - stop the sync job run as soon as an error is encountered, `ignore` - continue running the sync job run even if an error is encountered. In case of `ignore`, you'll receive `sync_job_run:record_error` events for each error encountered. In case of `batch`, you'll receive `sync_job_run:record_error` events with multiple errors batched into the errors array, this is only supported when the `version` used for Sync Job Run is 2.

Values the SDK does not know about decode unchanged.

const (
	SyncJobRunSchemaErrorHandlingFailFast SyncJobRunSchemaErrorHandling = "fail_fast"
	SyncJobRunSchemaErrorHandlingIgnore   SyncJobRunSchemaErrorHandling = "ignore"
	SyncJobRunSchemaErrorHandlingBatch    SyncJobRunSchemaErrorHandling = "batch"
)

Known SyncJobRunSchemaErrorHandling values.

type SyncJobRunSchemaStatus

type SyncJobRunSchemaStatus string

The status of the sync job run. `created` - waiting to run, `running` - running, `rate_limited` - temporarily paused after an upstream rate-limit response and will resume automatically after backoff, `completed` - completed successfully, `failed` - failed, `stopped` - stopped by the user.

Values the SDK does not know about decode unchanged.

const (
	SyncJobRunSchemaStatusCreated     SyncJobRunSchemaStatus = "created"
	SyncJobRunSchemaStatusRunning     SyncJobRunSchemaStatus = "running"
	SyncJobRunSchemaStatusRateLimited SyncJobRunSchemaStatus = "rate_limited"
	SyncJobRunSchemaStatusCompleted   SyncJobRunSchemaStatus = "completed"
	SyncJobRunSchemaStatusFailed      SyncJobRunSchemaStatus = "failed"
	SyncJobRunSchemaStatusStopped     SyncJobRunSchemaStatus = "stopped"
)

Known SyncJobRunSchemaStatus values.

type SyncJobRunState

type SyncJobRunState struct {
	// Key for this state entry. Unique within the namespace identified by `state_key`.
	Key *string `json:"key,omitempty"`
	// The stored value. Encode structured data (for example, JSON) as a string before storing.
	Value *string `json:"value,omitempty"`
	// The ID of the sync job run that wrote this entry, if any.
	SyncJobRunID *string `json:"sync_job_run_id,omitempty"`
	// Time at which the state entry was first created.
	CreatedAt *string `json:"created_at,omitempty"`
	// Time at which the state entry was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

A key/value entry stored within a sync job's state namespace. Sync jobs use this to persist incremental cursors, dedupe markers, and other small bits of state across runs.

type SyncJobRunStateCreateRequest

type SyncJobRunStateCreateRequest struct {
	// The key identifier for this state.
	Key string `json:"key"`
	// The state value to store.
	Value string `json:"value"`
}

SyncJobRunStateCreateRequest is a Truto API object.

type SyncJobRunStateListResponse

type SyncJobRunStateListResponse struct {
	Result []SyncJobRunState `json:"result,omitempty"`
}

SyncJobRunStateListResponse is a Truto API object.

type SyncJobRunStateUpdateRequest

type SyncJobRunStateUpdateRequest struct {
	// The new state value to store.
	Value string `json:"value"`
}

SyncJobRunStateUpdateRequest is a Truto API object.

type SyncJobRunStatesService

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

SyncJobRunStatesService manages state stored by sync job runs.

func (*SyncJobRunStatesService) Create

Create creates an item.

func (*SyncJobRunStatesService) Delete

func (s *SyncJobRunStatesService) Delete(ctx context.Context, id string, opts ...Option) (*SyncJobRunState, error)

Delete deletes an item.

func (*SyncJobRunStatesService) Get

Get fetches one item by ID.

func (*SyncJobRunStatesService) List

List returns an iterator over the items. Filter with WithQuery.

func (*SyncJobRunStatesService) Update

Update changes an item. Only the fields that are set are sent.

type SyncJobRunsService

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

SyncJobRunsService manages sync job runs.

func (*SyncJobRunsService) Create

Create creates an item.

func (*SyncJobRunsService) Delete

func (s *SyncJobRunsService) Delete(ctx context.Context, id string, opts ...Option) (*SyncJobRunResponse, error)

Delete deletes an item.

func (*SyncJobRunsService) Get

Get fetches one item by ID.

func (*SyncJobRunsService) List

List returns an iterator over the items. Filter with WithQuery.

func (*SyncJobRunsService) Update

func (s *SyncJobRunsService) Update(ctx context.Context, id string, body Record, opts ...Option) (*SyncJobRunResponse, error)

Update changes an item. Only the fields that are set are sent.

type SyncJobSchema

type SyncJobSchema struct {
	// The ID of the sync job.
	ID *string `json:"id,omitempty"`
	// The name of the integration that this sync job interacts with.
	IntegrationName *string                  `json:"integration_name,omitempty"`
	ArgsSchema      *SyncJobArgsSchemaSchema `json:"args_schema,omitempty"`
	Resources       []SyncJobResourceSchema  `json:"resources,omitempty"`
	// The ID of the environment that this sync job belongs to.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The date and time when the sync job was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the sync job was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

SyncJobSchema is a Truto API object.

type SyncJobTemplateCreate

type SyncJobTemplateCreate struct {
	// The integration name for the template.
	IntegrationName *string `json:"integration_name,omitempty"`
	// A JSON Schema object, or a JSON string of one. An empty array is stored as `{}`; any other array, or a string that isn't valid JSON, is a `400`.
	ArgsSchema *SyncJobArgsSchemaSchema `json:"args_schema,omitempty"`
	// The resources, as an array or a JSON string of one. A string that isn't a valid JSON array of resources is a `400`.
	Resources []SyncJobResourceSchema `json:"resources,omitempty"`
	// The default runtime version for sync jobs using this template.
	DefaultRuntimeVersion *float64 `json:"default_runtime_version,omitempty"`
	// A short descriptor for this template that helps in idnetifying the template better
	Label string `json:"label"`
	// Optional longer description of what this template does.
	Description *string                       `json:"description,omitempty"`
	Sharing     *SyncJobTemplateCreateSharing `json:"sharing,omitempty"`
}

SyncJobTemplateCreate is a Truto API object.

type SyncJobTemplateCreateSharing

type SyncJobTemplateCreateSharing string

SyncJobTemplateCreateSharing is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	SyncJobTemplateCreateSharingAllow SyncJobTemplateCreateSharing = "allow"
	SyncJobTemplateCreateSharingAsk   SyncJobTemplateCreateSharing = "ask"
	SyncJobTemplateCreateSharingDeny  SyncJobTemplateCreateSharing = "deny"
)

Known SyncJobTemplateCreateSharing values.

type SyncJobTemplateDeleteResponse

type SyncJobTemplateDeleteResponse struct {
	// The ID of the deleted template.
	ID *string `json:"id,omitempty"`
}

SyncJobTemplateDeleteResponse is a Truto API object.

type SyncJobTemplatePatch

type SyncJobTemplatePatch struct {
	// If you want to change the integration for the template.
	IntegrationName *string `json:"integration_name,omitempty"`
	// A JSON Schema object, or a JSON string of one. An empty array is stored as `{}`; any other array, or a string that isn't valid JSON, is a `400`.
	ArgsSchema *SyncJobArgsSchemaSchema `json:"args_schema,omitempty"`
	// The resources, as an array or a JSON string of one. A string that isn't a valid JSON array of resources is a `400`.
	Resources []SyncJobResourceSchema `json:"resources,omitempty"`
	// Timestamp automatically updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// The default runtime version for sync jobs using this template.
	DefaultRuntimeVersion *float64 `json:"default_runtime_version,omitempty"`
	// A short descriptor for the template.
	Label *string `json:"label,omitempty"`
	// Optional longer description of what this template does.
	Description *string                      `json:"description,omitempty"`
	Sharing     *SyncJobTemplatePatchSharing `json:"sharing,omitempty"`
}

SyncJobTemplatePatch is a Truto API object.

type SyncJobTemplatePatchSharing

type SyncJobTemplatePatchSharing string

SyncJobTemplatePatchSharing is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	SyncJobTemplatePatchSharingAllow SyncJobTemplatePatchSharing = "allow"
	SyncJobTemplatePatchSharingAsk   SyncJobTemplatePatchSharing = "ask"
	SyncJobTemplatePatchSharingDeny  SyncJobTemplatePatchSharing = "deny"
)

Known SyncJobTemplatePatchSharing values.

type SyncJobTemplateSchema

type SyncJobTemplateSchema struct {
	// The unique ID of the sync job template.
	ID string `json:"id"`
	// The integration name to which this template applies. Is null for default_runtime_version > 4.
	IntegrationName *string `json:"integration_name,omitempty"`
	// A short descriptor for the template.
	Label string `json:"label"`
	// Optional longer description of what this template does.
	Description *string `json:"description,omitempty"`
	// Optional JSON schema describing arguments for the sync job.
	ArgsSchema *SyncJobArgsSchemaSchema `json:"args_schema,omitempty"`
	// A list of sync job resources that define the steps. If empty, no default resources are set.
	Resources []SyncJobResourceSchema `json:"resources,omitempty"`
	// The runtime version for any sync job that uses this template.
	DefaultRuntimeVersion *float64 `json:"default_runtime_version,omitempty"`
	// The team that owns this template.
	TeamID string `json:"team_id"`
	// The sharing policy of the template.
	Sharing SyncJobTemplateSchemaSharing `json:"sharing"`
	// When the template was created.
	CreatedAt string `json:"created_at"`
	// When the template was last updated.
	UpdatedAt string `json:"updated_at"`
}

SyncJobTemplateSchema is a Truto API object.

type SyncJobTemplateSchemaSharing

type SyncJobTemplateSchemaSharing string

The sharing policy of the template.

Values the SDK does not know about decode unchanged.

const (
	SyncJobTemplateSchemaSharingAllow SyncJobTemplateSchemaSharing = "allow"
	SyncJobTemplateSchemaSharingAsk   SyncJobTemplateSchemaSharing = "ask"
	SyncJobTemplateSchemaSharingDeny  SyncJobTemplateSchemaSharing = "deny"
)

Known SyncJobTemplateSchemaSharing values.

type SyncJobTemplatesService

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

SyncJobTemplatesService manages sync job templates.

func (*SyncJobTemplatesService) Create

Create creates an item.

func (*SyncJobTemplatesService) Delete

Delete deletes an item.

func (*SyncJobTemplatesService) Get

Get fetches one item by ID.

func (*SyncJobTemplatesService) List

List returns an iterator over the items. Filter with WithQuery.

func (*SyncJobTemplatesService) Update

Update changes an item. Only the fields that are set are sent.

type SyncJobUpdateRequest

type SyncJobUpdateRequest struct {
	// The name of the integration that this sync job interacts with.
	IntegrationName string                   `json:"integration_name"`
	ArgsSchema      *SyncJobArgsSchemaSchema `json:"args_schema,omitempty"`
	Resources       []SyncJobResourceSchema  `json:"resources,omitempty"`
}

SyncJobUpdateRequest is a Truto API object.

type SyncJobsService

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

SyncJobsService manages sync jobs.

func (*SyncJobsService) Create

func (s *SyncJobsService) Create(ctx context.Context, body SyncJobCreateRequest, opts ...Option) (*SyncJobSchema, error)

Create creates an item.

func (*SyncJobsService) Delete

func (s *SyncJobsService) Delete(ctx context.Context, id string, opts ...Option) (*DeleteResponse, error)

Delete deletes an item.

func (*SyncJobsService) Get

func (s *SyncJobsService) Get(ctx context.Context, id string, opts ...Option) (*SyncJobSchema, error)

Get fetches one item by ID.

func (*SyncJobsService) List

func (s *SyncJobsService) List(ctx context.Context, opts ...Option) *Iterator[SyncJobSchema]

List returns an iterator over the items. Filter with WithQuery.

func (*SyncJobsService) Update

func (s *SyncJobsService) Update(ctx context.Context, id string, body SyncJobUpdateRequest, opts ...Option) (*SyncJobSchema, error)

Update changes an item. Only the fields that are set are sent.

type TeamSchema

type TeamSchema struct {
	// The ID of the team.
	ID *string `json:"id,omitempty"`
	// The name of the team.
	Name *string `json:"name,omitempty"`
	// The domain of the team.
	Domain *string `json:"domain,omitempty"`
	Logo *string `json:"logo,omitempty"`
	// Whether the team is verified or not.
	IsVerified *bool `json:"is_verified,omitempty"`
	// Whether the team is white-labeled or not.
	IsWhiteLabel *bool `json:"is_white_label,omitempty"`
	// A link to the team's Terms of Service, if available.
	TosLink *string `json:"tos_link,omitempty"`
	// Whether the team allows impersonation.
	AllowImpersonation *bool `json:"allow_impersonation,omitempty"`
	// The date and time when the team was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the team was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

TeamSchema is a Truto API object.

type TeamsService

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

TeamsService manages teams the token can see.

func (*TeamsService) Get

func (s *TeamsService) Get(ctx context.Context, id string, opts ...Option) (*Record, error)

Get fetches one item by ID.

func (*TeamsService) List

func (s *TeamsService) List(ctx context.Context, opts ...Option) *Iterator[Record]

List returns an iterator over the items. Filter with WithQuery.

func (*TeamsService) Update

func (s *TeamsService) Update(ctx context.Context, id string, body Record, opts ...Option) (*Record, error)

Update changes an item. Only the fields that are set are sent.

type TenantBulkCreateResponse

type TenantBulkCreateResponse struct {
	// The tenants that were newly inserted.
	Created []TenantResponse `json:"created,omitempty"`
	// Tenants that already existed and were updated. Only populated when `mode` is `upsert`; always empty for `insert`.
	Updated []TenantResponse `json:"updated,omitempty"`
	// Rows that were not inserted because a tenant with the same `(id, environment_id)` already existed. Only populated when `mode` is `insert` (the default), which uses `INSERT ... ON CONFLICT DO NOTHING`. Empty for `upsert`.
	Skipped []TenantBulkCreateResponseSkippedItem `json:"skipped,omitempty"`
}

TenantBulkCreateResponse is a Truto API object.

type TenantBulkCreateResponseSkippedItem

type TenantBulkCreateResponseSkippedItem struct {
	// The tenant `id` that was skipped.
	ID *string `json:"id,omitempty"`
	// Why the row was skipped.
	Reason *TenantBulkCreateResponseSkippedItemReason `json:"reason,omitempty"`
}

TenantBulkCreateResponseSkippedItem is a Truto API object.

type TenantBulkCreateResponseSkippedItemReason

type TenantBulkCreateResponseSkippedItemReason string

Why the row was skipped.

Values the SDK does not know about decode unchanged.

const (
	TenantBulkCreateResponseSkippedItemReasonAlreadyExists TenantBulkCreateResponseSkippedItemReason = "already_exists"
)

Known TenantBulkCreateResponseSkippedItemReason values.

type TenantBulkRequest

type TenantBulkRequest struct {
	// Collision behaviour. `insert` skips existing ids; `upsert` updates `name`/`metadata` on existing ids.
	Mode *TenantBulkRequestMode `json:"mode,omitempty"`
	// The list of tenants to create or upsert. Max 1000 per request — split larger inputs client-side. Only `id`, `name`, and `metadata` are allowed per item.
	Tenants []TenantBulkRequestTenantsItem `json:"tenants"`
	// Environment to create the tenants in. Required for session auth; ignored for API tokens. Applied to every row in the batch — the endpoint does not let you mix environments in one request.
	EnvironmentID *string `json:"environment_id,omitempty"`
}

TenantBulkRequest is a Truto API object.

type TenantBulkRequestMode

type TenantBulkRequestMode string

Collision behaviour. `insert` skips existing ids; `upsert` updates `name`/`metadata` on existing ids.

Values the SDK does not know about decode unchanged.

const (
	TenantBulkRequestModeInsert TenantBulkRequestMode = "insert"
	TenantBulkRequestModeUpsert TenantBulkRequestMode = "upsert"
)

Known TenantBulkRequestMode values.

type TenantBulkRequestTenantsItem

type TenantBulkRequestTenantsItem struct {
	// Tenant id. Free-form up to 255 characters, excluding control characters, leading or trailing whitespace, and the dot segments `.` and `..`.
	ID string `json:"id"`
	// Display name. Defaults to `id` when omitted on insert; kept unchanged when omitted on upsert of an existing row.
	Name *string `json:"name,omitempty"`
	// Free-form JSON object. Defaults to `{}` when omitted on insert; kept unchanged when omitted on upsert of an existing row.
	Metadata map[string]any `json:"metadata,omitempty"`
}

TenantBulkRequestTenantsItem is a Truto API object.

type TenantCreateRequest

type TenantCreateRequest struct {
	// Your identifier for the tenant. Free-form up to 255 characters — `/`, spaces and non-ASCII are all fine. Control characters, leading or trailing whitespace, and the dot segments `.` and `..` are rejected. Immutable — cannot be changed later.
	ID string `json:"id"`
	// Display name. Defaults to `id` when omitted.
	Name *string `json:"name,omitempty"`
	// Free-form JSON object. Stored and returned verbatim.
	Metadata map[string]any `json:"metadata,omitempty"`
	// Which environment to create the tenant in. Required for session auth; ignored for API tokens (inferred from the token).
	EnvironmentID *string `json:"environment_id,omitempty"`
}

TenantCreateRequest is a Truto API object.

type TenantResponse

type TenantResponse struct {
	// The tenant identifier — caller-chosen and immutable once created. Composite primary key with `environment_id`, so the same value can exist independently in `development`, `staging`, and `production`. Free-form up to 255 characters: whatever you already use to identify a customer, including `/`, spaces and non-ASCII. The only values rejected are the ones no URL path segment can carry — control characters, leading or trailing whitespace, and the dot segments `.` and `..`.
	ID *string `json:"id,omitempty"`
	// The environment this tenant belongs to.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// Display name shown in the dashboard. Defaults to the tenant `id` on create if not supplied; can be edited later via `PATCH /tenant/{id}`.
	Name *string `json:"name,omitempty"`
	// Free-form JSON object stored verbatim. Truto does not interpret this field — use it for tier, region, billing plan, or any other customer attribute your app cares about.
	Metadata map[string]any `json:"metadata,omitempty"`
	// The date and time when the tenant was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the tenant was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

TenantResponse is a Truto API object.

type TenantUpdateRequest

type TenantUpdateRequest struct {
	// New display name.
	Name *string `json:"name,omitempty"`
	// Full replacement of the metadata object.
	Metadata map[string]any `json:"metadata,omitempty"`
}

TenantUpdateRequest is a Truto API object.

type TenantVisibility

type TenantVisibility struct {
	// Every condition must hold.
	AllOf []TenantVisibilityCondition `json:"all_of,omitempty"`
	// At least one condition must hold.
	AnyOf []TenantVisibilityCondition `json:"any_of,omitempty"`
}

A closed predicate over `tenant.metadata`, evaluated **server-side** on the catalog list and again on connect. The rule itself is never sent to the browser, and a tenant that fails it cannot tell the integration from one that is not installed — connect answers `404`.

type TenantVisibilityCondition

type TenantVisibilityCondition struct {
	// A dotted path into `tenant.metadata`, at most four segments deep.
	Path string                      `json:"path"`
	Op   TenantVisibilityConditionOp `json:"op"`
	// Required for `in` and `not_in`; rejected for `exists` and `not_exists`. Values are compared as strings — a numeric or boolean metadata value matches its string form.
	Values []string `json:"values,omitempty"`
}

TenantVisibilityCondition is a Truto API object.

type TenantVisibilityConditionOp

type TenantVisibilityConditionOp string

TenantVisibilityConditionOp is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	TenantVisibilityConditionOpIn        TenantVisibilityConditionOp = "in"
	TenantVisibilityConditionOpNotIn     TenantVisibilityConditionOp = "not_in"
	TenantVisibilityConditionOpExists    TenantVisibilityConditionOp = "exists"
	TenantVisibilityConditionOpNotExists TenantVisibilityConditionOp = "not_exists"
)

Known TenantVisibilityConditionOp values.

type TenantsService

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

TenantsService manages tenants (your customers).

func (*TenantsService) BulkCreate

BulkCreate creates or upserts many tenants in one call.

func (*TenantsService) Create

func (s *TenantsService) Create(ctx context.Context, body TenantCreateRequest, opts ...Option) (*TenantResponse, error)

Create creates an item.

func (*TenantsService) Delete

func (s *TenantsService) Delete(ctx context.Context, id string, opts ...Option) (*TenantResponse, error)

Delete deletes an item.

func (*TenantsService) Get

func (s *TenantsService) Get(ctx context.Context, id string, opts ...Option) (*TenantResponse, error)

Get fetches one item by ID.

func (*TenantsService) List

func (s *TenantsService) List(ctx context.Context, opts ...Option) *Iterator[TenantResponse]

List returns an iterator over the items. Filter with WithQuery.

func (*TenantsService) Update

func (s *TenantsService) Update(ctx context.Context, id string, body TenantUpdateRequest, opts ...Option) (*TenantResponse, error)

Update changes an item. Only the fields that are set are sent.

type ToolSchema

type ToolSchema struct {
	// The resource type for the tool
	Resource string `json:"resource"`
	// The HTTP method for the tool
	Method string `json:"method"`
	// MCP tool name for this method. Resolved as: environment-integration `tool_name` documentation override,
	// then integration-level `tool_name` override, then a programmatic default from `getToolName()`.
	// Overrides are stored as `documentation` rows with `type: tool_name` (max 64 chars, `[a-z0-9_]`).
	Name string `json:"name"`
	// A description of what the tool does
	Description string                `json:"description"`
	QuerySchema ToolSchemaQuerySchema `json:"query_schema"`
	BodySchema  ToolSchemaBodySchema  `json:"body_schema"`
	Required    []string              `json:"required"`
	Tags        []string              `json:"tags,omitempty"`
}

ToolSchema is a Truto API object.

type ToolSchemaBodySchema

type ToolSchemaBodySchema struct {
	Type       *string        `json:"type,omitempty"`
	Properties map[string]any `json:"properties,omitempty"`
}

ToolSchemaBodySchema is a Truto API object.

type ToolSchemaQuerySchema

type ToolSchemaQuerySchema struct {
	Type       *string        `json:"type,omitempty"`
	Properties map[string]any `json:"properties,omitempty"`
}

ToolSchemaQuerySchema is a Truto API object.

type ToolsFilter

type ToolsFilter struct {
	// Methods, e.g. "list", "get", "create". Empty means all.
	Methods []string
	// Tags set on resource methods. Empty means all.
	Tags []string
}

ToolsFilter narrows the tools returned by IntegratedAccountsService.Tools.

type ToolsResponseSchema

type ToolsResponseSchema struct {
	Results []ToolSchema `json:"results"`
}

ToolsResponseSchema is a Truto API object.

type TrutoErrorInsightSchema

type TrutoErrorInsightSchema struct {
	ForbiddenError *ForbiddenErrorInsightSchema `json:"forbidden_error,omitempty"`
}

The `truto_error_insight` object on an error response body. Every key is optional and which ones appear depends on the failure; see the Errors guide for the full list. The Proxy API has no unified schema to compare a request against, so only `forbidden_error` is added there.

type UnifiedAPIService

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

UnifiedAPIService calls the Unified API: one schema per category (CRM, ATS, HRIS, ...) across every integration in it. Results are Records; use Decode for your own types.

func (*UnifiedAPIService) Create

func (s *UnifiedAPIService) Create(ctx context.Context, r UnifiedResource, body any, opts ...Option) (*Record, error)

Create creates a record.

func (*UnifiedAPIService) CustomMethod

func (s *UnifiedAPIService) CustomMethod(ctx context.Context, r UnifiedResource, method string, body any, opts ...Option) (*Record, error)

CustomMethod calls a non-CRUD method of the resource (POST /unified/{model}/{resource}/{method}). body may be nil.

func (*UnifiedAPIService) Delete

func (s *UnifiedAPIService) Delete(ctx context.Context, r UnifiedResource, id string, opts ...Option) (*Record, error)

Delete deletes a record.

func (*UnifiedAPIService) Get

func (s *UnifiedAPIService) Get(ctx context.Context, r UnifiedResource, id string, opts ...Option) (*Record, error)

Get fetches one record.

func (*UnifiedAPIService) List

List returns an iterator over the resource.

func (*UnifiedAPIService) Meta

func (s *UnifiedAPIService) Meta(ctx context.Context, model, resource, integrationName, method string, opts ...Option) (*UnifiedApiMetaResponse, error)

Meta describes one method of a unified resource for an integration: the query and body it accepts and its response schema.

func (*UnifiedAPIService) ModelMeta

func (s *UnifiedAPIService) ModelMeta(ctx context.Context, model, integrationName string, opts ...Option) (*UnifiedMetaGetResponse, error)

ModelMeta describes a unified model for an integration: plan, scopes and instructions.

func (*UnifiedAPIService) Update

func (s *UnifiedAPIService) Update(ctx context.Context, r UnifiedResource, id string, body any, opts ...Option) (*Record, error)

Update changes a record.

type UnifiedApiMetaResponse

type UnifiedApiMetaResponse struct {
	// The unified method this metadata describes.
	Method *string `json:"method,omitempty"`
	// The unified-model resource JSON schema.
	Schema *JsonSchemaObject `json:"schema,omitempty"`
	// Vendor documentation URL for this method, if set on the integration mapping.
	DocumentationLink *string `json:"documentation_link,omitempty"`
	// A subset of `schema` containing only the fields actually populated by `response_mapping` for this integration.
	ResponseSchema *JsonSchemaObject `json:"response_schema,omitempty"`
	// JSON-schema-style description of the supported query parameters for this method.
	QuerySchema *JsonSchemaObject `json:"query_schema,omitempty"`
	// JSON-schema-style description of the supported request body for this method.
	RequestBodySchema *JsonSchemaObject `json:"request_body_schema,omitempty"`
	// Default query parameters always applied by the integration mapping. Values may be templated JSONata expressions.
	DefaultQuery map[string]any `json:"default_query,omitempty"`
	// Default request body always applied by the integration mapping. Values may be templated JSONata expressions. Object or `null` (arrays are allowed at runtime but rare).
	DefaultBody map[string]any `json:"default_body,omitempty"`
}

Response from `GET /unified/{model_name}/{resource_name}/{integration_name}/meta/{method}`. Returns the merged JSON schema, default query/body, and documentation link for a single integration mapping. Useful for inspecting what a unified call will accept and return without touching a real integrated account.

type UnifiedMetaGetResponse

type UnifiedMetaGetResponse struct {
	// The list of pricing plans for which the integration is available. In free text format, ready to be displayed as it is.
	PricingPlan []string `json:"pricing_plan,omitempty"`
	// The list of user roles who can connect the integration. In free text format, ready to be displayed as it is.
	UserRole []string `json:"user_role,omitempty"`
	// The list of scopes required to make the unified API work.
	Scopes []string `json:"scopes,omitempty"`
	// The integration specific instructions like steps to create an API key, getting account subdomain, etc. In Markdown format.
	Instructions *string `json:"instructions,omitempty"`
}

UnifiedMetaGetResponse is a Truto API object.

type UnifiedModelCreateRequest

type UnifiedModelCreateRequest struct {
	// The new name of the unified model, if you want to rename it.
	Name *string `json:"name,omitempty"`
	// The new category, if you want to change it.
	Category *string `json:"category,omitempty"`
	// A brief description of what this unified model represents.
	Description *string `json:"description,omitempty"`
	// Map of resource name → `UnifiedModelResource`.
	Resources map[string]UnifiedModelResource `json:"resources,omitempty"`
	// The ID of the team that owns this unified model.
	TeamID *string `json:"team_id,omitempty"`
	// Per-resource documentation (`pricing_plan`, `user_role`, `scopes`, `instructions`).
	Docs map[string]UnifiedModelResourceDocs `json:"docs,omitempty"`
	// Per-resource OAuth/permission scopes required to call its methods.
	Scopes map[string][]string `json:"scopes,omitempty"`
	// Per-resource webhook routing expression (JSONata).
	Webhooks map[string]string `json:"webhooks,omitempty"`
}

UnifiedModelCreateRequest is a Truto API object.

type UnifiedModelDeleteResponse

type UnifiedModelDeleteResponse struct {
	// The ID of the deleted unified model.
	ID *string `json:"id,omitempty"`
}

UnifiedModelDeleteResponse is a Truto API object.

type UnifiedModelMethod

type UnifiedModelMethod struct {
	// Integration method name (`list`, `get`, `create`, `update`, `delete`, or a custom method).
	Method          string  `json:"method"`
	QueryParamValue *string `json:"query_param_value,omitempty"`
	QueryParam      *string `json:"query_param,omitempty"`
	BodyField       *string `json:"body_field,omitempty"`
	BodyFieldValue  *string `json:"body_field_value,omitempty"`
}

One element of the array form of `method` overrides. Used to dispatch to different integration methods based on a query/body discriminator.

type UnifiedModelMethodConditionalFileUpload

type UnifiedModelMethodConditionalFileUpload struct {
	FileUpload      UnifiedModelMethodConditionalFileUploadFileUpload `json:"file_upload"`
	Config          map[string]any                                    `json:"config,omitempty"`
	QueryParamValue *string                                           `json:"query_param_value,omitempty"`
	QueryParam      string                                            `json:"query_param"`
}

A file-upload strategy that only applies when `query_param` matches `query_param_value`. Used in arrays to select different upload strategies based on caller intent.

type UnifiedModelMethodConditionalFileUploadFileUpload

type UnifiedModelMethodConditionalFileUploadFileUpload string

UnifiedModelMethodConditionalFileUploadFileUpload is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	UnifiedModelMethodConditionalFileUploadFileUploadMultipart UnifiedModelMethodConditionalFileUploadFileUpload = "multipart"
	UnifiedModelMethodConditionalFileUploadFileUploadBase64    UnifiedModelMethodConditionalFileUploadFileUpload = "base64"
	UnifiedModelMethodConditionalFileUploadFileUploadUpload    UnifiedModelMethodConditionalFileUploadFileUpload = "upload"
)

Known UnifiedModelMethodConditionalFileUploadFileUpload values.

type UnifiedModelMethodFileUpload

type UnifiedModelMethodFileUpload struct {
	FileUpload UnifiedModelMethodFileUploadFileUpload `json:"file_upload"`
	// Strategy-specific options (e.g. multipart field name, base64 wrapper key).
	Config map[string]any `json:"config,omitempty"`
}

File-upload strategy for `create`/`update` methods.

type UnifiedModelMethodFileUploadFileUpload

type UnifiedModelMethodFileUploadFileUpload string

UnifiedModelMethodFileUploadFileUpload is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	UnifiedModelMethodFileUploadFileUploadMultipart UnifiedModelMethodFileUploadFileUpload = "multipart"
	UnifiedModelMethodFileUploadFileUploadBase64    UnifiedModelMethodFileUploadFileUpload = "base64"
	UnifiedModelMethodFileUploadFileUploadUpload    UnifiedModelMethodFileUploadFileUpload = "upload"
)

Known UnifiedModelMethodFileUploadFileUpload values.

type UnifiedModelRelatedResources

type UnifiedModelRelatedResources struct {
	// Optional name for the sub-fetch result, referenceable from `response_mapping` via `{{related.<name>}}`.
	Name *string `json:"name,omitempty"`
	// Integration resource to call (e.g. `users`).
	Resource string `json:"resource"`
	// Integration method (`list`, `get`, etc.).
	Method string `json:"method"`
	// Query parameters to send. Values may be JSONata expressions referencing the parent record.
	Query map[string]any `json:"query,omitempty"`
	// Single-record fetch: the ID to look up. Supports JSONata placeholders like `{{record.assignee_id}}`.
	ID *string `json:"id,omitempty"`
	// Extra static fields merged into the related record before `response_mapping` runs.
	AdditionalData map[string]string `json:"additional_data,omitempty"`
	// Field in the parent record whose value identifies the related record(s).
	RelatedOn *string `json:"related_on,omitempty"`
	// Either a list of fields by which to relate, or `true` to use all fields.
	RelatedBy any `json:"related_by,omitempty"`
	// When true, replace the parent record with the related one instead of nesting.
	ReplaceRoot *bool `json:"replace_root,omitempty"`
	// JSONata expression; if it evaluates to falsy the sub-fetch is skipped.
	RunIf *string `json:"run_if,omitempty"`
	// Upstream HTTP status codes that should be rethrown instead of swallowed for this related-resource fetch.
	ThrowOnErrorStatusCodes []float64 `json:"throw_on_error_status_codes,omitempty"`
}

A related-resource fetch that runs after the main unified call and merges its response back in.

type UnifiedModelResource

type UnifiedModelResource struct {
	Description        *string                                `json:"description,omitempty"`
	Schema             JsonSchemaObject                       `json:"schema"`
	IntegrationMapping UnifiedModelResourceIntegrationMapping `json:"integration_mapping,omitempty"`
	// Optional normalization expressions keyed by field name.
	Normalization map[string]any `json:"normalization,omitempty"`
	Deprecated    *bool          `json:"deprecated,omitempty"`
	// Per-method metadata (e.g. deprecation flags).
	Methods map[string]UnifiedModelResourceMethods `json:"methods,omitempty"`
}

Definition of a single resource (e.g. `users`) inside a unified model.

type UnifiedModelResourceDocs

type UnifiedModelResourceDocs struct {
	// List of vendor pricing plans on which this integration mapping is supported.
	PricingPlan []string `json:"pricing_plan,omitempty"`
	// List of vendor user roles required for this integration mapping to work.
	UserRole []string `json:"user_role,omitempty"`
	// OAuth/API key scopes required for this integration mapping.
	Scopes []string `json:"scopes,omitempty"`
	// Markdown-formatted integration-specific setup instructions.
	Instructions *string `json:"instructions,omitempty"`
}

Per-integration documentation surfaced via `GET /unified/.../meta/{method}`.

type UnifiedModelResourceIntegrationMapping

type UnifiedModelResourceIntegrationMapping map[string]any

Per-integration mapping table for a unified-model resource. Top-level keys are integration names; each value contains the per-method mapping.

type UnifiedModelResourceMethod

type UnifiedModelResourceMethod struct {
	// Static value returned for this method without making an HTTP call.
	Static any `json:"static,omitempty"`
	// Integration resource to call. May be a single name, an array of resource fragments, or a `{ expression, resources }` object for dynamic dispatch.
	Resource any `json:"resource,omitempty"`
	// Integration method to call.
	Method                any                                              `json:"method,omitempty"`
	BaseURLMapping        *string                                          `json:"base_url_mapping,omitempty"`
	PathMapping           *string                                          `json:"path_mapping,omitempty"`
	ErrorMapping          *string                                          `json:"error_mapping,omitempty"`
	MappingVersion        *float64                                         `json:"mapping_version,omitempty"`
	ResponseMappingMethod *UnifiedModelResourceMethodResponseMappingMethod `json:"response_mapping_method,omitempty"`
	// JSONata expression (string) or object-form mapping. The object form is keyed by field name with values that may be JSONata strings, nested objects, or `JsonSchemaObjectProperties`.
	ResponseMapping   any     `json:"response_mapping,omitempty"`
	DocumentationLink *string `json:"documentation_link,omitempty"`
	RelatedResources  any     `json:"related_resources,omitempty"`
	// Object-form (v2) request body schema; values are partial JSON Schema entries.
	RequestBodySchema     map[string]JsonSchemaObjectProperties `json:"request_body_schema,omitempty"`
	RequestBodyMapping    any                                   `json:"request_body_mapping,omitempty"`
	QueryMapping          any                                   `json:"query_mapping,omitempty"`
	QuerySchema           any                                   `json:"query_schema,omitempty"`
	RequestHeaderMapping  *string                               `json:"request_header_mapping,omitempty"`
	ResponseHeaderMapping *string                               `json:"response_header_mapping,omitempty"`
	// Static query params merged into the integration request.
	Query map[string]any `json:"query,omitempty"`
	// Static body merged into the integration request.
	Body                map[string]any                             `json:"body,omitempty"`
	Before              any                                        `json:"before,omitempty"`
	After               any                                        `json:"after,omitempty"`
	IsPartialResponse   *bool                                      `json:"is_partial_response,omitempty"`
	IsPartialExpression *string                                    `json:"is_partial_expression,omitempty"`
	SideLoad            map[string]EnvironmentUnifiedModelSideLoad `json:"side_load,omitempty"`
	FileUpload          any                                        `json:"file_upload,omitempty"`
}

A single integration mapping for a unified-model method (e.g. `crm.contacts.list` on `salesforce`).

type UnifiedModelResourceMethodCreateRequest

type UnifiedModelResourceMethodCreateRequest struct {
	// The base unified model to attach the mapping to. Must belong to one of your teams.
	UnifiedModelID string `json:"unified_model_id"`
	// The unified resource name (e.g. `contacts`).
	ResourceName string `json:"resource_name"`
	// The integration slug (e.g. `apollo`).
	IntegrationName string `json:"integration_name"`
	// The unified method name (`list`, `get`, `create`, `update`, `delete`, or a custom method).
	MethodName string `json:"method_name"`
	// The mapping configuration for this method.
	Config *UnifiedModelResourceMethod `json:"config,omitempty"`
}

UnifiedModelResourceMethodCreateRequest is a Truto API object.

type UnifiedModelResourceMethodDeleteResponse

type UnifiedModelResourceMethodDeleteResponse struct {
	// The ID of the deleted mapping row.
	ID *string `json:"id,omitempty"`
}

UnifiedModelResourceMethodDeleteResponse is a Truto API object.

type UnifiedModelResourceMethodResource

type UnifiedModelResourceMethodResource struct {
	// The integration resource name to call.
	Resource string `json:"resource"`
	// Match value compared against `query_param`. When equal, this resource fragment is selected.
	QueryParamValue *string `json:"query_param_value,omitempty"`
	// Query parameter on the unified call used to discriminate between fragments.
	QueryParam *string `json:"query_param,omitempty"`
	// Body field on the unified call used to discriminate between fragments.
	BodyField *string `json:"body_field,omitempty"`
	// Match value compared against `body_field`.
	BodyFieldValue *string `json:"body_field_value,omitempty"`
}

One element of the array form of `resource` overrides. Used to merge multiple integration resources into a single unified call (e.g. fetching from `users` for some IDs and `contacts` for others).

type UnifiedModelResourceMethodResponseMappingMethod

type UnifiedModelResourceMethodResponseMappingMethod string

UnifiedModelResourceMethodResponseMappingMethod is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	UnifiedModelResourceMethodResponseMappingMethodArray UnifiedModelResourceMethodResponseMappingMethod = "array"
	UnifiedModelResourceMethodResponseMappingMethodItem  UnifiedModelResourceMethodResponseMappingMethod = "item"
)

Known UnifiedModelResourceMethodResponseMappingMethod values.

type UnifiedModelResourceMethodRowResponse

type UnifiedModelResourceMethodRowResponse struct {
	// The ID of the resource-method mapping row.
	ID *string `json:"id,omitempty"`
	// The base unified model this mapping belongs to.
	UnifiedModelID *string `json:"unified_model_id,omitempty"`
	// The unified resource this mapping serves (e.g. `contacts`).
	ResourceName *string `json:"resource_name,omitempty"`
	// The integration slug this mapping serves (e.g. `apollo`).
	IntegrationName *string `json:"integration_name,omitempty"`
	// The unified method this mapping serves (`list`, `get`, `create`, `update`, `delete`, or a custom method name).
	MethodName *string `json:"method_name,omitempty"`
	// The mapping itself (JSONata expressions, resource/method routing, side loads, …).
	Config *UnifiedModelResourceMethod `json:"config,omitempty"`
	// Optimistic-concurrency version. Send the current value in a PATCH body; every write increments it.
	Version   *float64 `json:"version,omitempty"`
	CreatedAt *string  `json:"created_at,omitempty"`
	UpdatedAt *string  `json:"updated_at,omitempty"`
}

One row of the `unified_model_resource_method` table — the per-integration, per-resource, per-method mapping for a **base** unified model. This is the team-wide definition every environment inherits from.

type UnifiedModelResourceMethodUpdateRequest

type UnifiedModelResourceMethodUpdateRequest struct {
	// Move the mapping to a different unified resource.
	ResourceName *string `json:"resource_name,omitempty"`
	// Move the mapping to a different integration slug.
	IntegrationName *string `json:"integration_name,omitempty"`
	// Move the mapping to a different unified method.
	MethodName *string `json:"method_name,omitempty"`
	// The replacement mapping configuration.
	Config *UnifiedModelResourceMethod `json:"config,omitempty"`
	// The row's current version. Required to avoid clobbering a concurrent write.
	Version *float64 `json:"version,omitempty"`
}

UnifiedModelResourceMethodUpdateRequest is a Truto API object.

type UnifiedModelResourceMethods

type UnifiedModelResourceMethods struct {
	// When true, marks the method as deprecated in docs/tools.
	Deprecated *bool `json:"deprecated,omitempty"`
}

Resource-level method metadata.

type UnifiedModelResourceMethodsService

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

UnifiedModelResourceMethodsService manages unified model resource method mappings.

func (*UnifiedModelResourceMethodsService) Create

Create creates an item.

func (*UnifiedModelResourceMethodsService) Delete

Delete deletes an item.

func (*UnifiedModelResourceMethodsService) Get

Get fetches one item by ID.

func (*UnifiedModelResourceMethodsService) List

List returns an iterator over the items. Filter with WithQuery.

func (*UnifiedModelResourceMethodsService) Update

Update changes an item. Only the fields that are set are sent.

type UnifiedModelResponse

type UnifiedModelResponse struct {
	// The ID of the unified model.
	ID *string `json:"id,omitempty"`
	// The name of the unified model.
	Name *string `json:"name,omitempty"`
	// The category of the unified model.
	Category *string `json:"category,omitempty"`
	// A brief description of what this unified model represents.
	Description *string `json:"description,omitempty"`
	// The ID of the team that owns this unified model.
	TeamID *string `json:"team_id,omitempty"`
	// The sharing policy of the unified model.
	Sharing *UnifiedModelResponseSharing `json:"sharing,omitempty"`
	// Map of resource name (e.g. `users`, `contacts`) → resource definition (`UnifiedModelResource`).
	Resources map[string]UnifiedModelResource `json:"resources,omitempty"`
	// Per-resource documentation (pricing plan / scopes / instructions).
	Docs map[string]UnifiedModelResourceDocs `json:"docs,omitempty"`
	// Per-resource OAuth/permission scopes required to call its methods.
	Scopes map[string][]string `json:"scopes,omitempty"`
	// Per-resource webhook routing expression (JSONata that decides whether an inbound webhook should be delivered to this resource).
	Webhooks map[string]string `json:"webhooks,omitempty"`
	// The date and time when the unified model was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the unified model was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// The current version of the unified model.
	Version *float64 `json:"version,omitempty"`
	// A list of environment IDs where this unified model is installed.
	InstalledEnvironment []string `json:"installed_environment,omitempty"`
	// The team object that owns this unified model.
	Team *TeamSchema `json:"team,omitempty"`
}

UnifiedModelResponse is a Truto API object.

type UnifiedModelResponseSharing

type UnifiedModelResponseSharing string

The sharing policy of the unified model.

Values the SDK does not know about decode unchanged.

const (
	UnifiedModelResponseSharingAllow UnifiedModelResponseSharing = "allow"
	UnifiedModelResponseSharingAsk   UnifiedModelResponseSharing = "ask"
	UnifiedModelResponseSharingDeny  UnifiedModelResponseSharing = "deny"
)

Known UnifiedModelResponseSharing values.

type UnifiedModelUpdateRequest

type UnifiedModelUpdateRequest struct {
	// The new name of the unified model, if you want to rename it.
	Name *string `json:"name,omitempty"`
	// The new category, if you want to change it.
	Category *string `json:"category,omitempty"`
	// A brief description of what this unified model represents.
	Description *string `json:"description,omitempty"`
	// Updated map of resource name → `UnifiedModelResource`.
	Resources map[string]UnifiedModelResource `json:"resources,omitempty"`
	// The ID of the team that owns this unified model.
	TeamID *string `json:"team_id,omitempty"`
	// The current version of the unified model. Required to prevent version conflicts.
	Version float64 `json:"version"`
	// Per-resource documentation.
	Docs map[string]UnifiedModelResourceDocs `json:"docs,omitempty"`
	// Per-resource OAuth/permission scopes required to call its methods.
	Scopes map[string][]string `json:"scopes,omitempty"`
	// Per-resource webhook routing expression (JSONata).
	Webhooks map[string]string `json:"webhooks,omitempty"`
}

UnifiedModelUpdateRequest is a Truto API object.

type UnifiedModelsService

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

UnifiedModelsService manages unified model definitions.

func (*UnifiedModelsService) Create

Create creates a unified model.

func (*UnifiedModelsService) Delete

Delete deletes a unified model.

func (*UnifiedModelsService) Get

Get fetches a unified model.

func (*UnifiedModelsService) Install

func (s *UnifiedModelsService) Install(ctx context.Context, unifiedModelID string, opts ...Option) (*EnvironmentUnifiedModelResponse, error)

Install installs the unified model in the environment the token belongs to.

func (*UnifiedModelsService) List

List returns an iterator over unified models.

func (*UnifiedModelsService) Uninstall

func (s *UnifiedModelsService) Uninstall(ctx context.Context, unifiedModelID string, opts ...Option) ([]EnvironmentUnifiedModelDeleteResponse, error)

Uninstall removes the unified model from the environment. It looks up the environment unified models for unifiedModelID and deletes each one.

func (*UnifiedModelsService) Update

Update changes a unified model.

type UnifiedProxyApiLog

type UnifiedProxyApiLog struct {
	// The time at which the log entry was recorded.
	Timestamp *string `json:"timestamp,omitempty"`
	// Human-readable summary of the log event.
	Message *string `json:"message,omitempty"`
	// The service that generated the log.
	Service *string `json:"service,omitempty"`
	// The deployment that wrote the log (`production`, `staging`,
	// `staging2`, `thoropass-production`, and per-developer preview
	// deployments). Distinct from `environment_id`, which is the Truto
	// environment the log belongs to: a single `environment_id` can be
	// served by more than one deployment, and `app_env` is what tells
	// them apart. Not an enumerated set — new deployments add values.
	AppEnv *string `json:"app_env,omitempty"`
	// The Truto environment in which the log was generated.
	EnvironmentID *string                    `json:"environment_id,omitempty"`
	LogType       *UnifiedProxyApiLogLogType `json:"log_type,omitempty"`
	// Internal log messages captured during request/job processing.
	Logs []string `json:"logs,omitempty"`
	// The hostname that served the request.
	Host *string `json:"host,omitempty"`
	// The full URL of the request (with sensitive paths masked).
	HTTPURL *string `json:"http_url,omitempty"`
	// The HTTP status code of the response.
	HTTPStatusCode *int64 `json:"http_status_code,omitempty"`
	// The HTTP method of the request.
	HTTPMethod *string `json:"http_method,omitempty"`
	// The IP address of the client.
	HTTPIP *string `json:"http_ip,omitempty"`
	// The Cloudflare Ray ID for the request.
	HTTPRequestID *string `json:"http_request_id,omitempty"`
	// The country code of the client (from Cloudflare).
	HTTPCountry *string `json:"http_country,omitempty"`
	// The User-Agent header of the request.
	HTTPUseragent *string `json:"http_useragent,omitempty"`
	// The hostname portion of the request URL.
	HTTPURLDetailsHost *string `json:"http_url_details_host,omitempty"`
	// The path portion of the request URL. On `mcp` rows the token
	// segment is masked in full, so the value is always
	// `/mcp/[redacted]` and identifies nothing — use
	// `mcp_server_id` / `mcp_server_name` instead.
	HTTPURLDetailsPath *string `json:"http_url_details_path,omitempty"`
	// The parsed query string parameters of the request URL.
	HTTPURLDetailsQueryString map[string]any `json:"http_url_details_query_string,omitempty"`
	// The URL scheme.
	HTTPURLDetailsScheme *string `json:"http_url_details_scheme,omitempty"`
	// The HTTP protocol version.
	HTTPVersion *string `json:"http_version,omitempty"`
	// How the request was authenticated.
	AuthenticationType *HttpRequestFieldsAuthenticationType `json:"authentication_type,omitempty"`
	// The ID of the authenticated user, if applicable.
	UserID *string `json:"user_id,omitempty"`
	// The response headers returned to the client.
	ResponseHeaders map[string]string `json:"response_headers,omitempty"`
	// Whether the request was served by a Unified API mapping or a raw Proxy API passthrough.
	RequestType *UnifiedProxyApiLogRequestType `json:"request_type,omitempty"`
	// Total time in milliseconds between Truto receiving the request and sending the response.
	Duration *float64 `json:"duration,omitempty"`
	// Time in milliseconds spent fetching data from the upstream API.
	FetchDuration *float64 `json:"fetch_duration,omitempty"`
	// The integrated account that the request was made against.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The integration name that handled the request.
	Integration *string `json:"integration,omitempty"`
	// The Truto method that was called (`list`, `get`, `create`, `update`, `delete`, or a custom method name).
	Method *string `json:"method,omitempty"`
	// The Truto resource that was called.
	Resource *string `json:"resource,omitempty"`
	// Upstream HTTP requests made to third-party APIs during processing.
	RemoteRequests []UnifiedProxyApiLogRemoteRequestsItem `json:"remote_requests,omitempty"`
	// Whether the integrated account's credentials need to be refreshed.
	IntegratedAccountNeedsReauth *bool `json:"integrated_account_needs_reauth,omitempty"`
	// The number of results returned by a list operation.
	ResultCount *int64 `json:"result_count,omitempty"`
}

Log entry produced by an inbound request to the Unified API or Proxy API. Use `request_type` to distinguish a unified-mapping call from a raw proxy passthrough.

type UnifiedProxyApiLogLogType

type UnifiedProxyApiLogLogType string

UnifiedProxyApiLogLogType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	UnifiedProxyApiLogLogTypeUnifiedProxyAPI UnifiedProxyApiLogLogType = "unified_proxy_api"
)

Known UnifiedProxyApiLogLogType values.

type UnifiedProxyApiLogRemoteRequestsItem

type UnifiedProxyApiLogRemoteRequestsItem struct {
	URL    *string `json:"url,omitempty"`
	Method *string `json:"method,omitempty"`
}

UnifiedProxyApiLogRemoteRequestsItem is a Truto API object.

type UnifiedProxyApiLogRequestType

type UnifiedProxyApiLogRequestType string

Whether the request was served by a Unified API mapping or a raw Proxy API passthrough.

Values the SDK does not know about decode unchanged.

const (
	UnifiedProxyApiLogRequestTypeUnified UnifiedProxyApiLogRequestType = "unified"
	UnifiedProxyApiLogRequestTypeProxy   UnifiedProxyApiLogRequestType = "proxy"
)

Known UnifiedProxyApiLogRequestType values.

type UnifiedResource

type UnifiedResource struct {
	// Model is the unified model, e.g. "crm".
	Model string
	// Resource is the resource in that model, e.g. "contacts".
	Resource string
	// IntegratedAccountID is the account to call. Sent as a query parameter.
	IntegratedAccountID string
}

UnifiedResource identifies a unified API resource for one integrated account.

type UsersService

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

UsersService manages users of the team.

func (*UsersService) Get

func (s *UsersService) Get(ctx context.Context, id string, opts ...Option) (*Record, error)

Get fetches one item by ID.

func (*UsersService) List

func (s *UsersService) List(ctx context.Context, opts ...Option) *Iterator[Record]

List returns an iterator over the items. Filter with WithQuery.

type WebhookCreateRequest

type WebhookCreateRequest struct {
	// The URL where the webhook payload will be sent.
	TargetURL string `json:"target_url"`
	// Whether the webhook is active or not.
	IsActive *bool `json:"is_active,omitempty"`
	// The list of event types that the webhook is subscribed to. If not specified, then the webhook will be subscribed to all event types.
	EventTypes []WebhookEventTypes `json:"event_types,omitempty"`
}

WebhookCreateRequest is a Truto API object.

type WebhookCreateResponse

type WebhookCreateResponse struct {
	// The ID of the webhook.
	ID *string `json:"id,omitempty"`
	// The URL where the webhook should send the data.
	TargetURL *string `json:"target_url,omitempty"`
	// Whether the webhook is active or not. Inactive webhooks will not receive any data.
	IsActive *bool `json:"is_active,omitempty"`
	// The ID of the environment that this webhook belongs to.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The list of event types that the webhook is subscribed to.
	EventTypes []WebhookEventTypes `json:"event_types,omitempty"`
	// The date and time when the webhook was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the webhook was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
	// The secret key that will be used to sign the webhook payload.
	Secret *string `json:"secret,omitempty"`
}

WebhookCreateResponse is a Truto API object.

type WebhookEventTypes

type WebhookEventTypes string

The event type of a webhook.

Values the SDK does not know about decode unchanged.

const (
	WebhookEventTypesSyncJobRunCreated                         WebhookEventTypes = "sync_job_run:created"
	WebhookEventTypesSyncJobRunUpdated                         WebhookEventTypes = "sync_job_run:updated"
	WebhookEventTypesSyncJobRunStarted                         WebhookEventTypes = "sync_job_run:started"
	WebhookEventTypesSyncJobRunCompleted                       WebhookEventTypes = "sync_job_run:completed"
	WebhookEventTypesSyncJobRunFailed                          WebhookEventTypes = "sync_job_run:failed"
	WebhookEventTypesSyncJobRunRecord                          WebhookEventTypes = "sync_job_run:record"
	WebhookEventTypesSyncJobRunRateLimited                     WebhookEventTypes = "sync_job_run:rate_limited"
	WebhookEventTypesIntegratedAccountCreated                  WebhookEventTypes = "integrated_account:created"
	WebhookEventTypesIntegratedAccountUpdated                  WebhookEventTypes = "integrated_account:updated"
	WebhookEventTypesIntegratedAccountActive                   WebhookEventTypes = "integrated_account:active"
	WebhookEventTypesIntegratedAccountReactivated              WebhookEventTypes = "integrated_account:reactivated"
	WebhookEventTypesIntegratedAccountAuthenticationError      WebhookEventTypes = "integrated_account:authentication_error"
	WebhookEventTypesIntegratedAccountForbiddenError           WebhookEventTypes = "integrated_account:forbidden_error"
	WebhookEventTypesIntegratedAccountPostInstallError         WebhookEventTypes = "integrated_account:post_install_error"
	WebhookEventTypesIntegratedAccountValidationError          WebhookEventTypes = "integrated_account:validation_error"
	WebhookEventTypesIntegratedAccountPostConnectFormSubmitted WebhookEventTypes = "integrated_account:post_connect_form_submitted"
	WebhookEventTypesLinkTokenConnectionError                  WebhookEventTypes = "link_token:connection_error"
	WebhookEventTypesRecordCreated                             WebhookEventTypes = "record:created"
	WebhookEventTypesRecordUpdated                             WebhookEventTypes = "record:updated"
	WebhookEventTypesRecordDeleted                             WebhookEventTypes = "record:deleted"
	WebhookEventTypesSyncJobCronTriggerFailed                  WebhookEventTypes = "sync_job_cron_trigger:failed"
	WebhookEventTypesBatchJobDryRunCompleted                   WebhookEventTypes = "batch_job:dry_run_completed"
	WebhookEventTypesBatchJobCompleted                         WebhookEventTypes = "batch_job:completed"
	WebhookEventTypesBatchJobDryRunFailed                      WebhookEventTypes = "batch_job:dry_run_failed"
	WebhookEventTypesBatchJobFailed                            WebhookEventTypes = "batch_job:failed"
)

Known WebhookEventTypes values.

type WebhookLog

type WebhookLog struct {
	// The time at which the log entry was recorded.
	Timestamp *string `json:"timestamp,omitempty"`
	// Human-readable summary of the log event.
	Message *string `json:"message,omitempty"`
	// The service that generated the log.
	Service *string `json:"service,omitempty"`
	// The deployment that wrote the log (`production`, `staging`,
	// `staging2`, `thoropass-production`, and per-developer preview
	// deployments). Distinct from `environment_id`, which is the Truto
	// environment the log belongs to: a single `environment_id` can be
	// served by more than one deployment, and `app_env` is what tells
	// them apart. Not an enumerated set — new deployments add values.
	AppEnv *string `json:"app_env,omitempty"`
	// The Truto environment in which the log was generated.
	EnvironmentID *string            `json:"environment_id,omitempty"`
	LogType       *WebhookLogLogType `json:"log_type,omitempty"`
	// Internal log messages captured during request/job processing.
	Logs []string `json:"logs,omitempty"`
	// The Durable Object class that emitted the log.
	DurableObject *WebhookLogDurableObject `json:"durable_object,omitempty"`
	// Which delivery path emitted the row — `deliver` for the first
	// attempt, `alarm` for a scheduled retry. This is not a Truto API
	// method.
	Method *WebhookLogMethod `json:"method,omitempty"`
	// Only ever set to `error`, on a failed or skipped delivery.
	// Absent on a successful delivery — read `webhook_endpoint_status`
	// for the endpoint's response code.
	Status *WebhookLogStatus `json:"status,omitempty"`
	// The event that triggered the webhook delivery. Filter on it with
	// the `event` key of `log_type_filter`.
	EventType *string `json:"event_type,omitempty"`
	// The webhook configuration that fired.
	WebhookID *string `json:"webhook_id,omitempty"`
	// The integrated account the event originated from, when the payload identifies one.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// The integration slug the event originated from, when the payload identifies one.
	Integration *string `json:"integration,omitempty"`
	// The HTTP status code returned by the customer's webhook endpoint. Absent for connection-level failures, where no HTTP response was received.
	WebhookEndpointStatus *int64 `json:"webhook_endpoint_status,omitempty"`
}

Log entry produced when Truto delivers a webhook to a customer endpoint. Delivery runs in the `webhook_delivery` Durable Object; the `webhooks` queue only hands the event to that object and emits no logs of its own, so these rows carry `durable_object`, not `queue`.

type WebhookLogDurableObject

type WebhookLogDurableObject string

The Durable Object class that emitted the log.

Values the SDK does not know about decode unchanged.

const (
	WebhookLogDurableObjectWebhookDelivery WebhookLogDurableObject = "webhook_delivery"
)

Known WebhookLogDurableObject values.

type WebhookLogLogType

type WebhookLogLogType string

WebhookLogLogType is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	WebhookLogLogTypeWebhook WebhookLogLogType = "webhook"
)

Known WebhookLogLogType values.

type WebhookLogMethod

type WebhookLogMethod string

Which delivery path emitted the row — `deliver` for the first attempt, `alarm` for a scheduled retry. This is not a Truto API method.

Values the SDK does not know about decode unchanged.

const (
	WebhookLogMethodDeliver WebhookLogMethod = "deliver"
	WebhookLogMethodAlarm   WebhookLogMethod = "alarm"
)

Known WebhookLogMethod values.

type WebhookLogStatus

type WebhookLogStatus string

Only ever set to `error`, on a failed or skipped delivery. Absent on a successful delivery — read `webhook_endpoint_status` for the endpoint's response code.

Values the SDK does not know about decode unchanged.

const (
	WebhookLogStatusError WebhookLogStatus = "error"
)

Known WebhookLogStatus values.

type WebhookProcessorService

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

WebhookProcessorService forwards an inbound third-party webhook payload to Truto for processing.

func (*WebhookProcessorService) Process

func (s *WebhookProcessorService) Process(ctx context.Context, id string, payload Record, opts ...Option) (*Record, error)

Process sends payload for the environment integration or integrated account id.

type WebhookSchema

type WebhookSchema struct {
	// The ID of the webhook.
	ID *string `json:"id,omitempty"`
	// The URL where the webhook should send the data.
	TargetURL *string `json:"target_url,omitempty"`
	// Whether the webhook is active or not. Inactive webhooks will not receive any data.
	IsActive *bool `json:"is_active,omitempty"`
	// The ID of the environment that this webhook belongs to.
	EnvironmentID *string `json:"environment_id,omitempty"`
	// The list of event types that the webhook is subscribed to.
	EventTypes []WebhookEventTypes `json:"event_types,omitempty"`
	// The date and time when the webhook was created.
	CreatedAt *string `json:"created_at,omitempty"`
	// The date and time when the webhook was last updated.
	UpdatedAt *string `json:"updated_at,omitempty"`
}

WebhookSchema is a Truto API object.

type WebhookTestEventTypes

type WebhookTestEventTypes string

The event type to simulate with `POST /webhook/test`. Every event type the platform emits — each one delivers a payload shaped like the real thing.

Values the SDK does not know about decode unchanged.

const (
	WebhookTestEventTypesIntegratedAccountCreated                  WebhookTestEventTypes = "integrated_account:created"
	WebhookTestEventTypesIntegratedAccountUpdated                  WebhookTestEventTypes = "integrated_account:updated"
	WebhookTestEventTypesIntegratedAccountDeleted                  WebhookTestEventTypes = "integrated_account:deleted"
	WebhookTestEventTypesIntegratedAccountActive                   WebhookTestEventTypes = "integrated_account:active"
	WebhookTestEventTypesIntegratedAccountPostConnectFormSubmitted WebhookTestEventTypes = "integrated_account:post_connect_form_submitted"
	WebhookTestEventTypesIntegratedAccountPostInstallError         WebhookTestEventTypes = "integrated_account:post_install_error"
	WebhookTestEventTypesIntegratedAccountValidationError          WebhookTestEventTypes = "integrated_account:validation_error"
	WebhookTestEventTypesIntegratedAccountAuthenticationError      WebhookTestEventTypes = "integrated_account:authentication_error"
	WebhookTestEventTypesIntegratedAccountForbiddenError           WebhookTestEventTypes = "integrated_account:forbidden_error"
	WebhookTestEventTypesIntegratedAccountReactivated              WebhookTestEventTypes = "integrated_account:reactivated"
	WebhookTestEventTypesLinkTokenConnectionError                  WebhookTestEventTypes = "link_token:connection_error"
	WebhookTestEventTypesEnvironmentIntegrationCreated             WebhookTestEventTypes = "environment_integration:created"
	WebhookTestEventTypesEnvironmentIntegrationUpdated             WebhookTestEventTypes = "environment_integration:updated"
	WebhookTestEventTypesEnvironmentIntegrationDeleted             WebhookTestEventTypes = "environment_integration:deleted"
	WebhookTestEventTypesEnvironmentUnifiedModelCreated            WebhookTestEventTypes = "environment_unified_model:created"
	WebhookTestEventTypesEnvironmentUnifiedModelUpdated            WebhookTestEventTypes = "environment_unified_model:updated"
	WebhookTestEventTypesEnvironmentUnifiedModelDeleted            WebhookTestEventTypes = "environment_unified_model:deleted"
	WebhookTestEventTypesAPITokenCreated                           WebhookTestEventTypes = "api_token:created"
	WebhookTestEventTypesAPITokenDeleted                           WebhookTestEventTypes = "api_token:deleted"
	WebhookTestEventTypesSyncJobRunCreated                         WebhookTestEventTypes = "sync_job_run:created"
	WebhookTestEventTypesSyncJobRunUpdated                         WebhookTestEventTypes = "sync_job_run:updated"
	WebhookTestEventTypesSyncJobRunStarted                         WebhookTestEventTypes = "sync_job_run:started"
	WebhookTestEventTypesSyncJobRunCompleted                       WebhookTestEventTypes = "sync_job_run:completed"
	WebhookTestEventTypesSyncJobRunFailed                          WebhookTestEventTypes = "sync_job_run:failed"
	WebhookTestEventTypesSyncJobRunDeleted                         WebhookTestEventTypes = "sync_job_run:deleted"
	WebhookTestEventTypesSyncJobRunRecord                          WebhookTestEventTypes = "sync_job_run:record"
	WebhookTestEventTypesSyncJobRunRecordError                     WebhookTestEventTypes = "sync_job_run:record_error"
	WebhookTestEventTypesSyncJobRunRateLimited                     WebhookTestEventTypes = "sync_job_run:rate_limited"
	WebhookTestEventTypesRecordCreated                             WebhookTestEventTypes = "record:created"
	WebhookTestEventTypesRecordUpdated                             WebhookTestEventTypes = "record:updated"
	WebhookTestEventTypesRecordDeleted                             WebhookTestEventTypes = "record:deleted"
	WebhookTestEventTypesRecordMeta                                WebhookTestEventTypes = "record:meta"
	WebhookTestEventTypesSyncJobCronTriggerFailed                  WebhookTestEventTypes = "sync_job_cron_trigger:failed"
	WebhookTestEventTypesBatchJobDryRunCompleted                   WebhookTestEventTypes = "batch_job:dry_run_completed"
	WebhookTestEventTypesBatchJobCompleted                         WebhookTestEventTypes = "batch_job:completed"
	WebhookTestEventTypesBatchJobDryRunFailed                      WebhookTestEventTypes = "batch_job:dry_run_failed"
	WebhookTestEventTypesBatchJobFailed                            WebhookTestEventTypes = "batch_job:failed"
)

Known WebhookTestEventTypes values.

type WebhookTestRequest

type WebhookTestRequest struct {
	// ID of the webhook you want to send the test event to.
	ID string `json:"id"`
	// The event type to simulate. Defaults to `integrated_account:created`.
	EventType *WebhookTestEventTypes `json:"event_type,omitempty"`
	// Build the payload from this connected account instead of placeholder data. Must belong to the same environment as the webhook. Credentials are stripped before delivery.
	IntegratedAccountID *string `json:"integrated_account_id,omitempty"`
	// Values deep-merged over the generated payload, for pinning fields your handler branches on.
	Payload map[string]any `json:"payload,omitempty"`
}

WebhookTestRequest is a Truto API object.

type WebhookTestResponse

type WebhookTestResponse struct {
	Success *bool `json:"success,omitempty"`
	// The event type that was delivered.
	EventType *WebhookTestEventTypes `json:"event_type,omitempty"`
	// The payload that was delivered, after any overrides.
	Payload map[string]any `json:"payload,omitempty"`
}

WebhookTestResponse is a Truto API object.

type WebhookUpdateRequest

type WebhookUpdateRequest struct {
	// The URL where the webhook payload will be sent.
	TargetURL *string `json:"target_url,omitempty"`
	// Whether the webhook is active or not.
	IsActive *bool `json:"is_active,omitempty"`
	// The list of event types that the webhook is subscribed to. If not specified, then the webhook will be subscribed to all event types.
	EventTypes []WebhookEventTypes `json:"event_types,omitempty"`
}

WebhookUpdateRequest is a Truto API object.

type WebhooksService

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

WebhooksService manages outbound webhooks Truto sends to you.

func (*WebhooksService) Create

Create creates a webhook. The response includes the signing secret, which is not returned again.

func (*WebhooksService) Delete

func (s *WebhooksService) Delete(ctx context.Context, id string, opts ...Option) (*DeleteResponse, error)

Delete deletes a webhook.

func (*WebhooksService) Get

func (s *WebhooksService) Get(ctx context.Context, id string, opts ...Option) (*WebhookSchema, error)

Get fetches a webhook.

func (*WebhooksService) List

func (s *WebhooksService) List(ctx context.Context, opts ...Option) *Iterator[WebhookSchema]

List returns an iterator over webhooks.

func (*WebhooksService) Test

Test sends a test event to a webhook.

func (*WebhooksService) Update

func (s *WebhooksService) Update(ctx context.Context, id string, body WebhookUpdateRequest, opts ...Option) (*WebhookSchema, error)

Update changes a webhook.

type WorkflowConfigSchema

type WorkflowConfigSchema struct {
	// JSONata condition evaluated before executing workflow steps.
	RunIf *string              `json:"run_if,omitempty"`
	Steps []WorkflowStepSchema `json:"steps"`
}

Workflow execution configuration.

type WorkflowCreateSchema

type WorkflowCreateSchema struct {
	// Optional workflow ID. If not provided, it will be generated.
	ID *string `json:"id,omitempty"`
	// The environment in which this workflow is created.
	EnvironmentID string `json:"environment_id"`
	// The event that triggers this workflow.
	TriggerName string `json:"trigger_name"`
	// Workflow execution configuration, as an object or a JSON string of one. A string that isn't valid JSON, or a config of another shape, is a `400`.
	Config WorkflowConfigSchema `json:"config"`
}

WorkflowCreateSchema is a Truto API object.

type WorkflowDeleteResponse

type WorkflowDeleteResponse struct {
	Success *bool `json:"success,omitempty"`
}

WorkflowDeleteResponse is a Truto API object.

type WorkflowRunResponse

type WorkflowRunResponse struct {
	ID            string                    `json:"id"`
	WorkflowID    string                    `json:"workflow_id"`
	EnvironmentID string                    `json:"environment_id"`
	Status        WorkflowRunResponseStatus `json:"status"`
	Result        *WorkflowRunResultSchema  `json:"result,omitempty"`
	RetryAttempt  float64                   `json:"retry_attempt"`
	CreatedAt     string                    `json:"created_at"`
	UpdatedAt     string                    `json:"updated_at"`
	StartedAt     *string                   `json:"started_at,omitempty"`
	FinishedAt    *string                   `json:"finished_at,omitempty"`
}

WorkflowRunResponse is a Truto API object.

type WorkflowRunResponseStatus

type WorkflowRunResponseStatus string

WorkflowRunResponseStatus is an open string enum.

Values the SDK does not know about decode unchanged.

const (
	WorkflowRunResponseStatusCreated   WorkflowRunResponseStatus = "created"
	WorkflowRunResponseStatusRunning   WorkflowRunResponseStatus = "running"
	WorkflowRunResponseStatusCompleted WorkflowRunResponseStatus = "completed"
	WorkflowRunResponseStatusFailed    WorkflowRunResponseStatus = "failed"
)

Known WorkflowRunResponseStatus values.

type WorkflowRunResultSchema

type WorkflowRunResultSchema struct {
	Steps   []WorkflowRunStepSchema `json:"steps"`
	Success bool                    `json:"success"`
	Error   *string                 `json:"error,omitempty"`
}

WorkflowRunResultSchema is a Truto API object.

type WorkflowRunStepSchema

type WorkflowRunStepSchema struct {
	Type    string         `json:"type"`
	Action  string         `json:"action"`
	Success bool           `json:"success"`
	Error   *string        `json:"error,omitempty"`
	Result  map[string]any `json:"result,omitempty"`
}

WorkflowRunStepSchema is a Truto API object.

type WorkflowRunsService

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

WorkflowRunsService manages workflow runs.

func (*WorkflowRunsService) Create

func (s *WorkflowRunsService) Create(ctx context.Context, body Record, opts ...Option) (*WorkflowRunResponse, error)

Create creates an item.

func (*WorkflowRunsService) Delete

func (s *WorkflowRunsService) Delete(ctx context.Context, id string, opts ...Option) (*Record, error)

Delete deletes an item.

func (*WorkflowRunsService) Get

Get fetches one item by ID.

func (*WorkflowRunsService) List

List returns an iterator over the items. Filter with WithQuery.

func (*WorkflowRunsService) Update

func (s *WorkflowRunsService) Update(ctx context.Context, id string, body Record, opts ...Option) (*WorkflowRunResponse, error)

Update changes an item. Only the fields that are set are sent.

type WorkflowSchema

type WorkflowSchema struct {
	ID            string               `json:"id"`
	EnvironmentID string               `json:"environment_id"`
	TriggerName   string               `json:"trigger_name"`
	Config        WorkflowConfigSchema `json:"config"`
	CreatedAt     *string              `json:"created_at,omitempty"`
	UpdatedAt     *string              `json:"updated_at,omitempty"`
}

WorkflowSchema is a Truto API object.

type WorkflowStepSchema

type WorkflowStepSchema struct {
	// Step execution type.
	Type WorkflowStepSchemaType `json:"type"`
	// Action executed by the step.
	Action string `json:"action"`
	// Optional cron expression for scheduled execution, in UTC. When set, the step creates a sync job cron trigger instead of starting a run, so the trigger's check applies: the step fails if the expression doesn't parse or its next two runs are less than 5 minutes apart.
	CronExpression *string `json:"cron_expression,omitempty"`
	// JSONata expression evaluated at runtime to generate the step execution payload.
	Config string `json:"config"`
}

A single executable step in a workflow.

type WorkflowStepSchemaType

type WorkflowStepSchemaType string

Step execution type.

Values the SDK does not know about decode unchanged.

const (
	WorkflowStepSchemaTypeRun WorkflowStepSchemaType = "run"
)

Known WorkflowStepSchemaType values.

type WorkflowsService

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

WorkflowsService manages workflows.

func (*WorkflowsService) Create

Create creates an item.

func (*WorkflowsService) Delete

func (s *WorkflowsService) Delete(ctx context.Context, id string, opts ...Option) (*WorkflowDeleteResponse, error)

Delete deletes an item.

func (*WorkflowsService) Get

func (s *WorkflowsService) Get(ctx context.Context, id string, opts ...Option) (*WorkflowSchema, error)

Get fetches one item by ID.

func (*WorkflowsService) List

List returns an iterator over the items. Filter with WithQuery.

func (*WorkflowsService) Update

func (s *WorkflowsService) Update(ctx context.Context, id string, body Record, opts ...Option) (*WorkflowSchema, error)

Update changes an item. Only the fields that are set are sent.

Directories

Path Synopsis
examples
errors_and_retries command
Shows timeouts, retry hooks and error handling.
Shows timeouts, retry hooks and error handling.
link_token command
Creates a link token for a tenant and lists the tenant's connected accounts.
Creates a link token for a tenant and lists the tenant's connected accounts.
proxy command
Reads an integration's own API through the Proxy API: the first page of a resource and one record by ID.
Reads an integration's own API through the Proxy API: the first page of a resource and one record by ID.
unified_list command
Lists CRM contacts for one integrated account through the Unified API, page by page, and decodes them into a local type.
Lists CRM contacts for one integrated account through the Unified API, page by page, and decodes them into a local type.

Jump to

Keyboard shortcuts

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