infrawrench

package module
v1.39.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 13 Imported by: 0

README

github.com/Infrawrench/infrawrench-go

Generated Go client for the Infrawrench API.

API version 1.39.0. A Go module takes its version from a VCS tag rather than from a manifest field, so the API version lives in this README and in the APIVersion constant — check that constant, not the module tag, when you need to know which API shape you have.

Do not edit this module by hand — it is regenerated from openapi.json and is not checked into the repository. Run pnpm --filter @infrawrench/web generate:sdk to rebuild it; the generator lives in app/packages/web/scripts/sdk.

Install

go get github.com/Infrawrench/infrawrench-go

Go 1.24 or newer. No dependencies: the module requires nothing but the standard library, and go.mod has no require block at all.

Usage

package main

import (
	"context"
	"errors"
	"fmt"
	"os"

	"github.com/Infrawrench/infrawrench-go"
)

func main() {
	ctx := context.Background()
	client := infrawrench.NewAPIV1Client(
		infrawrench.WithAPIKey(os.Getenv("INFRAWRENCH_API_KEY")),
		infrawrench.WithOrgID(os.Getenv("INFRAWRENCH_ORG_ID")),
	)

	accounts, err := client.Accounts.List(ctx, nil)
	if err != nil {
		var apiErr *infrawrench.APIError
		if errors.As(err, &apiErr) {
			fmt.Println(apiErr.StatusCode, apiErr.Code, string(apiErr.Body))
		}
		return
	}
	fmt.Println(len(accounts))
}

Conventions

  • Context first. Every call takes a context.Context as its first argument and a variadic ...RequestOption as its last. Timeouts and cancellation belong on the context, so there is no per-call timeout option.
  • Dotted namespaces. Calls mirror the URL structure, so POST /api/org/{orgId}/accounts/{id}/sync is client.Accounts.Sync(...).
  • Parameters. A call with at least one mandatory parameter takes its params struct by value; a call where everything is optional takes a pointer, so nil means "no arguments". A call with no parameters at all takes neither.
  • Organization id. Pass WithOrgID once when constructing the client and every scoped call can leave OrgID unset; set OrgID on an individual call to override it. With neither, the call returns an error wrapping ErrMissingPathParam rather than sending a malformed URL.
  • Optional fields are pointers. Go cannot tell an omitted false from a deliberate one, so anything the wire may omit or null is a *T. Slices and maps keep their own nil.
  • Errors are returned, never panicked. Any non-2xx response comes back as *APIError, carrying StatusCode, the raw Body, the decoded Data and the machine-readable Code when the API sends one. Use errors.As, or the AsAPIError shorthand.
  • Downloads stream. An endpoint that returns a file returns an io.ReadCloser; close it.

Scope

This module covers the published API surface only. Operations marked x-internal in the spec — the admin surface, webhook receivers, desktop sync, push registration, and the browser auth redirects — are not generated, so there is no namespace for them to be called through.

Topics: infrawrench, sdk, api-client, openapi, infrastructure, cloud, devops.

License

MIT — see LICENSE. Copyright (c) 2026 Infrawrench LLC.

Note that this client is more permissively licensed than the service it talks to: the Infrawrench source is BUSL-1.1, but the generated clients are MIT so you can link one into your own software without inheriting those terms.

Maintained by Infrawrench LLC astrid@infrawrench.com. Documentation: https://infrawrench.com/docs/team-and-billing/client-sdks. Issues: https://github.com/Infrawrench/Infrawrench/issues

Documentation

Overview

Package infrawrench is a client for the Infrawrench API.

Construct a client, then call through the namespaces that mirror the URL structure:

client := infrawrench.NewAPIV1Client(
	infrawrench.WithAPIKey(os.Getenv("INFRAWRENCH_API_KEY")),
	infrawrench.WithOrgID(os.Getenv("INFRAWRENCH_ORG_ID")),
)
accounts, err := client.Accounts.List(ctx, nil)

Every call takes a context.Context first and a variadic list of RequestOption last. Non-2xx responses come back as *APIError.

Index

Constants

View Source
const APIVersion = "1.39.0"

APIVersion is info.version from the spec this package was generated from.

A Go module takes its version from a VCS tag rather than from a manifest field, so there is nowhere else for the API version to live — this constant is what you compare against when you need to know which API shape you have.

View Source
const DefaultBaseURL = "https://app.infrawrench.com"

DefaultBaseURL is the deployment a client talks to unless WithBaseURL says otherwise. It is the first server the OpenAPI document advertises.

Variables

View Source
var ErrMissingPathParam = errors.New("infrawrench: missing path parameter")

ErrMissingPathParam is returned when a path parameter was supplied by neither the call nor the client configuration. Match it with errors.Is.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	// StatusCode is the HTTP status code, for example 403.
	StatusCode int
	// Status is the full HTTP status line, for example "403 Forbidden".
	Status string
	// Code is the value of the body's "code" field, or "" when absent.
	Code string
	// Message is the body's "error" or "message" field, falling back to the
	// status line.
	Message string
	// Body is the raw response body. Always populated, even when it is not
	// JSON, so nothing is lost when an intermediary answers instead of the API.
	Body []byte
	// Data is Body decoded as JSON, or nil when the body was not valid JSON.
	Data any
	// Method is the HTTP method of the request that failed.
	Method string
	// URL is the fully resolved URL of the request that failed.
	URL string
}

APIError is returned for every non-2xx response.

Branch on Code, not on Message: Code is the machine-readable discriminator the API sends (for example "reauthentication_required" on a step-up 403), while Message is prose that may change.

func AsAPIError

func AsAPIError(err error) (*APIError, bool)

AsAPIError reports whether err is, or wraps, an *APIError. It is a shorthand for errors.As with the right variable already declared.

func (*APIError) Error

func (e *APIError) Error() string

Error implements the error interface.

type APIKey

type APIKey struct {
	ID         string       `json:"id"`
	Name       string       `json:"name"`
	Prefix     string       `json:"prefix"`
	Scopes     []Permission `json:"scopes"`
	LastUsedAt *string      `json:"lastUsedAt"`
	ExpiresAt  *string      `json:"expiresAt"`
	RevokedAt  *string      `json:"revokedAt"`
	// LegacyHashSunsetAt: Cutover date past which a key still on the legacy
	// SHA-256 hash will be refused. Null once rehashed to HMAC.
	LegacyHashSunsetAt *string `json:"legacyHashSunsetAt"`
	// NeedsRotation: True when this key is still hashed with the legacy SHA-256
	// scheme and should be rotated before `legacyHashSunsetAt`.
	NeedsRotation bool   `json:"needsRotation"`
	CreatedAt     string `json:"createdAt"`
}

APIKey is the `ApiKey` schema.

Spec schema: `ApiKey`.

type APIKeysCreateParams

type APIKeysCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreateAPIKeyRequest
}

APIKeysCreateParams holds the parameters for `client.apiKeys.create`.

type APIKeysListParams

type APIKeysListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

APIKeysListParams holds the parameters for `client.apiKeys.list`.

Every field is optional; pass nil to take the defaults.

type APIKeysNamespace

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

APIKeysNamespace is `client.apiKeys`.

func (*APIKeysNamespace) Create

Create: Create an API key (plaintext returned once)

POST /api/org/{orgId}/api-keys

func (*APIKeysNamespace) List

func (n *APIKeysNamespace) List(ctx context.Context, params *APIKeysListParams, opts ...RequestOption) ([]APIKey, error)

List: List API keys (no plaintext)

GET /api/org/{orgId}/api-keys

func (*APIKeysNamespace) Revoke

func (n *APIKeysNamespace) Revoke(ctx context.Context, params APIKeysRevokeParams, opts ...RequestOption) (*OK, error)

Revoke: Revoke an API key

POST /api/org/{orgId}/api-keys/{id}/revoke

func (*APIKeysNamespace) Rotate

Rotate: Rotate an API key (revokes old, returns new)

POST /api/org/{orgId}/api-keys/{id}/rotate

Raises on 404: Not found

type APIKeysRevokeParams

type APIKeysRevokeParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

APIKeysRevokeParams holds the parameters for `client.apiKeys.revoke`.

type APIKeysRotateParams

type APIKeysRotateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

APIKeysRotateParams holds the parameters for `client.apiKeys.rotate`.

type APIV1Client

type APIV1Client struct {

	// AccessRequests: `client.accessRequests`.
	AccessRequests *AccessRequestsNamespace
	// AccessReview: `client.accessReview`.
	AccessReview *AccessReviewNamespace
	// Accounts: `client.accounts`.
	Accounts *AccountsNamespace
	// Agent: `client.agent`.
	Agent *AgentNamespace
	// AgentRegistrations: `client.agentRegistrations`.
	AgentRegistrations *AgentRegistrationsNamespace
	// Agents: `client.agents`.
	Agents *AgentsNamespace
	// AlertRules: `client.alertRules`.
	AlertRules *AlertRulesNamespace
	// APIKeys: `client.apiKeys`.
	APIKeys *APIKeysNamespace
	// Apps: `client.apps`.
	Apps *AppsNamespace
	// Artifacts: `client.artifacts`.
	Artifacts *ArtifactsNamespace
	// Associations: `client.associations`.
	Associations *AssociationsNamespace
	// AuditLogs: `client.auditLogs`.
	AuditLogs *AuditLogsNamespace
	// Auth: `client.auth`.
	Auth *AuthNamespace
	// Backups: `client.backups`.
	Backups *BackupsNamespace
	// Bastions: `client.bastions`.
	Bastions *BastionsNamespace
	// Billing: `client.billing`.
	Billing *BillingNamespace
	// BillingRules: `client.billingRules`.
	BillingRules *BillingRulesNamespace
	// BlastRadius: `client.blastRadius`.
	BlastRadius *BlastRadiusNamespace
	// Budgets: `client.budgets`.
	Budgets *BudgetsNamespace
	// BusinessMetrics: `client.businessMetrics`.
	BusinessMetrics *BusinessMetricsNamespace
	// Calendar: `client.calendar`.
	Calendar *CalendarNamespace
	// ChangeFreezes: `client.changeFreezes`.
	ChangeFreezes *ChangeFreezesNamespace
	// Changes: `client.changes`.
	Changes *ChangesNamespace
	// Chat: `client.chat`.
	Chat *ChatNamespace
	// Commitments: `client.commitments`.
	Commitments *CommitmentsNamespace
	// Config: `client.config`.
	Config *ConfigNamespace
	// Connect: `client.connect`.
	Connect *ConnectNamespace
	// CostAlerts: `client.costAlerts`.
	CostAlerts *CostAlertsNamespace
	// CostAnnotations: `client.costAnnotations`.
	CostAnnotations *CostAnnotationsNamespace
	// CostCentres: `client.costCentres`.
	CostCentres *CostCentresNamespace
	// CostExports: `client.costExports`.
	CostExports *CostExportsNamespace
	// CostReportFolders: `client.costReportFolders`.
	CostReportFolders *CostReportFoldersNamespace
	// CostReportNotifications: `client.costReportNotifications`.
	CostReportNotifications *CostReportNotificationsNamespace
	// CostReports: `client.costReports`.
	CostReports *CostReportsNamespace
	// CostScenarios: `client.costScenarios`.
	CostScenarios *CostScenariosNamespace
	// Costs: `client.costs`.
	Costs *CostsNamespace
	// CredentialHygiene: `client.credentialHygiene`.
	CredentialHygiene *CredentialHygieneNamespace
	// Credits: `client.credits`.
	Credits *CreditsNamespace
	// Currency: `client.currency`.
	Currency *CurrencyNamespace
	// CustomGraphs: `client.customGraphs`.
	CustomGraphs *CustomGraphsNamespace
	// Dashboards: `client.dashboards`.
	Dashboards *DashboardsNamespace
	// DependencyGraph: `client.dependencyGraph`.
	DependencyGraph *DependencyGraphNamespace
	// Deployments: `client.deployments`.
	Deployments *DeploymentsNamespace
	// Digest: `client.digest`.
	Digest *DigestNamespace
	// DNS: `client.dns`.
	DNS *DNSNamespace
	// Docker: `client.docker`.
	Docker *DockerNamespace
	// EnvironmentDiff: `client.environmentDiff`.
	EnvironmentDiff *EnvironmentDiffNamespace
	// Environments: `client.environments`.
	Environments *EnvironmentsNamespace
	// Expiring: `client.expiring`.
	Expiring *ExpiringNamespace
	// Iac: `client.iac`.
	Iac *IacNamespace
	// Incidents: `client.incidents`.
	Incidents *IncidentsNamespace
	// Invitations: `client.invitations`.
	Invitations *InvitationsNamespace
	// Invoices: `client.invoices`.
	Invoices *InvoicesNamespace
	// Jira: `client.jira`.
	Jira *JiraNamespace
	// KV: `client.kv`.
	KV *KVNamespace
	// Leases: `client.leases`.
	Leases *LeasesNamespace
	// Linear: `client.linear`.
	Linear *LinearNamespace
	// LogWorkspaces: `client.logWorkspaces`.
	LogWorkspaces *LogWorkspacesNamespace
	// ManagedAccounts: `client.managedAccounts`.
	ManagedAccounts *ManagedAccountsNamespace
	// MetricAlerts: `client.metricAlerts`.
	MetricAlerts *MetricAlertsNamespace
	// Moment: `client.moment`.
	Moment *MomentNamespace
	// Msteams: `client.msteams`.
	Msteams *MsteamsNamespace
	// NetworkFlows: `client.networkFlows`.
	NetworkFlows *NetworkFlowsNamespace
	// OnCall: `client.onCall`.
	OnCall *OnCallNamespace
	// Orgs: `client.orgs`.
	Orgs *OrgsNamespace
	// Orphans: `client.orphans`.
	Orphans *OrphansNamespace
	// Ownership: `client.ownership`.
	Ownership *OwnershipNamespace
	// Pages: `client.pages`.
	Pages *PagesNamespace
	// Posture: `client.posture`.
	Posture *PostureNamespace
	// Probes: `client.probes`.
	Probes *ProbesNamespace
	// Profile: `client.profile`.
	Profile *ProfileNamespace
	// QueryMonitors: `client.queryMonitors`.
	QueryMonitors *QueryMonitorsNamespace
	// Quotas: `client.quotas`.
	Quotas *QuotasNamespace
	// Resources: `client.resources`.
	Resources *ResourcesNamespace
	// Rightsizing: `client.rightsizing`.
	Rightsizing *RightsizingNamespace
	// Runbooks: `client.runbooks`.
	Runbooks *RunbooksNamespace
	// SavedCostFilters: `client.savedCostFilters`.
	SavedCostFilters *SavedCostFiltersNamespace
	// Schedules: `client.schedules`.
	Schedules *SchedulesNamespace
	// Search: `client.search`.
	Search *SearchNamespace
	// SessionRecordings: `client.sessionRecordings`.
	SessionRecordings *SessionRecordingsNamespace
	// SFTP: `client.sftp`.
	SFTP *SFTPNamespace
	// SharedConsoles: `client.sharedConsoles`.
	SharedConsoles *SharedConsolesNamespace
	// Slack: `client.slack`.
	Slack *SlackNamespace
	// SQL: `client.sql`.
	SQL *SQLNamespace
	// SSHFanout: `client.sshFanout`.
	SSHFanout *SSHFanoutNamespace
	// SSHKeys: `client.sshKeys`.
	SSHKeys *SSHKeysNamespace
	// SSHTunnels: `client.sshTunnels`.
	SSHTunnels *SSHTunnelsNamespace
	// Status: `client.status`.
	Status *StatusNamespace
	// StatusIncidents: `client.statusIncidents`.
	StatusIncidents *StatusIncidentsNamespace
	// StatusPages: `client.statusPages`.
	StatusPages *StatusPagesNamespace
	// Storage: `client.storage`.
	Storage *StorageNamespace
	// TagPolicy: `client.tagPolicy`.
	TagPolicy *TagPolicyNamespace
	// Team: `client.team`.
	Team *TeamNamespace
	// Wallboard: `client.wallboard`.
	Wallboard *WallboardNamespace
	// WorkflowApprovals: `client.workflowApprovals`.
	WorkflowApprovals *WorkflowApprovalsNamespace
	// WorkflowSecrets: `client.workflowSecrets`.
	WorkflowSecrets *WorkflowSecretsNamespace
	// Workflows: `client.workflows`.
	Workflows *WorkflowsNamespace
	// contains filtered or unexported fields
}

APIV1Client is a client for the Infrawrench API.

Calls hang off the namespace fields below, which mirror the URL structure — `client.Accounts.Credentials.Get(ctx, …)`. The zero value is not usable; build one with NewAPIV1Client.

func NewAPIV1Client

func NewAPIV1Client(opts ...ClientOption) *APIV1Client

NewAPIV1Client builds a client. With no options it talks to https://app.infrawrench.com anonymously, which is rarely what you want: pass WithAPIKey, and WithOrgID if you would rather not repeat the organization id on every call.

func (*APIV1Client) BaseURL

func (c *APIV1Client) BaseURL() string

BaseURL reports the normalized base URL every call is sent to.

type AcceptInvitationRequest

type AcceptInvitationRequest struct {
	Token string `json:"token"`
}

AcceptInvitationRequest is the `AcceptInvitationRequest` schema.

type AcceptInvitationResponse

type AcceptInvitationResponse struct {
	Organization AcceptInvitationResponseOrganization `json:"organization"`
}

AcceptInvitationResponse is the `AcceptInvitationResponse` schema.

type AcceptInvitationResponseOrganization

type AcceptInvitationResponseOrganization struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
}

AcceptInvitationResponseOrganization is an object the spec declares inline.

type AccessDecision added in v0.43.0

type AccessDecision struct {
	// Note: Shown on the request and in the audit log.
	Note *string `json:"note,omitempty"`
}

AccessDecision is the `AccessDecision` schema.

type AccessDecisionConflict added in v0.43.0

type AccessDecisionConflict struct {
	Error string `json:"error"`
}

AccessDecisionConflict is the `AccessDecisionConflict` schema.

type AccessDecisionForbidden added in v0.43.0

type AccessDecisionForbidden struct {
	Error string `json:"error"`
	// Code: One of "self_approval", "exceeds_approver".
	Code string `json:"code"`
	// Missing: For `exceeds_approver`: the permissions the approver does not
	// hold.
	Missing []string `json:"missing,omitempty"`
}

AccessDecisionForbidden is the `AccessDecisionForbidden` schema.

type AccessFinding added in v1.16.0

type AccessFinding struct {
	// ResourceID: Infrawrench resource id the finding is on.
	ResourceID string `json:"resourceId"`
	// RuleID: Which rule was raised. Half of a dismissal's key, alongside the
	// resource id. The `access-review:` prefix is reserved so these can share
	// the posture dismissal store without colliding with plugin-declared posture
	// rule ids.
	//
	// One of "access-review:stale-principal", "access-review:admin-principal",
	// "access-review:key-past-rotation", "access-review:no-recorded-owner",
	// "access-review:no-mfa".
	RuleID string `json:"ruleId"`
	Title  string `json:"title"`
	// Severity: How bad the finding is. `critical` and `high` findings ride the
	// posture alert window; `medium` and `low` are review work surfaced on the
	// access review screen and in the weekly digest only.
	//
	// One of "critical", "high", "medium", "low".
	Severity string `json:"severity"`
	// Reason: Why this principal is flagged, in a sentence.
	Reason    string          `json:"reason"`
	Principal AccessPrincipal `json:"principal"`
}

AccessFinding is the `AccessFinding` schema.

type AccessPrincipal added in v1.16.0

type AccessPrincipal struct {
	// ResourceID: Infrawrench resource id.
	ResourceID       string   `json:"resourceId"`
	PluginID         PluginID `json:"pluginId"`
	PluginName       string   `json:"pluginName"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
	AccountName      string   `json:"accountName"`
	DisplayName      string   `json:"displayName"`
	// ExternalID: Provider-native id, when known.
	ExternalID *string `json:"externalId"`
	// Role: What kind of identity the principal is, from the resource type's
	// `principalRole` declaration. Grouping and labels only — it is not a
	// permission model.
	//
	// One of "user", "group", "role", "service-account", "key", "binding".
	Role string `json:"role"`
	// LastUsedAt: When the principal was last used, or null when the review has
	// no evidence.
	LastUsedAt        *string `json:"lastUsedAt"`
	DaysSinceLastUsed *int64  `json:"daysSinceLastUsed"`
	// Activity: What could be established about the principal's last use.
	// `unknown` means the resource type declares no last-used field, or the
	// provider stored nothing parseable — it is a first-class answer and is
	// never reported as `stale`.
	//
	// One of "active", "stale", "unknown".
	Activity  string  `json:"activity"`
	CreatedAt *string `json:"createdAt"`
	AgeDays   *int64  `json:"ageDays"`
	// Admin: True when the type's declared admin indicator matched; null when
	// the type declares none.
	Admin *bool `json:"admin"`
	// MFA: Multi-factor state, only on types that declare an MFA field. Null
	// everywhere else — "not synced" is not "MFA is off".
	MFA *bool `json:"mfa"`
	// Parent: The principal this one hangs off — a key's owner, a binding's
	// subject.
	Parent *string               `json:"parent"`
	Owner  *AccessPrincipalOwner `json:"owner"`
	// RevokeActionID: The plugin action that revokes this principal, when the
	// type declares one. Dispatch it through POST /resources/invoke-action; null
	// means the provider offers no revocation Infrawrench can invoke.
	RevokeActionID *string `json:"revokeActionId"`
}

AccessPrincipal is the `AccessPrincipal` schema.

type AccessPrincipalOwner added in v1.16.0

type AccessPrincipalOwner struct {
	// UserID: Infrawrench user id when the owner is a member.
	UserID *string `json:"userId"`
	// DisplayName: Member name, or the free-text owner label.
	DisplayName string `json:"displayName"`
	// IsLabel: True when the owner is a label rather than a routable member.
	IsLabel   bool    `json:"isLabel"`
	TicketURL *string `json:"ticketUrl"`
	Purpose   *string `json:"purpose"`
}

AccessPrincipalOwner: Who owns the resource, from the resource-ownership record. Null when nobody is named.

The API may send null in its place.

type AccessRequest added in v0.43.0

type AccessRequest struct {
	ID       string  `json:"id"`
	UserID   string  `json:"userId"`
	UserName *string `json:"userName"`
	// Permissions: The permission strings being asked for.
	Permissions []string `json:"permissions"`
	Reason      string   `json:"reason"`
	// DurationMinutes: How long the elevation lasts once granted.
	DurationMinutes int64 `json:"durationMinutes"`
	// Status: `pending` (awaiting a decision), `approved`, `denied`, or
	// `expired` (nobody decided in time, or the requester withdrew it). An
	// approved row is only *granting* permissions while `active` is true.
	//
	// One of "pending", "approved", "denied", "expired".
	Status string `json:"status"`
	// ExpiresAt: When an undecided request stops being decidable.
	ExpiresAt       string  `json:"expiresAt"`
	DecidedAt       *string `json:"decidedAt"`
	DecidedByUserID *string `json:"decidedByUserId"`
	DecidedByName   *string `json:"decidedByName"`
	DecisionNote    *string `json:"decisionNote"`
	GrantedAt       *string `json:"grantedAt"`
	// GrantExpiresAt: When the elevation lapses.
	GrantExpiresAt *string `json:"grantExpiresAt"`
	RevokedAt      *string `json:"revokedAt"`
	RevokedByName  *string `json:"revokedByName"`
	// Active: True when this row is granting permissions right now. Evaluated,
	// never swept — a grant stops applying the instant it lapses.
	Active    bool   `json:"active"`
	CreatedAt string `json:"createdAt"`
}

AccessRequest is the `AccessRequest` schema.

type AccessRequestCatalog added in v0.43.0

type AccessRequestCatalog struct {
	Permissions []string `json:"permissions"`
	// Held: Permissions the caller already holds; asking for these changes
	// nothing.
	Held            []string `json:"held"`
	MinGrantMinutes int64    `json:"minGrantMinutes"`
	MaxGrantMinutes int64    `json:"maxGrantMinutes"`
}

AccessRequestCatalog is the `AccessRequestCatalog` schema.

type AccessRequestCreate added in v0.43.0

type AccessRequestCreate struct {
	Permissions     []string `json:"permissions"`
	Reason          string   `json:"reason"`
	DurationMinutes int64    `json:"durationMinutes"`
}

AccessRequestCreate is the `AccessRequestCreate` schema.

type AccessRequestsApproveParams added in v0.43.0

type AccessRequestsApproveParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	RequestID string
	// Body: the JSON request body.
	Body *AccessDecision
}

AccessRequestsApproveParams holds the parameters for `client.accessRequests.approve`.

type AccessRequestsCatalogParams added in v0.43.0

type AccessRequestsCatalogParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AccessRequestsCatalogParams holds the parameters for `client.accessRequests.catalog`.

Every field is optional; pass nil to take the defaults.

type AccessRequestsCreateParams added in v0.43.0

type AccessRequestsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *AccessRequestCreate
}

AccessRequestsCreateParams holds the parameters for `client.accessRequests.create`.

Every field is optional; pass nil to take the defaults.

type AccessRequestsDenyParams added in v0.43.0

type AccessRequestsDenyParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	RequestID string
	// Body: the JSON request body.
	Body *AccessDecision
}

AccessRequestsDenyParams holds the parameters for `client.accessRequests.deny`.

type AccessRequestsListParams added in v0.43.0

type AccessRequestsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Status: `pending` (awaiting a decision), `approved`, `denied`, or
	// `expired` (nobody decided in time, or the requester withdrew it). An
	// approved row is only *granting* permissions while `active` is true.
	//
	// One of "pending", "approved", "denied", "expired".
	Status *string
	// Mine: Only the caller's own requests.
	//
	// One of "1".
	Mine *string
	// Active: Only rows granting permissions right now.
	//
	// One of "1".
	Active *string
}

AccessRequestsListParams holds the parameters for `client.accessRequests.list`.

Every field is optional; pass nil to take the defaults.

type AccessRequestsNamespace added in v0.43.0

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

AccessRequestsNamespace is `client.accessRequests`.

func (*AccessRequestsNamespace) Approve added in v0.43.0

Approve: Approve an access request

Opens the elevation window: the requester holds the requested permissions from now until `grantExpiresAt`, on every surface at once (HTTP, the WebSocket gateway, chat, MCP tools). Two rules are enforced here and cannot be bypassed: you cannot decide your own request (403 `self_approval`), and you cannot grant a permission you do not hold yourself (403 `exceeds_approver`) — denying something aimed higher than you is allowed. Deciding a request that has already been decided or has timed out is a 409. Audit-logged.

_Requires permission: `access:approve`._

POST /api/org/{orgId}/access-requests/{requestId}/approve

Raises on 400: Bad request

Raises on 403: Self-approval, or granting beyond the approver's own permissions

Raises on 404: Not found

Raises on 409: Already decided, or the request timed out

func (*AccessRequestsNamespace) Catalog added in v0.43.0

Catalog: Permissions a request may ask for

The server's permission catalog plus the subset the caller already holds and the bounds on grant length. Served rather than hard-coded in clients so a picker cannot drift from what the server will accept.

_Requires permission: `access:read`._

GET /api/org/{orgId}/access-requests/catalog

func (*AccessRequestsNamespace) Create added in v0.43.0

Create: Request elevated access

Ask for specific permissions, for a specific number of minutes, with a reason. Rejected with 400 when the caller's role already grants every permission asked for — that is almost always a wrong permission string rather than a real request. Fans out to push, Slack (with Approve/Deny buttons) and Microsoft Teams under the Pages opt-in. Audit-logged.

_Requires permission: `access:request`._

POST /api/org/{orgId}/access-requests

Raises on 400: Bad request

func (*AccessRequestsNamespace) Deny added in v0.43.0

Deny: Deny an access request

Records the refusal. Two rules are enforced here and cannot be bypassed: you cannot decide your own request (403 `self_approval`), and you cannot grant a permission you do not hold yourself (403 `exceeds_approver`) — denying something aimed higher than you is allowed. Deciding a request that has already been decided or has timed out is a 409. Audit-logged.

_Requires permission: `access:approve`._

POST /api/org/{orgId}/access-requests/{requestId}/deny

Raises on 400: Bad request

Raises on 403: Self-approval, or granting beyond the approver's own permissions

Raises on 404: Not found

Raises on 409: Already decided, or the request timed out

func (*AccessRequestsNamespace) List added in v0.43.0

List: List access requests

The organization's break-glass requests, newest first. A `pending` listing hides rows whose timeout has already passed, so the queue never offers a decision that would immediately be refused.

_Requires permission: `access:read`._

GET /api/org/{orgId}/access-requests

Raises on 400: Bad request

func (*AccessRequestsNamespace) Revoke added in v0.43.0

Revoke: End a live elevation early

Allowed for anyone with `access:approve` and for the holder — giving back an elevation you no longer need must never require finding an approver. Applies from the next permission resolution; nothing is cached. Audit-logged.

POST /api/org/{orgId}/access-requests/{requestId}/revoke

Raises on 404: Not found

Raises on 409: The grant is not active

func (*AccessRequestsNamespace) Withdraw added in v0.43.0

Withdraw: Withdraw your own pending request

Its own operation rather than a self-denial, so the audit trail distinguishes 'nobody would approve this' from 'they decided they didn't need it'. Audit-logged.

_Requires permission: `access:request`._

POST /api/org/{orgId}/access-requests/{requestId}/withdraw

Raises on 404: Not found

Raises on 409: Already decided or expired

type AccessRequestsRevokeParams added in v0.43.0

type AccessRequestsRevokeParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	RequestID string
}

AccessRequestsRevokeParams holds the parameters for `client.accessRequests.revoke`.

type AccessRequestsWithdrawParams added in v0.43.0

type AccessRequestsWithdrawParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	RequestID string
}

AccessRequestsWithdrawParams holds the parameters for `client.accessRequests.withdraw`.

type AccessReviewDismissal added in v1.16.0

type AccessReviewDismissal struct {
	ResourceID string `json:"resourceId"`
	RuleID     string `json:"ruleId"`
	// DismissedAt: When the finding was accepted.
	DismissedAt string `json:"dismissedAt"`
	// DismissedBy: Display name or email of whoever accepted it; null when
	// unknown.
	DismissedBy *string `json:"dismissedBy"`
	// Reason: The operator's note, when they left one.
	Reason *string `json:"reason"`
}

AccessReviewDismissal is the `AccessReviewDismissal` schema.

type AccessReviewDismissalCreate added in v1.16.0

type AccessReviewDismissalCreate struct {
	// ResourceID: Infrawrench resource id the finding is on.
	ResourceID string `json:"resourceId"`
	// RuleID: Which rule was raised. Half of a dismissal's key, alongside the
	// resource id. The `access-review:` prefix is reserved so these can share
	// the posture dismissal store without colliding with plugin-declared posture
	// rule ids.
	//
	// One of "access-review:stale-principal", "access-review:admin-principal",
	// "access-review:key-past-rotation", "access-review:no-recorded-owner",
	// "access-review:no-mfa".
	RuleID string `json:"ruleId"`
	// Reason: Why this finding is acceptable. Trimmed; an empty note is stored
	// as none.
	Reason *string `json:"reason,omitempty"`
}

AccessReviewDismissalCreate is the `AccessReviewDismissalCreate` schema.

type AccessReviewDismissalsCreateParams added in v1.16.0

type AccessReviewDismissalsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *AccessReviewDismissalCreate
}

AccessReviewDismissalsCreateParams holds the parameters for `client.accessReview.dismissals.create`.

Every field is optional; pass nil to take the defaults.

type AccessReviewDismissalsDeleteParams added in v1.16.0

type AccessReviewDismissalsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ResourceID: Infrawrench resource id the finding is on.
	ResourceID string
	// RuleID: Which rule was raised. Half of a dismissal's key, alongside the
	// resource id. The `access-review:` prefix is reserved so these can share
	// the posture dismissal store without colliding with plugin-declared posture
	// rule ids.
	//
	// One of "access-review:stale-principal", "access-review:admin-principal",
	// "access-review:key-past-rotation", "access-review:no-recorded-owner",
	// "access-review:no-mfa".
	RuleID string
}

AccessReviewDismissalsDeleteParams holds the parameters for `client.accessReview.dismissals.delete`.

type AccessReviewDismissalsNamespace added in v1.16.0

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

AccessReviewDismissalsNamespace is `client.accessReview.dismissals`.

func (*AccessReviewDismissalsNamespace) Create added in v1.16.0

Create: Dismiss an access review finding

Accept a finding — that break-glass role really is meant to be admin, that shared key really is rotated out of band. The finding leaves `findings` and stops feeding the security alerts, but the rule keeps being evaluated and the finding is reported back under `dismissed` for as long as it still matches. The principal itself stays in `principals` either way. Idempotent: dismissing an already-dismissed finding rewrites the note and the author.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/access-review/dismissals

Raises on 400: Bad request

func (*AccessReviewDismissalsNamespace) Delete added in v1.16.0

Delete: Restore a dismissed access review finding

Undo a dismissal, putting the finding back on the list and back into the security alerts. The finding is identified by query parameters rather than path segments because resource ids are provider-native and routinely contain slashes.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/access-review/dismissals

Raises on 400: Bad request

Raises on 404: Not found

type AccessReviewExportParams added in v1.16.0

type AccessReviewExportParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Format: Defaults to "csv".
	//
	// One of "csv", "json".
	Format *string
	// StaleDays: Staleness window in days. Defaults to 90.
	StaleDays *int64
}

AccessReviewExportParams holds the parameters for `client.accessReview.export`.

Every field is optional; pass nil to take the defaults.

type AccessReviewGetParams added in v1.16.0

type AccessReviewGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// StaleDays: Staleness window in days. Defaults to 90.
	StaleDays *int64
}

AccessReviewGetParams holds the parameters for `client.accessReview.get`.

Every field is optional; pass nil to take the defaults.

type AccessReviewNamespace added in v1.16.0

type AccessReviewNamespace struct {

	// Dismissals: `client.accessReview.dismissals`.
	Dismissals *AccessReviewDismissalsNamespace
	// contains filtered or unexported fields
}

AccessReviewNamespace is `client.accessReview`.

func (*AccessReviewNamespace) Export added in v1.16.0

Export: Export the access review as compliance evidence

The same review as a downloadable file, one row per finding. `format=csv` (the default) returns RFC 4180 CSV with every cell quoted and spreadsheet formulas neutralised; `format=json` returns the full response body pretty-printed.

Dismissed findings are included and labelled in both formats, with the note and the person who accepted them: an evidence pack answers what you found *and* what you decided. Exports are recorded in the audit log.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/access-review/export

Raises on 400: Bad request

func (*AccessReviewNamespace) Get added in v1.16.0

Get: Review the principals inside your connected clouds

Every IAM user and role, service account, app registration, group, role binding and long-lived API key your connected accounts have synced, with the findings that have evidence against them: unused beyond the staleness window, holding administrative or wildcard permissions, past the rotation budget their plugin declares, carrying no recorded owner, or signing in without a second factor.

This is about principals in **your** clouds — it is neither your Infrawrench team's roles (`/team`) nor the credentials Infrawrench stores for you (`/credential-hygiene`).

No provider API calls are made: everything is computed from already-synced fields, so a principal whose provider does not report last use is reported with `activity: "unknown"` and is never called stale. Findings the organization has dismissed are reported separately under `dismissed` and are excluded from `findings`, `counts`, `byRule` and the security alerts.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/access-review

Raises on 400: Bad request

type AccessReviewResponse added in v1.16.0

type AccessReviewResponse struct {
	// Principals: Every synced principal, by account then type then name. Never
	// filtered by dismissals — accepting a finding must not remove a principal
	// from the inventory.
	Principals []AccessPrincipal `json:"principals"`
	// Findings: Live findings, worst severity first. Dismissed findings are not
	// included.
	Findings []AccessFinding `json:"findings"`
	// TotalCount: Live finding count; dismissals excluded.
	TotalCount int64                      `json:"totalCount"`
	Counts     AccessReviewSeverityCounts `json:"counts"`
	ByRule     AccessReviewRuleCounts     `json:"byRule"`
	ByRole     AccessReviewRoleCounts     `json:"byRole"`
	// Dismissed: Findings a dismissal is currently suppressing, most recently
	// dismissed first. Only dismissals whose rule still matches appear.
	Dismissed      []DismissedAccessFinding `json:"dismissed"`
	DismissedCount int64                    `json:"dismissedCount"`
	// UnknownActivityCount: How many principals the review could establish no
	// last-use evidence for. Surfaces render this so "we found nothing" and "we
	// could not look" do not read the same.
	UnknownActivityCount int64 `json:"unknownActivityCount"`
	// StaleDays: The staleness window this review was computed against.
	StaleDays   int64  `json:"staleDays"`
	GeneratedAt string `json:"generatedAt"`
}

AccessReviewResponse is the `AccessReviewResponse` schema.

type AccessReviewRoleCounts added in v1.16.0

type AccessReviewRoleCounts struct {
	User           int64 `json:"user"`
	Group          int64 `json:"group"`
	Role           int64 `json:"role"`
	ServiceAccount int64 `json:"service-account"`
	Key            int64 `json:"key"`
	Binding        int64 `json:"binding"`
}

AccessReviewRoleCounts is the `AccessReviewRoleCounts` schema.

type AccessReviewRuleCounts added in v1.16.0

type AccessReviewRuleCounts struct {
	AccessReviewStalePrincipal  int64 `json:"access-review:stale-principal"`
	AccessReviewAdminPrincipal  int64 `json:"access-review:admin-principal"`
	AccessReviewKeyPastRotation int64 `json:"access-review:key-past-rotation"`
	AccessReviewNoRecordedOwner int64 `json:"access-review:no-recorded-owner"`
	AccessReviewNoMFA           int64 `json:"access-review:no-mfa"`
}

AccessReviewRuleCounts is the `AccessReviewRuleCounts` schema.

type AccessReviewSeverityCounts added in v1.16.0

type AccessReviewSeverityCounts struct {
	Critical int64 `json:"critical"`
	High     int64 `json:"high"`
	Medium   int64 `json:"medium"`
	Low      int64 `json:"low"`
}

AccessReviewSeverityCounts is the `AccessReviewSeverityCounts` schema.

type AccessRevokeConflict added in v0.43.0

type AccessRevokeConflict struct {
	Error string `json:"error"`
}

AccessRevokeConflict is the `AccessRevokeConflict` schema.

type AccessWithdrawConflict added in v0.43.0

type AccessWithdrawConflict struct {
	Error string `json:"error"`
}

AccessWithdrawConflict is the `AccessWithdrawConflict` schema.

type Account

type Account struct {
	ID          string `json:"id"`
	PluginID    string `json:"pluginId"`
	DisplayName string `json:"displayName"`
	// BastionID: Bastion this account's cloud-API egress is routed through.
	// `null` ⇒ direct egress.
	BastionID *string `json:"bastionId"`
	CreatedAt string  `json:"createdAt"`
}

Account is the `Account` schema.

type AccountDeleted added in v0.8.0

type AccountDeleted struct {
	OK                   bool  `json:"ok"`
	OrganizationsDeleted int64 `json:"organizationsDeleted"`
}

AccountDeleted is the `AccountDeleted` schema.

type AccountDeletionPreview added in v0.8.0

type AccountDeletionPreview struct {
	// OrganizationsToDelete: Deleted with the account — the caller is their only
	// member.
	OrganizationsToDelete []OrganizationRef `json:"organizationsToDelete"`
	// OrganizationsToLeave: Survive; the caller's membership is removed.
	OrganizationsToLeave []OrganizationRef `json:"organizationsToLeave"`
	// Blockers: Non-empty means DELETE /api/profile will refuse until another
	// owner is promoted.
	Blockers []OwnershipBlocker `json:"blockers"`
}

AccountDeletionPreview is the `AccountDeletionPreview` schema.

type AccountDetail

type AccountDetail struct {
	Account           AccountDetailAccount  `json:"account"`
	ResourceTypes     []ResourceTypeSummary `json:"resourceTypes"`
	PluginDisplayName string                `json:"pluginDisplayName"`
	PluginLogoSvg     string                `json:"pluginLogoSvg"`
}

AccountDetail is the `AccountDetail` schema.

type AccountDetailAccount

type AccountDetailAccount struct {
	ID          string `json:"id"`
	PluginID    string `json:"pluginId"`
	DisplayName string `json:"displayName"`
}

AccountDetailAccount is an object the spec declares inline.

type AccountTagCompliance added in v0.29.0

type AccountTagCompliance struct {
	AccountID      string `json:"accountId"`
	PluginID       string `json:"pluginId"`
	DisplayName    string `json:"displayName"`
	TotalResources int64  `json:"totalResources"`
	// Evaluated: Resources whose stored record exposes a tag map (the scoreable
	// set).
	Evaluated int64 `json:"evaluated"`
	Compliant int64 `json:"compliant"`
	// Score: Percent of evaluated resources carrying every required tag; null
	// when none.
	Score *int64 `json:"score"`
}

AccountTagCompliance is the `AccountTagCompliance` schema.

type AccountsCreateParams

type AccountsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body AccountsCreateRequest
}

AccountsCreateParams holds the parameters for `client.accounts.create`.

type AccountsCreateRequest

type AccountsCreateRequest struct {
	PluginID    *PluginID         `json:"pluginId,omitempty"`
	DisplayName string            `json:"displayName"`
	Credentials map[string]string `json:"credentials"`
	// BastionID: Optional bastion id to route this account's cloud API traffic
	// through.
	BastionID *string `json:"bastionId,omitempty"`
}

AccountsCreateRequest is an object the spec declares inline.

type AccountsCredentialsGetParams

type AccountsCredentialsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AccountsCredentialsGetParams holds the parameters for `client.accounts.credentials.get`.

type AccountsCredentialsNamespace

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

AccountsCredentialsNamespace is `client.accounts.credentials`.

func (*AccountsCredentialsNamespace) Get

Get: Fetch the decrypted credentials for an account

Returns the credentials map as it was originally submitted. Sensitive — gate access carefully.

_Requires permission: `secrets:read`._

GET /api/org/{orgId}/accounts/{id}/credentials

Raises on 404: Not found

func (*AccountsCredentialsNamespace) Update

Update: Rotate the credentials an account uses to talk to the upstream provider

Replaces the encrypted credentials blob in place. Used to swap a stale or narrowly-scoped token for a freshly-minted one without recreating the account (preserves existing resources, pins, dashboards, sync history).

_Requires permission: `secrets:write`._

PUT /api/org/{orgId}/accounts/{id}/credentials

Raises on 400: Bad request

Raises on 404: Not found

type AccountsCredentialsUpdateParams

type AccountsCredentialsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body AccountsCredentialsUpdateRequest
}

AccountsCredentialsUpdateParams holds the parameters for `client.accounts.credentials.update`.

type AccountsCredentialsUpdateRequest

type AccountsCredentialsUpdateRequest struct {
	// Credentials: Complete credentials map. Sensitive fields the caller doesn't
	// want to change should be re-sent with their previous value (the server
	// doesn't merge with the existing blob).
	Credentials map[string]string `json:"credentials"`
}

AccountsCredentialsUpdateRequest is an object the spec declares inline.

type AccountsCredentialsUpdateResponse

type AccountsCredentialsUpdateResponse struct {
	OK bool `json:"ok"`
}

AccountsCredentialsUpdateResponse is an object the spec declares inline.

type AccountsDeleteParams

type AccountsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AccountsDeleteParams holds the parameters for `client.accounts.delete`.

type AccountsDetailParams

type AccountsDetailParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AccountsDetailParams holds the parameters for `client.accounts.detail`.

type AccountsExportTerraformParams added in v1.3.0

type AccountsExportTerraformParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AccountsExportTerraformParams holds the parameters for `client.accounts.exportTerraform`.

type AccountsListParams

type AccountsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AccountsListParams holds the parameters for `client.accounts.list`.

Every field is optional; pass nil to take the defaults.

type AccountsNamespace

type AccountsNamespace struct {

	// Credentials: `client.accounts.credentials`.
	Credentials *AccountsCredentialsNamespace
	// Plugins: `client.accounts.plugins`.
	Plugins *AccountsPluginsNamespace
	// Preflight: `client.accounts.preflight`.
	Preflight *AccountsPreflightNamespace
	// SyncType: `client.accounts.syncType`.
	SyncType *AccountsSyncTypeNamespace
	// contains filtered or unexported fields
}

AccountsNamespace is `client.accounts`.

func (*AccountsNamespace) Create

Create: Create an account

Stores encrypted credentials and triggers a first sync. `syncError` is set if the initial sync failed (the account row is still created).

_Requires permission: `accounts:write`._

POST /api/org/{orgId}/accounts

Raises on 400: Bad request

Raises on 402: Payment required — the organization's plan does not include this

func (*AccountsNamespace) Delete

func (n *AccountsNamespace) Delete(ctx context.Context, params AccountsDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete an account

_Requires permission: `accounts:delete`._

DELETE /api/org/{orgId}/accounts/{id}

func (*AccountsNamespace) Detail

Detail: Account metadata + resource type list

_Requires permission: `accounts:read`._

GET /api/org/{orgId}/accounts/{id}/detail

Raises on 404: Not found

func (*AccountsNamespace) ExportTerraform added in v1.3.0

ExportTerraform: Generate Terraform HCL for the account's stored inventory

_Requires permission: `resources:read`._

GET /api/org/{orgId}/accounts/{id}/export-terraform

Raises on 404: Not found

func (*AccountsNamespace) List

func (n *AccountsNamespace) List(ctx context.Context, params *AccountsListParams, opts ...RequestOption) ([]Account, error)

List: List accounts in this organization

_Requires permission: `accounts:read`._

GET /api/org/{orgId}/accounts

func (*AccountsNamespace) Resources

func (n *AccountsNamespace) Resources(ctx context.Context, params AccountsResourcesParams, opts ...RequestOption) ([]Resource, error)

Resources: List cached resources for an account

_Requires permission: `resources:read`._

GET /api/org/{orgId}/accounts/{id}/resources

func (*AccountsNamespace) Sync

Sync: Sync all resource types for an account

_Requires permission: `resources:read`._

POST /api/org/{orgId}/accounts/{id}/sync

func (*AccountsNamespace) Update

Update: Update an account (rename and/or change bastion binding)

_Requires permission: `accounts:write`._

PATCH /api/org/{orgId}/accounts/{id}

Raises on 400: Bad request

Raises on 404: Not found

type AccountsPluginsListParams added in v0.30.0

type AccountsPluginsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AccountsPluginsListParams holds the parameters for `client.accounts.plugins.list`.

Every field is optional; pass nil to take the defaults.

type AccountsPluginsNamespace added in v0.30.0

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

AccountsPluginsNamespace is `client.accounts.plugins`.

func (*AccountsPluginsNamespace) List added in v0.30.0

List: List installed plugins and their credential fields

_Requires permission: `accounts:read`._

GET /api/org/{orgId}/accounts/plugins

func (*AccountsPluginsNamespace) PolicyTemplate added in v0.30.0

PolicyTemplate: Generate a least-privilege credential template for a plugin

Returns the paste-ready credential document (IAM policy JSON, custom role YAML, token template…) scoped to the requested capability ids. Omitting `capabilities` (or sending it empty) selects every declared capability; any unknown capability id is rejected with 400. 400 also for plugins that don't provide a template.

_Requires permission: `accounts:read`._

GET /api/org/{orgId}/accounts/plugins/{pluginId}/policy-template

Raises on 400: Bad request

Raises on 404: Not found

type AccountsPluginsPolicyTemplateParams added in v0.30.0

type AccountsPluginsPolicyTemplateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	// Capabilities: Comma-separated capability ids, e.g. `resources,costs`.
	Capabilities *string
}

AccountsPluginsPolicyTemplateParams holds the parameters for `client.accounts.plugins.policyTemplate`.

type AccountsPreflightCreateParams added in v0.30.0

type AccountsPreflightCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body PreflightRequest
}

AccountsPreflightCreateParams holds the parameters for `client.accounts.preflight.create`.

type AccountsPreflightNamespace added in v0.30.0

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

AccountsPreflightNamespace is `client.accounts.preflight`.

func (*AccountsPreflightNamespace) Create added in v0.30.0

Create: Probe credentials before creating an account

Runs the plugin's per-capability permission checks against the submitted credentials. Nothing is stored — use it from the add-account flow before committing.

_Requires permission: `accounts:write`._

POST /api/org/{orgId}/accounts/preflight

Raises on 400: Bad request

Raises on 404: Not found

func (*AccountsPreflightNamespace) PostOrgOrgIDAccountsIDPreflight added in v0.30.0

PostOrgOrgIDAccountsIDPreflight: Re-run credential preflight on a stored account

_Requires permission: `accounts:write`._

POST /api/org/{orgId}/accounts/{id}/preflight

Raises on 400: Bad request

Raises on 404: Not found

type AccountsPreflightPostOrgOrgIDAccountsIDPreflightParams added in v0.30.0

type AccountsPreflightPostOrgOrgIDAccountsIDPreflightParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AccountsPreflightPostOrgOrgIDAccountsIDPreflightParams holds the parameters for `client.accounts.preflight.postOrgOrgIdAccountsIdPreflight`.

type AccountsResourcesParams

type AccountsResourcesParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// TopLevelOnly: If `true`, only resources with no `parentResourceId` are
	// returned.
	//
	// One of "true", "false".
	TopLevelOnly *string
}

AccountsResourcesParams holds the parameters for `client.accounts.resources`.

type AccountsSyncParams

type AccountsSyncParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AccountsSyncParams holds the parameters for `client.accounts.sync`.

type AccountsSyncTypeCreateParams

type AccountsSyncTypeCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID  *string
	ID     string
	TypeID ResourceTypeID
}

AccountsSyncTypeCreateParams holds the parameters for `client.accounts.syncType.create`.

type AccountsSyncTypeNamespace

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

AccountsSyncTypeNamespace is `client.accounts.syncType`.

func (*AccountsSyncTypeNamespace) Create

Create: Sync a single resource type and return its resources

_Requires permission: `resources:read`._

POST /api/org/{orgId}/accounts/{id}/sync-type/{typeId}

Raises on 404: Not found

Raises on 500: Server error

type AccountsUpdateParams

type AccountsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body UpdateAccountRequest
}

AccountsUpdateParams holds the parameters for `client.accounts.update`.

type ActiveTunnel

type ActiveTunnel struct {
	LocalPort  int64  `json:"localPort"`
	SSHHost    string `json:"sshHost"`
	RemotePort int64  `json:"remotePort"`
}

ActiveTunnel is the `ActiveTunnel` schema.

type AgentClaimCreateParams added in v1.26.0

type AgentClaimCreateParams struct {
	// Body: the JSON request body.
	Body *AgentClaimRequest
}

AgentClaimCreateParams holds the parameters for `client.agent.claim.create`.

Every field is optional; pass nil to take the defaults.

type AgentClaimLookup added in v1.26.0

type AgentClaimLookup struct {
	RegistrationID   string `json:"registrationId"`
	WorkspaceName    string `json:"workspaceName"`
	TrialExpiresInMs *int64 `json:"trialExpiresInMs"`
	// MergeTargets: Organizations this user may merge the workspace into: ones
	// they already belong to AND hold `accounts:write` in. A merge writes cloud
	// credentials, so membership alone is not enough — the confirm route
	// enforces the same rule.
	MergeTargets []AgentClaimMergeTarget `json:"mergeTargets"`
}

AgentClaimLookup is the `AgentClaimLookup` schema.

type AgentClaimLookupParams added in v1.26.0

type AgentClaimLookupParams struct {
	// Body: the JSON request body.
	Body *AgentClaimLookupRequest
}

AgentClaimLookupParams holds the parameters for `client.agent.claim.lookup`.

Every field is optional; pass nil to take the defaults.

type AgentClaimLookupRequest added in v1.26.0

type AgentClaimLookupRequest struct {
	// Code: The `user_code` the agent showed its user.
	Code string `json:"code"`
}

AgentClaimLookupRequest is the `AgentClaimLookupRequest` schema.

type AgentClaimMergeTarget added in v1.26.0

type AgentClaimMergeTarget struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
}

AgentClaimMergeTarget is the `AgentClaimMergeTarget` schema.

type AgentClaimNamespace added in v1.26.0

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

AgentClaimNamespace is `client.agent.claim`.

func (*AgentClaimNamespace) Create added in v1.26.0

Create: Confirm a claim, binding the workspace to the signed-in user

The code is re-resolved here rather than trusting a registration id from the lookup, so the lookup cannot be used as an oracle. Rate limited per user.

POST /api/agent/claim

Raises on 400: Bad code, already claimed, revoked, or a merge with no valid target

Raises on 401: Unauthenticated

Raises on 402: The merge would put a free target organization over its plan limits

Raises on 403: You lack the permission the merge needs in the target organization (`accounts:write`, plus `costs:write` when moving history).

Raises on 429: Too many attempts

func (*AgentClaimNamespace) Lookup added in v1.26.0

Lookup: Resolve a user code so the claim page can show what is being claimed

A POST rather than a GET with the code in the path: the code is a live bearer secret for 15 minutes, and a URL lands in history, in `Referer`, and in access logs. Rate limited per user.

POST /api/agent/claim/lookup

Raises on 400: Missing, malformed, or expired code

Raises on 401: Unauthenticated

Raises on 404: The workspace no longer exists

Raises on 429: Too many attempts

type AgentClaimRequest added in v1.26.0

type AgentClaimRequest struct {
	Code string `json:"code"`
	// Mode: `adopt` keeps the workspace as its own organization and stops the
	// clock. `merge` moves its cloud accounts into an organization you already
	// belong to and destroys the trial. Defaults to `adopt`.
	//
	// One of "adopt", "merge".
	Mode *string `json:"mode,omitempty"`
	// TargetOrganizationID: Required when `mode` is merge.
	TargetOrganizationID *string `json:"targetOrganizationId,omitempty"`
	// MoveHistory: Merge only: also re-parent the trial's metrics and cost
	// history. Off by default — it changes numbers the target organization may
	// already be reporting on. Needs `costs:write`.
	MoveHistory *bool `json:"moveHistory,omitempty"`
}

AgentClaimRequest is the `AgentClaimRequest` schema.

type AgentClaimResult added in v1.26.0

type AgentClaimResult struct {
	// OrganizationID: The organization the agent acts in from now on.
	OrganizationID string `json:"organizationId"`
	// Mode: One of "adopt", "merge".
	Mode          string `json:"mode"`
	AccountsMoved int64  `json:"accountsMoved"`
	HistoryMoved  bool   `json:"historyMoved"`
}

AgentClaimResult is the `AgentClaimResult` schema.

type AgentClaimStarted added in v1.26.0

type AgentClaimStarted struct {
	// UserCode: Formatted as `XXXX-XXXX`. Show it to the user alongside
	// `verification_uri`.
	UserCode        string `json:"user_code"`
	VerificationURI string `json:"verification_uri"`
	// VerificationURIComplete: The verification page with the code pre-filled.
	// Convenient, but it puts a live bearer secret in a URL — prefer
	// `verification_uri` plus the code shown separately.
	VerificationURIComplete string `json:"verification_uri_complete"`
	ExpiresAt               string `json:"expires_at"`
	// Interval: Minimum seconds between status polls.
	Interval int64 `json:"interval"`
}

AgentClaimStarted is the `AgentClaimStarted` schema.

type AgentIdentity added in v1.26.0

type AgentIdentity struct {
	RegistrationID string `json:"registration_id"`
	OrganizationID string `json:"organization_id"`
	Claimed        bool   `json:"claimed"`
	// ClaimPending: A `user_code` is currently outstanding.
	ClaimPending bool `json:"claim_pending"`
	// TrialExpiresInMs: Milliseconds until deletion. Null once the workspace is
	// claimed.
	TrialExpiresInMs *int64 `json:"trial_expires_in_ms"`
}

AgentIdentity is the `AgentIdentity` schema.

type AgentIdentityCreateParams added in v1.26.0

type AgentIdentityCreateParams struct {
	// Body: the JSON request body.
	Body *AgentRegisterRequest
}

AgentIdentityCreateParams holds the parameters for `client.agent.identity.create`.

Every field is optional; pass nil to take the defaults.

type AgentIdentityNamespace added in v1.26.0

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

AgentIdentityNamespace is `client.agent.identity`.

func (*AgentIdentityNamespace) Claim added in v1.26.0

Claim: Start the claim ceremony and mint a user code

Returns a code to show the user together with the verification URL. Replaces any code already outstanding for this registration.

POST /api/agent/identity/claim

Raises on 400: Already claimed

Raises on 401: Unknown or revoked credential

Raises on 403: Registration revoked

func (*AgentIdentityNamespace) Create added in v1.26.0

Create: Open an anonymous registration and a 24-hour trial workspace

Requires no authentication — this is how a client with no credentials gets one. Rate limited per source address. The workspace it opens is deleted 24 hours later unless a person completes the claim ceremony.

POST /api/agent/identity

Raises on 429: Too many registrations from this address

Raises on 500: Could not open a workspace

func (*AgentIdentityNamespace) Get added in v1.26.0

Get: Poll this registration's claim status and time remaining

GET /api/agent/identity

Raises on 401: Unknown or revoked credential

Raises on 404: Unknown registration

type AgentNamespace added in v1.26.0

type AgentNamespace struct {

	// Claim: `client.agent.claim`.
	Claim *AgentClaimNamespace
	// Identity: `client.agent.identity`.
	Identity *AgentIdentityNamespace
	// contains filtered or unexported fields
}

AgentNamespace is `client.agent`.

type AgentRegisterRequest added in v1.26.0

type AgentRegisterRequest struct {
	// Label: Short name for the workspace, shown to the user who claims it.
	Label *string `json:"label,omitempty"`
}

AgentRegisterRequest is the `AgentRegisterRequest` schema.

type AgentRegistration added in v1.26.0

type AgentRegistration struct {
	ID    string  `json:"id"`
	Label *string `json:"label"`
	// Kind: One of "anonymous", "service_auth".
	Kind string `json:"kind"`
	// Prefix: First 8 characters of the credential.
	Prefix          *string `json:"prefix"`
	ClaimedAt       *string `json:"claimedAt"`
	ClaimedByUserID *string `json:"claimedByUserId"`
	ClaimedByEmail  *string `json:"claimedByEmail"`
	LastSeenAt      *string `json:"lastSeenAt"`
	RevokedAt       *string `json:"revokedAt"`
	CreatedAt       string  `json:"createdAt"`
}

AgentRegistration is the `AgentRegistration` schema.

type AgentRegistrationsDeleteParams added in v1.26.0

type AgentRegistrationsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AgentRegistrationsDeleteParams holds the parameters for `client.agentRegistrations.delete`.

type AgentRegistrationsListParams added in v1.26.0

type AgentRegistrationsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AgentRegistrationsListParams holds the parameters for `client.agentRegistrations.list`.

Every field is optional; pass nil to take the defaults.

type AgentRegistrationsNamespace added in v1.26.0

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

AgentRegistrationsNamespace is `client.agentRegistrations`.

func (*AgentRegistrationsNamespace) Delete added in v1.26.0

Delete: Revoke an agent registration

The row is kept so audit entries naming this agent stay legible; its credential stops working on the next request. Closed to agent credentials.

DELETE /api/org/{orgId}/agent-registrations/{id}

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 402: Payment required — the organization's plan does not include this

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

Raises on 500: Server error

Raises on 503: A backing service this endpoint depends on is not available

Raises on reauth: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

func (*AgentRegistrationsNamespace) List added in v1.26.0

List: List the agent registrations acting in this organization

GET /api/org/{orgId}/agent-registrations

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 402: Payment required — the organization's plan does not include this

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

Raises on 500: Server error

Raises on 503: A backing service this endpoint depends on is not available

Raises on reauth: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

type AgentRevoked added in v1.26.0

type AgentRevoked struct {
	OK bool `json:"ok"`
	// Revoked: False when the registration was already revoked. The request
	// still succeeds — revocation is idempotent — but nothing changed.
	Revoked bool `json:"revoked"`
}

AgentRevoked is the `AgentRevoked` schema.

type AgentSession

type AgentSession struct {
	ID             string `json:"id"`
	Repo           string `json:"repo"`
	ProjectName    string `json:"projectName"`
	WorkspaceName  string `json:"workspaceName"`
	AccountID      string `json:"accountId"`
	PluginID       string `json:"pluginId"`
	ResourceTypeID string `json:"resourceTypeId"`
	// Tool: One of "codex", "claude-code".
	Tool string `json:"tool"`
	// Surface: One of "terminal", "t3-code".
	Surface    *string `json:"surface,omitempty"`
	BranchName string  `json:"branchName"`
	// Status: One of "pending", "provisioning", "setting-up", "up", "failed",
	// "stopped".
	Status       string   `json:"status"`
	VMResourceID *string  `json:"vmResourceId"`
	Logs         []string `json:"logs"`
	CreatedAt    string   `json:"createdAt"`
	UpdatedAt    string   `json:"updatedAt"`
}

AgentSession is the `AgentSession` schema.

type AgentSettings

type AgentSettings struct {
	AccountID      string `json:"accountId"`
	PluginID       string `json:"pluginId"`
	ResourceTypeID string `json:"resourceTypeId"`
	// Tool: One of "codex", "claude-code".
	Tool string `json:"tool"`
	// Surface: One of "terminal", "t3-code".
	Surface *string           `json:"surface,omitempty"`
	Fields  map[string]string `json:"fields"`
}

AgentSettings is the `AgentSettings` schema.

The API may send null in its place.

type AgentVMAccount

type AgentVMAccount struct {
	AccountID          string            `json:"accountId"`
	AccountName        string            `json:"accountName"`
	PluginID           string            `json:"pluginId"`
	PluginName         string            `json:"pluginName"`
	PluginLogoSvg      *string           `json:"pluginLogoSvg,omitempty"`
	ResourceTypeID     string            `json:"resourceTypeId"`
	ResourceTypeName   string            `json:"resourceTypeName"`
	DefaultUsername    string            `json:"defaultUsername"`
	DefaultFields      map[string]string `json:"defaultFields"`
	DefaultFieldLabels map[string]string `json:"defaultFieldLabels,omitempty"`
	CreateFields       []JSONObject      `json:"createFields,omitempty"`
	HiddenFieldKeys    []string          `json:"hiddenFieldKeys"`
}

AgentVMAccount is the `AgentVmAccount` schema.

Spec schema: `AgentVmAccount`.

type AgentsAccountsParams

type AgentsAccountsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AgentsAccountsParams holds the parameters for `client.agents.accounts`.

Every field is optional; pass nil to take the defaults.

type AgentsNamespace

type AgentsNamespace struct {

	// Sessions: `client.agents.sessions`.
	Sessions *AgentsSessionsNamespace
	// Settings: `client.agents.settings`.
	Settings *AgentsSettingsNamespace
	// contains filtered or unexported fields
}

AgentsNamespace is `client.agents`.

func (*AgentsNamespace) Accounts

func (n *AgentsNamespace) Accounts(ctx context.Context, params *AgentsAccountsParams, opts ...RequestOption) ([]AgentVMAccount, error)

Accounts: List accounts whose plugins can create agent VMs

_Requires permission: `accounts:read`._

GET /api/org/{orgId}/agents/accounts

type AgentsSessionsCreateParams

type AgentsSessionsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreateAgentSession
}

AgentsSessionsCreateParams holds the parameters for `client.agents.sessions.create`.

type AgentsSessionsDeleteParams

type AgentsSessionsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AgentsSessionsDeleteParams holds the parameters for `client.agents.sessions.delete`.

type AgentsSessionsDeleteResponse

type AgentsSessionsDeleteResponse struct {
	OK bool `json:"ok"`
}

AgentsSessionsDeleteResponse is an object the spec declares inline.

type AgentsSessionsListParams

type AgentsSessionsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AgentsSessionsListParams holds the parameters for `client.agents.sessions.list`.

Every field is optional; pass nil to take the defaults.

type AgentsSessionsNamespace

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

AgentsSessionsNamespace is `client.agents.sessions`.

func (*AgentsSessionsNamespace) Create

Create: Create an agent session

_Requires permission: `resources:write`._

POST /api/org/{orgId}/agents/sessions

Raises on 400: Bad request

func (*AgentsSessionsNamespace) Delete

Delete: Delete an agent session and destroy its VM

_Requires permission: `resources:delete`._

DELETE /api/org/{orgId}/agents/sessions/{id}

Raises on 404: Not found

Raises on 502: The provider refused to delete the VM

func (*AgentsSessionsNamespace) List

List: List agent sessions

_Requires permission: `resources:read`._

GET /api/org/{orgId}/agents/sessions

func (*AgentsSessionsNamespace) Open

Open: Return the command and working directory for an agent session

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/agents/sessions/{id}/open

Raises on 404: Not found

func (*AgentsSessionsNamespace) Reconcile

Reconcile: Return reconciliation branch metadata

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/agents/sessions/{id}/reconcile

Raises on 404: Not found

type AgentsSessionsOpenParams

type AgentsSessionsOpenParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AgentsSessionsOpenParams holds the parameters for `client.agents.sessions.open`.

type AgentsSessionsOpenResponse

type AgentsSessionsOpenResponse struct {
	Command    string  `json:"command"`
	Cwd        string  `json:"cwd"`
	SSHKeyID   *string `json:"sshKeyId,omitempty"`
	SSHKeyName *string `json:"sshKeyName,omitempty"`
}

AgentsSessionsOpenResponse is an object the spec declares inline.

type AgentsSessionsReconcileParams

type AgentsSessionsReconcileParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AgentsSessionsReconcileParams holds the parameters for `client.agents.sessions.reconcile`.

type AgentsSessionsReconcileResponse

type AgentsSessionsReconcileResponse struct {
	BranchName string `json:"branchName"`
	Message    string `json:"message"`
}

AgentsSessionsReconcileResponse is an object the spec declares inline.

type AgentsSettingsGetParams

type AgentsSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AgentsSettingsGetParams holds the parameters for `client.agents.settings.get`.

Every field is optional; pass nil to take the defaults.

type AgentsSettingsNamespace

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

AgentsSettingsNamespace is `client.agents.settings`.

func (*AgentsSettingsNamespace) Get

Get: Get saved Agents defaults

_Requires permission: `accounts:read`._

GET /api/org/{orgId}/agents/settings

func (*AgentsSettingsNamespace) Update

Update: Save Agents defaults

_Requires permission: `accounts:write`._

PUT /api/org/{orgId}/agents/settings

type AgentsSettingsUpdateParams

type AgentsSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *AgentSettings
}

AgentsSettingsUpdateParams holds the parameters for `client.agents.settings.update`.

type AlertCondition added in v1.0.0

type AlertCondition = any

AlertCondition: One clause of a rule. A rule matches when every condition matches; 'or' is expressed by writing a second rule. A condition on a fact the alert does not carry never matches — in either direction, so `accountId notIn [x]` does not match an alert with no account.

type AlertDelivery added in v1.0.0

type AlertDelivery struct {
	ID       string        `json:"id"`
	Trigger  AlertTrigger  `json:"trigger"`
	Severity AlertSeverity `json:"severity"`
	Title    string        `json:"title"`
	Body     string        `json:"body"`
	RuleName *string       `json:"ruleName"`
	// State: One of "held", "awaiting_ack", "sent", "acknowledged", "escalated",
	// "expired".
	State     string `json:"state"`
	CreatedAt string `json:"createdAt"`
	// DeliverAfter: When a quiet-hours hold is released.
	DeliverAfter *string `json:"deliverAfter"`
	// EscalateAt: When an unacknowledged alert escalates.
	EscalateAt           *string `json:"escalateAt"`
	AcknowledgedAt       *string `json:"acknowledgedAt"`
	AcknowledgedByUserID *string `json:"acknowledgedByUserId"`
}

AlertDelivery is the `AlertDelivery` schema.

type AlertDestination added in v1.0.0

type AlertDestination = any

AlertDestination: One place a matched alert goes. `push` reaches the organization's phones, still filtered by each member's own mutes — an organization rule decides whether the org is told, a member decides whether their phone rings.

`on-call` resolves to one person at delivery time, so a rule reading "database alerts → whoever is on call" needs no edit at handover. A rotation that resolves to nobody — disabled, empty, not yet started — contributes nobody and the rule's **other** destinations still deliver: an alert lost to a misconfigured rotation would be the worst outcome the feature could have.

type AlertRule added in v1.0.0

type AlertRule struct {
	ID      string `json:"id"`
	Name    string `json:"name"`
	Enabled bool   `json:"enabled"`
	// Position: Ascending evaluation order
	Position   int64            `json:"position"`
	Conditions []AlertCondition `json:"conditions"`
	// Destinations: Empty is legal and meaningful: an enabled rule with no
	// destinations swallows matching alerts and shadows the rules below it.
	Destinations []AlertDestination `json:"destinations"`
	// ContinueOnMatch: False (the default) makes the list first-match-wins,
	// which is what lets a narrow rule sit above a broad one. True makes the
	// rule a tee that copies without shadowing.
	ContinueOnMatch bool              `json:"continueOnMatch"`
	QuietHours      *QuietHours       `json:"quietHours"`
	Escalation      *EscalationPolicy `json:"escalation"`
}

AlertRule is the `AlertRule` schema.

type AlertRuleInput added in v1.0.0

type AlertRuleInput struct {
	// ID: Send the existing id to preserve it, which keeps in-flight held and
	// escalating deliveries pointing at their rule.
	ID              *string            `json:"id,omitempty"`
	Name            string             `json:"name"`
	Enabled         *bool              `json:"enabled,omitempty"`
	Conditions      []AlertCondition   `json:"conditions,omitempty"`
	Destinations    []AlertDestination `json:"destinations,omitempty"`
	ContinueOnMatch *bool              `json:"continueOnMatch,omitempty"`
	QuietHours      *QuietHours        `json:"quietHours,omitempty"`
	Escalation      *EscalationPolicy  `json:"escalation,omitempty"`
}

AlertRuleInput is the `AlertRuleInput` schema.

type AlertRulesAdoptDefaultsParams added in v1.0.0

type AlertRulesAdoptDefaultsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AlertRulesAdoptDefaultsParams holds the parameters for `client.alertRules.adoptDefaults`.

Every field is optional; pass nil to take the defaults.

type AlertRulesAdoptDefaultsResponse added in v1.0.0

type AlertRulesAdoptDefaultsResponse struct {
	Rules   []AlertRule `json:"rules"`
	Adopted bool        `json:"adopted"`
}

AlertRulesAdoptDefaultsResponse is an object the spec declares inline.

type AlertRulesDeliveriesAckParams added in v1.0.0

type AlertRulesDeliveriesAckParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

AlertRulesDeliveriesAckParams holds the parameters for `client.alertRules.deliveries.ack`.

type AlertRulesDeliveriesAckResponse added in v1.0.0

type AlertRulesDeliveriesAckResponse struct {
	Acknowledged          bool    `json:"acknowledged"`
	AlreadyAcknowledgedBy *string `json:"alreadyAcknowledgedBy,omitempty"`
	// Reason: Why the acknowledgement did not take. `not_pending` means the
	// delivery exists but was never awaiting one — still held, already sent, or
	// expired.
	//
	// One of "not_pending", "already_escalated", "already_acknowledged".
	Reason *string `json:"reason,omitempty"`
	Title  *string `json:"title,omitempty"`
}

AlertRulesDeliveriesAckResponse is an object the spec declares inline.

type AlertRulesDeliveriesCancelParams added in v1.0.0

type AlertRulesDeliveriesCancelParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *AlertRulesDeliveriesCancelRequest
}

AlertRulesDeliveriesCancelParams holds the parameters for `client.alertRules.deliveries.cancel`.

Every field is optional; pass nil to take the defaults.

type AlertRulesDeliveriesCancelRequest added in v1.0.0

type AlertRulesDeliveriesCancelRequest struct {
	IDs []string `json:"ids"`
}

AlertRulesDeliveriesCancelRequest is an object the spec declares inline.

type AlertRulesDeliveriesCancelResponse added in v1.0.0

type AlertRulesDeliveriesCancelResponse struct {
	Cancelled int64 `json:"cancelled"`
}

AlertRulesDeliveriesCancelResponse is an object the spec declares inline.

type AlertRulesDeliveriesListParams added in v1.0.0

type AlertRulesDeliveriesListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	Limit *int64
}

AlertRulesDeliveriesListParams holds the parameters for `client.alertRules.deliveries.list`.

Every field is optional; pass nil to take the defaults.

type AlertRulesDeliveriesNamespace added in v1.0.0

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

AlertRulesDeliveriesNamespace is `client.alertRules.deliveries`.

func (*AlertRulesDeliveriesNamespace) Ack added in v1.0.0

Ack: Acknowledge an alert, cancelling its escalation

A conditional update: only a delivery still in `awaiting_ack` can move, so two people pressing at once produce one acknowledgement and an alert that already escalated cannot be retroactively silenced.

POST /api/org/{orgId}/alert-rules/deliveries/{id}/ack

Raises on 401: Unauthenticated

Raises on 403: Forbidden

Raises on 404: Not found

func (*AlertRulesDeliveriesNamespace) Cancel added in v1.0.0

Cancel: Drop held or awaiting-acknowledgement deliveries

POST /api/org/{orgId}/alert-rules/deliveries/cancel

Raises on 400: Bad request

Raises on 403: Forbidden

func (*AlertRulesDeliveriesNamespace) List added in v1.0.0

List: List recent held and escalating alerts

Only alerts a rule created follow-up work for appear here: one held by quiet hours, or one waiting on an acknowledgement. An alert that went straight out leaves no row.

GET /api/org/{orgId}/alert-rules/deliveries

Raises on 403: Forbidden

type AlertRulesGetParams added in v1.0.0

type AlertRulesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

AlertRulesGetParams holds the parameters for `client.alertRules.get`.

Every field is optional; pass nil to take the defaults.

type AlertRulesNamespace added in v1.0.0

type AlertRulesNamespace struct {

	// Deliveries: `client.alertRules.deliveries`.
	Deliveries *AlertRulesDeliveriesNamespace
	// contains filtered or unexported fields
}

AlertRulesNamespace is `client.alertRules`.

func (*AlertRulesNamespace) AdoptDefaults added in v1.0.0

AdoptDefaults: Persist the default rule so it can be edited

A no-op when the organization already has rules.

POST /api/org/{orgId}/alert-rules/adopt-defaults

Raises on 403: Forbidden

func (*AlertRulesNamespace) Get added in v1.0.0

Get: Get the organization's alert routing rules

Returns the rules in evaluation order, plus the channels and accounts a rule can name so a client can render destinations by name. An organization that has saved no rules gets the synthesized default with `usingDefaults: true`.

GET /api/org/{orgId}/alert-rules

Raises on 403: Forbidden

func (*AlertRulesNamespace) Update added in v1.0.0

Update: Replace the organization's alert routing rules

Whole-list replacement in one transaction. Order is part of the meaning — a rule is only correct relative to the ones above it — so a reorder applied as several requests would leave a window in which alerts route somewhere nobody asked for. Positions are re-derived from array order.

PUT /api/org/{orgId}/alert-rules

Raises on 400: Bad request

Raises on 403: Forbidden

type AlertRulesResponse added in v1.0.0

type AlertRulesResponse struct {
	Rules []AlertRule `json:"rules"`
	// UsingDefaults: True when the organization has saved no rules and `rules`
	// is the synthesized default — everything except drift, to every connected
	// channel and to mobile push.
	UsingDefaults   bool                                `json:"usingDefaults"`
	SlackChannels   []AlertRulesResponseSlackChannels   `json:"slackChannels"`
	MsTeamsWebhooks []AlertRulesResponseMsTeamsWebhooks `json:"msTeamsWebhooks"`
	Accounts        []AlertRulesResponseAccounts        `json:"accounts"`
	// OnCallSchedules: Live on-call rotations, so the editor can offer 'whoever
	// is on call' as a destination. Disabled rotations are omitted for the same
	// reason a disconnected Slack install is: offering one would let the editor
	// build a rule that routes nowhere.
	OnCallSchedules []AlertRulesResponseOnCallSchedules `json:"onCallSchedules"`
}

AlertRulesResponse is the `AlertRulesResponse` schema.

type AlertRulesResponseAccounts added in v1.0.0

type AlertRulesResponseAccounts struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
	PluginID    string `json:"pluginId"`
}

AlertRulesResponseAccounts is an object the spec declares inline.

type AlertRulesResponseMsTeamsWebhooks added in v1.0.0

type AlertRulesResponseMsTeamsWebhooks struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

AlertRulesResponseMsTeamsWebhooks is an object the spec declares inline.

type AlertRulesResponseOnCallSchedules added in v1.34.0

type AlertRulesResponseOnCallSchedules struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

AlertRulesResponseOnCallSchedules is an object the spec declares inline.

type AlertRulesResponseSlackChannels added in v1.0.0

type AlertRulesResponseSlackChannels struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	IsPrivate bool   `json:"isPrivate"`
}

AlertRulesResponseSlackChannels is an object the spec declares inline.

type AlertRulesUpdateParams added in v1.0.0

type AlertRulesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *AlertRulesUpdateRequest
}

AlertRulesUpdateParams holds the parameters for `client.alertRules.update`.

Every field is optional; pass nil to take the defaults.

type AlertRulesUpdateRequest added in v1.0.0

type AlertRulesUpdateRequest struct {
	Rules []AlertRuleInput `json:"rules"`
}

AlertRulesUpdateRequest is an object the spec declares inline.

type AlertRulesUpdateResponse added in v1.0.0

type AlertRulesUpdateResponse struct {
	Rules []AlertRule `json:"rules"`
}

AlertRulesUpdateResponse is an object the spec declares inline.

type AlertSeverity added in v1.0.0

type AlertSeverity = string

AlertSeverity: Alert severity, ordered info < warning < critical.

const (
	AlertSeverityInfo     AlertSeverity = "info"
	AlertSeverityWarning  AlertSeverity = "warning"
	AlertSeverityCritical AlertSeverity = "critical"
)

The values AlertSeverity takes.

type AlertTrigger added in v1.0.0

type AlertTrigger = string

AlertTrigger: A kind of alert that can be routed.

const (
	AlertTriggerSyncIncidents            AlertTrigger = "syncIncidents"
	AlertTriggerBudgetAlerts             AlertTrigger = "budgetAlerts"
	AlertTriggerAnomalyAlerts            AlertTrigger = "anomalyAlerts"
	AlertTriggerCostChangeAlerts         AlertTrigger = "costChangeAlerts"
	AlertTriggerCommitmentExpiryAlerts   AlertTrigger = "commitmentExpiryAlerts"
	AlertTriggerCommitmentIdleAlerts     AlertTrigger = "commitmentIdleAlerts"
	AlertTriggerUnitCostRegressionAlerts AlertTrigger = "unitCostRegressionAlerts"
	AlertTriggerMetricAlerts             AlertTrigger = "metricAlerts"
	AlertTriggerResourceDrift            AlertTrigger = "resourceDrift"
	AlertTriggerWorkflowPages            AlertTrigger = "workflowPages"
	AlertTriggerProviderIncidents        AlertTrigger = "providerIncidents"
	AlertTriggerExpiryAlerts             AlertTrigger = "expiryAlerts"
	AlertTriggerLogMatchAlerts           AlertTrigger = "logMatchAlerts"
	AlertTriggerPostureAlerts            AlertTrigger = "postureAlerts"
	AlertTriggerProbeAlerts              AlertTrigger = "probeAlerts"
	AlertTriggerQuotaAlerts              AlertTrigger = "quotaAlerts"
	AlertTriggerIncidentAlerts           AlertTrigger = "incidentAlerts"
	AlertTriggerWeeklyDigest             AlertTrigger = "weeklyDigest"
)

The values AlertTrigger takes.

type AllocationRule added in v0.29.0

type AllocationRule struct {
	ID           string              `json:"id"`
	CostCentreID string              `json:"costCentreId"`
	Priority     int64               `json:"priority"`
	Match        AllocationRuleMatch `json:"match"`
	CreatedAt    string              `json:"createdAt"`
	UpdatedAt    string              `json:"updatedAt"`
}

AllocationRule is the `AllocationRule` schema.

type AllocationRuleInput added in v0.29.0

type AllocationRuleInput struct {
	CostCentreID string `json:"costCentreId"`
	// Priority: Lower fires first; the first matching rule wins.
	Priority int64               `json:"priority"`
	Match    AllocationRuleMatch `json:"match"`
}

AllocationRuleInput is the `AllocationRuleInput` schema.

type AllocationRuleMatch added in v0.29.0

type AllocationRuleMatch struct {
	TagKey *string `json:"tagKey,omitempty"`
	// TagValue: Only meaningful with tagKey; alone, tagKey matches rows carrying
	// the key.
	TagValue  *string `json:"tagValue,omitempty"`
	AccountID *string `json:"accountId,omitempty"`
	PluginID  *string `json:"pluginId,omitempty"`
	Service   *string `json:"service,omitempty"`
}

AllocationRuleMatch: All set fields must match (AND). A rule with no fields is a catch-all that claims everything reaching it.

type ApplyManifestRequest

type ApplyManifestRequest struct {
	AccountID        string      `json:"accountId"`
	ResourceID       ResourceID  `json:"resourceId"`
	Manifest         string      `json:"manifest"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

ApplyManifestRequest is the `ApplyManifestRequest` schema.

type AppsCheckParams added in v1.31.0

type AppsCheckParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body LinuxAppHostTarget
}

AppsCheckParams holds the parameters for `client.apps.check`.

type AppsNamespace added in v1.31.0

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

AppsNamespace is `client.apps`.

func (*AppsNamespace) Check added in v1.31.0

Check: Check whether a host can run Linux applications

Runs a read-only shell probe over SSH and reports what the host is missing, plus the packages and commands that would fix it. A POST because it opens a connection to the named host and must never be cached — its whole value is saying what the host is now.

POST /api/org/{orgId}/apps/check

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: The host key is new or has changed; trust it and retry

Raises on 502: The host could not be reached or probed

func (*AppsNamespace) Setup added in v1.31.0

Setup: Install what a host needs to run Linux applications

Installs the named requirements using the host's own package manager, then re-probes and reports what the host now is. Takes requirement ids, never commands — the commands are derived server-side from a fresh probe. Needs root or passwordless sudo on the host, respects change freezes, and is audited as `linux_app.host_setup`.

Responds with `application/x-ndjson`: one `{"line":"…"}` per line of package-manager output, then a final `{"outcome":{…}}`. A failure arrives as `{"error":"…"}` inside the stream, because the status line has already been sent by then.

POST /api/org/{orgId}/apps/setup

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: A change freeze is in effect, or the host key needs trusting

type AppsSetupParams added in v1.31.0

type AppsSetupParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body LinuxAppSetupRequest
}

AppsSetupParams holds the parameters for `client.apps.setup`.

type ArtifactsListParams

type ArtifactsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ArtifactsListRequest
}

ArtifactsListParams holds the parameters for `client.artifacts.list`.

type ArtifactsListRequest

type ArtifactsListRequest struct {
	AccountID      string     `json:"accountId"`
	ResourceID     ResourceID `json:"resourceId"`
	ResourceTypeID string     `json:"resourceTypeId"`
	PageToken      *string    `json:"pageToken,omitempty"`
	Prefix         *string    `json:"prefix,omitempty"`
}

ArtifactsListRequest is the `ArtifactsListRequest` schema.

type ArtifactsNamespace

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

ArtifactsNamespace is `client.artifacts`.

func (*ArtifactsNamespace) List

List: List artifact-registry items for a resource

_Requires permission: `storage:read`._

POST /api/org/{orgId}/artifacts/list

Raises on 400: Bad request

Raises on 404: Not found

Raises on 500: Server error

type AssociationRequest

type AssociationRequest struct {
	ConsumerResourceID     ResourceID `json:"consumerResourceId"`
	ConsumerFieldKey       string     `json:"consumerFieldKey"`
	ProviderResourceID     ResourceID `json:"providerResourceId"`
	ProviderOutputKey      string     `json:"providerOutputKey"`
	ProviderPluginID       string     `json:"providerPluginId"`
	ProviderResourceTypeID string     `json:"providerResourceTypeId"`
	ProviderAccountID      string     `json:"providerAccountId"`
}

AssociationRequest is the `AssociationRequest` schema.

type AssociationsCreateParams

type AssociationsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body AssociationRequest
}

AssociationsCreateParams holds the parameters for `client.associations.create`.

type AssociationsLiteralParams

type AssociationsLiteralParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body LiteralAssociationRequest
}

AssociationsLiteralParams holds the parameters for `client.associations.literal`.

type AssociationsNamespace

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

AssociationsNamespace is `client.associations`.

func (*AssociationsNamespace) Create

Create: Wire one resource's output into another resource's secret field

_Requires permission: `secrets:write`._

POST /api/org/{orgId}/associations

Raises on 404: Not found

func (*AssociationsNamespace) Literal

Literal: Set a secret field to a literal plaintext value

_Requires permission: `secrets:write`._

POST /api/org/{orgId}/associations/literal

Raises on 404: Not found

type AttachRequest

type AttachRequest struct {
	PluginID         string     `json:"pluginId"`
	AccountID        string     `json:"accountId"`
	SourceTypeID     string     `json:"sourceTypeId"`
	SourceResourceID ResourceID `json:"sourceResourceId"`
	TargetTypeID     string     `json:"targetTypeId"`
	TargetResourceID ResourceID `json:"targetResourceId"`
}

AttachRequest is the `AttachRequest` schema.

type AuditEntry

type AuditEntry struct {
	ID           string     `json:"id"`
	UserID       *string    `json:"userId"`
	APIKeyID     *string    `json:"apiKeyId"`
	Action       string     `json:"action"`
	EntityType   string     `json:"entityType"`
	EntityID     string     `json:"entityId"`
	Metadata     JSONObject `json:"metadata"`
	IPAddress    *string    `json:"ipAddress"`
	CreatedAt    string     `json:"createdAt"`
	UserName     *string    `json:"userName"`
	UserEmail    *string    `json:"userEmail"`
	APIKeyName   *string    `json:"apiKeyName"`
	APIKeyPrefix *string    `json:"apiKeyPrefix"`
}

AuditEntry is the `AuditEntry` schema.

type AuditLogsGetParams

type AuditLogsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	Page       *int64
	PageSize   *int64
	Action     *string
	EntityType *string
	UserID     *string
	APIKeyID   *string
	From       *string
	To         *string
}

AuditLogsGetParams holds the parameters for `client.auditLogs.get`.

Every field is optional; pass nil to take the defaults.

type AuditLogsNamespace

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

AuditLogsNamespace is `client.auditLogs`.

func (*AuditLogsNamespace) Get

Get: List audit log entries (paginated, filterable)

_Requires permission: `audit:read`._

GET /api/org/{orgId}/audit-logs

type AuditResponse

type AuditResponse struct {
	Entries []AuditEntry `json:"entries"`
	Total   int64        `json:"total"`
}

AuditResponse is the `AuditResponse` schema.

type AuthFactor

type AuthFactor struct {
	ID string `json:"id"`
	// Type: One of "totp", "sms", "generic_otp".
	Type       string  `json:"type"`
	CreatedAt  string  `json:"createdAt"`
	UpdatedAt  string  `json:"updatedAt"`
	TOTPIssuer *string `json:"totpIssuer"`
	TOTPUser   *string `json:"totpUser"`
}

AuthFactor is the `AuthFactor` schema.

type AuthNamespace

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

AuthNamespace is `client.auth`.

func (*AuthNamespace) Me

func (n *AuthNamespace) Me(ctx context.Context, opts ...RequestOption) (*Session, error)

Me: Current session + onboarding status

GET /api/auth/me

Raises on 401: Unauthenticated

func (*AuthNamespace) Orgs

func (n *AuthNamespace) Orgs(ctx context.Context, opts ...RequestOption) ([]OrgMembership, error)

Orgs: Organizations the current user belongs to

GET /api/auth/orgs

Raises on 401: Unauthenticated

type BackupCoverageResponse added in v1.19.0

type BackupCoverageResponse struct {
	// Findings: Gaps, worst severity first.
	Findings    []BackupFinding       `json:"findings"`
	Counts      BackupSeverityCounts  `json:"counts"`
	KindCounts  BackupKindCounts      `json:"kindCounts"`
	TotalCount  int64                 `json:"totalCount"`
	Resources   []BackupCoverageRow   `json:"resources"`
	Summary     BackupCoverageSummary `json:"summary"`
	GeneratedAt string                `json:"generatedAt"`
}

BackupCoverageResponse is the `BackupCoverageResponse` schema.

type BackupCoverageRow added in v1.19.0

type BackupCoverageRow struct {
	ResourceID       string   `json:"resourceId"`
	PluginID         PluginID `json:"pluginId"`
	PluginName       string   `json:"pluginName"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
	AccountName      string   `json:"accountName"`
	DisplayName      string   `json:"displayName"`
	ExternalID       *string  `json:"externalId"`
	// State: How the resource reads at a glance. `automated` means the provider
	// is taking backups we cannot enumerate, so there is a restore point but no
	// listable one. `unknown` means the resource type declares a provider-native
	// automated-backup signal but this instance's value could not be read — it
	// is unassessed, not a confirmed gap, and never produces a finding.
	//
	// One of "protected", "automated", "stale", "unknown", "unprotected".
	State string `json:"state"`
	// BackupCount: Backups in the inventory that protect this resource.
	BackupCount      int64    `json:"backupCount"`
	LatestBackupID   *string  `json:"latestBackupId"`
	LatestBackupName *string  `json:"latestBackupName"`
	LatestBackupAt   *string  `json:"latestBackupAt"`
	RpoHours         *float64 `json:"rpoHours"`
	// AutomatedBackups: Whether provider-native automated backups are on. Null
	// means the plugin syncs no signal either way — which never counts as
	// protection and never counts as a fault.
	AutomatedBackups *bool    `json:"automatedBackups"`
	RetentionDays    *float64 `json:"retentionDays"`
	// RpoPolicyID: The policy supplying `maxRpoHours` — the strictest RPO among
	// those selecting this resource. Tracked separately from the retention
	// policy because the two strictest demands routinely come from different
	// policies.
	RpoPolicyID   *string `json:"rpoPolicyId"`
	RpoPolicyName *string `json:"rpoPolicyName"`
	// RetentionPolicyID: The policy supplying `minRetentionDays`.
	RetentionPolicyID   *string `json:"retentionPolicyId"`
	RetentionPolicyName *string `json:"retentionPolicyName"`
	MaxRpoHours         *int64  `json:"maxRpoHours"`
	MinRetentionDays    *int64  `json:"minRetentionDays"`
}

BackupCoverageRow is the `BackupCoverageRow` schema.

type BackupCoverageSummary added in v1.19.0

type BackupCoverageSummary struct {
	// StatefulCount: Stateful resources the plugin declarations can judge.
	StatefulCount  int64 `json:"statefulCount"`
	ProtectedCount int64 `json:"protectedCount"`
	// UnprotectedCount: Confirmed gaps. Excludes unassessed resources; this is
	// what the digest counts.
	UnprotectedCount int64 `json:"unprotectedCount"`
	// UnknownCount: Resources that could not be assessed: the type declares a
	// provider-native automated-backup signal but this instance's value was
	// absent or unrecognised. Reported separately so 'we found no gap' and 'we
	// could not tell' do not read alike.
	UnknownCount        int64 `json:"unknownCount"`
	BackupCount         int64 `json:"backupCount"`
	OrphanedBackupCount int64 `json:"orphanedBackupCount"`
	// UnattributableBackupCount: Backups whose source could not be determined —
	// the plugin syncs no source field, the field was empty, or more than one
	// resource answered to it. Reported rather than hidden: 'we found no
	// orphans' and 'we could not tell' are different answers.
	UnattributableBackupCount int64    `json:"unattributableBackupCount"`
	OrphanedGb                *float64 `json:"orphanedGb"`
	// OrphanedMonthlyCost: Null when billing data is unavailable or the orphans
	// span several currencies.
	OrphanedMonthlyCost *float64 `json:"orphanedMonthlyCost"`
	Currency            *string  `json:"currency"`
	// WorstRpoHours: Largest RPO across resources that have a datable backup at
	// all.
	WorstRpoHours *float64 `json:"worstRpoHours"`
}

BackupCoverageSummary is the `BackupCoverageSummary` schema.

type BackupFinding added in v1.19.0

type BackupFinding struct {
	// ResourceID: Infrawrench resource id the finding is on.
	ResourceID       string   `json:"resourceId"`
	PluginID         PluginID `json:"pluginId"`
	PluginName       string   `json:"pluginName"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
	AccountName      string   `json:"accountName"`
	DisplayName      string   `json:"displayName"`
	// ExternalID: Provider-native id, when known.
	ExternalID *string `json:"externalId"`
	// Kind: What the finding describes: nothing protects the resource; the
	// newest backup is older than the policy's RPO; the provider-native
	// retention window is shorter than the policy asks; or a backup whose source
	// resource no longer exists.
	//
	// One of "unprotected", "rpo-breach", "retention-below-policy",
	// "orphaned-snapshot".
	Kind string `json:"kind"`
	// Severity: How bad the gap is. Orphaned backups are always `low` — they
	// cost money, not data.
	//
	// One of "critical", "high", "medium", "low".
	Severity string `json:"severity"`
	Title    string `json:"title"`
	// Detail: Sentence explaining the gap and what would close it.
	Detail string `json:"detail"`
	// PolicyID: The policy supplying the objective this finding breaches — the
	// RPO policy for `rpo-breach`, the retention policy for
	// `retention-below-policy`. Null when no policy applies.
	PolicyID   *string `json:"policyId"`
	PolicyName *string `json:"policyName"`
	// RpoHours: Hours since the newest backup protecting the resource; null when
	// there is none.
	RpoHours *float64 `json:"rpoHours"`
	// MaxRpoHours: The policy's allowance, when one applied.
	MaxRpoHours *int64 `json:"maxRpoHours"`
	// RetentionDays: Provider-native retention window in days, when the plugin
	// syncs one.
	RetentionDays    *float64 `json:"retentionDays"`
	MinRetentionDays *int64   `json:"minRetentionDays"`
	LatestBackupID   *string  `json:"latestBackupId"`
	LatestBackupName *string  `json:"latestBackupName"`
	LatestBackupAt   *string  `json:"latestBackupAt"`
	// SizeGb: Size of an orphaned backup in GiB, when the plugin syncs one.
	SizeGb *float64 `json:"sizeGb"`
	// MonthlyCost: Trailing-30-day spend on an orphaned backup. Null means the
	// cost could not be determined — never that the backup is free.
	MonthlyCost *float64 `json:"monthlyCost"`
	Currency    *string  `json:"currency"`
}

BackupFinding is the `BackupFinding` schema.

type BackupKindCounts added in v1.19.0

type BackupKindCounts struct {
	Unprotected          int64 `json:"unprotected"`
	RpoBreach            int64 `json:"rpo-breach"`
	RetentionBelowPolicy int64 `json:"retention-below-policy"`
	OrphanedSnapshot     int64 `json:"orphaned-snapshot"`
}

BackupKindCounts is the `BackupKindCounts` schema.

type BackupPolicy added in v1.19.0

type BackupPolicy struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// ResourceTypeIDs: Resource types the policy selects; empty selects every
	// stateful type.
	ResourceTypeIDs []string `json:"resourceTypeIds"`
	// TagKey: Tag key that must be present. Matched case-insensitively.
	TagKey *string `json:"tagKey"`
	// TagValue: Required value of `tagKey`, matched exactly. Null means presence
	// is enough.
	TagValue *string `json:"tagValue"`
	// MaxRpoHours: The newest backup must be no older than this. Null means no
	// RPO demand.
	MaxRpoHours *int64 `json:"maxRpoHours"`
	// MinRetentionDays: Provider-native retention must be at least this. Null
	// means no demand.
	MinRetentionDays *int64 `json:"minRetentionDays"`
	Enabled          bool   `json:"enabled"`
	CreatedAt        string `json:"createdAt"`
	UpdatedAt        string `json:"updatedAt"`
}

BackupPolicy is the `BackupPolicy` schema.

type BackupPolicyCreate added in v1.19.0

type BackupPolicyCreate struct {
	Name             string   `json:"name"`
	ResourceTypeIDs  []string `json:"resourceTypeIds,omitempty"`
	TagKey           *string  `json:"tagKey,omitempty"`
	TagValue         *string  `json:"tagValue,omitempty"`
	MaxRpoHours      *int64   `json:"maxRpoHours,omitempty"`
	MinRetentionDays *int64   `json:"minRetentionDays,omitempty"`
	Enabled          *bool    `json:"enabled,omitempty"`
}

BackupPolicyCreate is the `BackupPolicyCreate` schema.

type BackupPolicyList added in v1.19.0

type BackupPolicyList struct {
	Policies []BackupPolicy `json:"policies"`
}

BackupPolicyList is the `BackupPolicyList` schema.

type BackupPolicyUpdate added in v1.19.0

type BackupPolicyUpdate struct {
	Name             *string  `json:"name,omitempty"`
	ResourceTypeIDs  []string `json:"resourceTypeIds,omitempty"`
	TagKey           *string  `json:"tagKey,omitempty"`
	TagValue         *string  `json:"tagValue,omitempty"`
	MaxRpoHours      *int64   `json:"maxRpoHours,omitempty"`
	MinRetentionDays *int64   `json:"minRetentionDays,omitempty"`
	Enabled          *bool    `json:"enabled,omitempty"`
}

BackupPolicyUpdate is the `BackupPolicyUpdate` schema.

type BackupSeverityCounts added in v1.19.0

type BackupSeverityCounts struct {
	Critical int64 `json:"critical"`
	High     int64 `json:"high"`
	Medium   int64 `json:"medium"`
	Low      int64 `json:"low"`
}

BackupSeverityCounts is the `BackupSeverityCounts` schema.

type BackupsDrillsCreateParams added in v1.36.0

type BackupsDrillsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *RestoreDrillCreate
}

BackupsDrillsCreateParams holds the parameters for `client.backups.drills.create`.

Every field is optional; pass nil to take the defaults.

type BackupsDrillsDeleteParams added in v1.36.0

type BackupsDrillsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	DrillID string
}

BackupsDrillsDeleteParams holds the parameters for `client.backups.drills.delete`.

type BackupsDrillsGetParams added in v1.36.0

type BackupsDrillsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ValidDays: How long a verified drill counts for. Defaults to 180 days.
	ValidDays *int64
}

BackupsDrillsGetParams holds the parameters for `client.backups.drills.get`.

Every field is optional; pass nil to take the defaults.

type BackupsDrillsLogParams added in v1.36.0

type BackupsDrillsLogParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ResourceID *string
}

BackupsDrillsLogParams holds the parameters for `client.backups.drills.log`.

Every field is optional; pass nil to take the defaults.

type BackupsDrillsLogResponse added in v1.36.0

type BackupsDrillsLogResponse struct {
	Drills []RestoreDrill `json:"drills"`
}

BackupsDrillsLogResponse is an object the spec declares inline.

type BackupsDrillsNamespace added in v1.36.0

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

BackupsDrillsNamespace is `client.backups.drills`.

func (*BackupsDrillsNamespace) Create added in v1.36.0

Create: Record a restore drill

A `verified` drill **must** carry the measured time: an RPO comes from the backup, and an RTO can only come from somebody with a stopwatch — that number is the entire point of the exercise. A `blocked` drill must not carry one, because it never started.

Takes `resources:write`, not a settings permission: recording a drill is reporting what you did, and the person who spent Saturday restoring a database is rarely the person who set the recovery objective.

POST /api/org/{orgId}/backups/drills

Raises on 400: Bad request

func (*BackupsDrillsNamespace) Delete added in v1.36.0

Delete: Delete a recorded drill

For one recorded against the wrong resource or the wrong date. Audited — deleting evidence that a restore failed is exactly the edit a reviewer would want to know about.

DELETE /api/org/{orgId}/backups/drills/{drillId}

Raises on 404: Not found

func (*BackupsDrillsNamespace) Get added in v1.36.0

Get: Where every protected resource stands on restore

Backup coverage answers 'is there a backup'. This answers 'does it restore, and how long does it take' — a different question, and the one routinely answered wrongly on the day.

A drill is a **record that somebody tried**, not an automated restore: restoring a customer's database unattended costs real money, can collide with production, and cannot be generically verified. What the product can do is make the exercise scheduled, recorded and visible when it lapses.

GET /api/org/{orgId}/backups/drills

Raises on 400: Bad request

func (*BackupsDrillsNamespace) Log added in v1.36.0

Log: List recorded restore drills

GET /api/org/{orgId}/backups/drills/log

type BackupsGetParams added in v1.19.0

type BackupsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BackupsGetParams holds the parameters for `client.backups.get`.

Every field is optional; pass nil to take the defaults.

type BackupsNamespace added in v1.19.0

type BackupsNamespace struct {

	// Drills: `client.backups.drills`.
	Drills *BackupsDrillsNamespace
	// Policies: `client.backups.policies`.
	Policies *BackupsPoliciesNamespace
	// contains filtered or unexported fields
}

BackupsNamespace is `client.backups`.

func (*BackupsNamespace) Get added in v1.19.0

Get: List backup coverage across synced resources

What protects the organization's stateful resources, what does not, and which backups protect nothing. Derived from already-synced inventory using the `backupRole` and `backupPolicy` declarations plugins carry on their resource types — no provider API calls are made and results reflect the last sync. Findings are recomputed on every read rather than stored. Orphaned backups carry a trailing-30-day spend quote when billing data is available.

GET /api/org/{orgId}/backups

type BackupsPoliciesCreateParams added in v1.19.0

type BackupsPoliciesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *BackupPolicyCreate
}

BackupsPoliciesCreateParams holds the parameters for `client.backups.policies.create`.

Every field is optional; pass nil to take the defaults.

type BackupsPoliciesDeleteParams added in v1.19.0

type BackupsPoliciesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PolicyID string
}

BackupsPoliciesDeleteParams holds the parameters for `client.backups.policies.delete`.

type BackupsPoliciesGetParams added in v1.19.0

type BackupsPoliciesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BackupsPoliciesGetParams holds the parameters for `client.backups.policies.get`.

Every field is optional; pass nil to take the defaults.

type BackupsPoliciesNamespace added in v1.19.0

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

BackupsPoliciesNamespace is `client.backups.policies`.

func (*BackupsPoliciesNamespace) Create added in v1.19.0

Create: Create a backup policy

A policy must demand at least one of `maxRpoHours` and `minRetentionDays` — one that demands nothing could never produce a finding and would read as protection while providing none. An empty `resourceTypeIds` selects every stateful resource type.

POST /api/org/{orgId}/backups/policies

Raises on 400: Bad request

Raises on 409: Conflict

func (*BackupsPoliciesNamespace) Delete added in v1.19.0

Delete: Delete a backup policy

Removes the objective. To stop a policy judging without losing it, set `enabled` to false instead.

DELETE /api/org/{orgId}/backups/policies/{policyId}

Raises on 404: Not found

func (*BackupsPoliciesNamespace) Get added in v1.19.0

Get: List the organization's backup policies

The recovery objectives coverage is judged against. A policy selects resources by type and/or tag and demands a maximum RPO, a minimum retention, or both.

GET /api/org/{orgId}/backups/policies

func (*BackupsPoliciesNamespace) Update added in v1.19.0

Update: Update a backup policy

Omitted fields are left alone; an explicit `null` clears `tagKey`, `tagValue`, `maxRpoHours` or `minRetentionDays`. The result is validated after merging, so a patch that would leave the policy demanding nothing is rejected.

PATCH /api/org/{orgId}/backups/policies/{policyId}

Raises on 400: Bad request

Raises on 404: Not found

type BackupsPoliciesUpdateParams added in v1.19.0

type BackupsPoliciesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PolicyID string
	// Body: the JSON request body.
	Body *BackupPolicyUpdate
}

BackupsPoliciesUpdateParams holds the parameters for `client.backups.policies.update`.

type Bastion

type Bastion struct {
	ID              string        `json:"id"`
	Name            string        `json:"name"`
	TokenPrefix     string        `json:"tokenPrefix"`
	AgentVersion    *string       `json:"agentVersion"`
	LastSeenAt      *string       `json:"lastSeenAt"`
	Status          BastionStatus `json:"status"`
	RevokedAt       *string       `json:"revokedAt"`
	CreatedAt       string        `json:"createdAt"`
	CreatedByUserID string        `json:"createdByUserId"`
	Connected       bool          `json:"connected"`
	AccountCount    int64         `json:"accountCount"`
}

Bastion is the `Bastion` schema.

type BastionStatus

type BastionStatus = string

BastionStatus is the `BastionStatus` schema.

const (
	BastionStatusPending BastionStatus = "pending"
	BastionStatusActive  BastionStatus = "active"
	BastionStatusRevoked BastionStatus = "revoked"
)

The values BastionStatus takes.

type BastionsCreateParams

type BastionsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreateBastionRequest
}

BastionsCreateParams holds the parameters for `client.bastions.create`.

type BastionsDeleteParams

type BastionsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

BastionsDeleteParams holds the parameters for `client.bastions.delete`.

type BastionsListParams

type BastionsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BastionsListParams holds the parameters for `client.bastions.list`.

Every field is optional; pass nil to take the defaults.

type BastionsNamespace

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

BastionsNamespace is `client.bastions`.

func (*BastionsNamespace) Create

Create: Register a new bastion (returns the enrollment token once)

_Requires permission: `bastions:write`._

POST /api/org/{orgId}/bastions

Raises on 400: Bad request

func (*BastionsNamespace) Delete

func (n *BastionsNamespace) Delete(ctx context.Context, params BastionsDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Revoke a bastion — accounts referencing it have their bastion binding cleared

_Requires permission: `bastions:write`._

DELETE /api/org/{orgId}/bastions/{id}

Raises on 404: Not found

func (*BastionsNamespace) List

func (n *BastionsNamespace) List(ctx context.Context, params *BastionsListParams, opts ...RequestOption) ([]Bastion, error)

List: List bastion agents registered to this org

_Requires permission: `bastions:read`._

GET /api/org/{orgId}/bastions

type BillingCapacityCheckoutParams added in v0.37.0

type BillingCapacityCheckoutParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *CapacityCheckoutRequest
}

BillingCapacityCheckoutParams holds the parameters for `client.billing.capacity.checkout`.

Every field is optional; pass nil to take the defaults.

type BillingCapacityNamespace added in v0.37.0

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

BillingCapacityNamespace is `client.billing.capacity`.

func (*BillingCapacityNamespace) Checkout added in v0.37.0

Checkout: Start a Stripe Checkout session for prepaid capacity slots

A capacity slot is one seat bought outright for a fixed term instead of rented monthly, and it grants paid-plan access on its own. This is a one-time payment, so the seats are granted by the `checkout.session.completed` webhook once Stripe confirms the payment — a 200 here only means the buyer was sent to a payment page. Rejected with 400 for complimentary organizations, and 503 when the deployment has no one-time capacity price configured.

POST /api/org/{orgId}/billing/capacity/checkout

Raises on 400: Bad request

Raises on 500: Server error

Raises on 503: A backing service this endpoint depends on is not available

type BillingCheckoutParams

type BillingCheckoutParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BillingCheckoutParams holds the parameters for `client.billing.checkout`.

Every field is optional; pass nil to take the defaults.

type BillingNamespace

type BillingNamespace struct {

	// Capacity: `client.billing.capacity`.
	Capacity *BillingCapacityNamespace
	// contains filtered or unexported fields
}

BillingNamespace is `client.billing`.

func (*BillingNamespace) Checkout

Checkout: Start a Stripe Checkout session

Rejected with 400 for complimentary organizations — they are never billed.

_Requires permission: `billing:write`._

POST /api/org/{orgId}/billing/checkout

Raises on 400: Bad request

Raises on 500: Server error

func (*BillingNamespace) Portal

Portal: Get a Stripe customer portal URL

_Requires permission: `billing:write`._

POST /api/org/{orgId}/billing/portal

Raises on 404: Not found

func (*BillingNamespace) Status

Status: Get the org's billing status (complimentary flag + subscription or `null`)

_Requires permission: `billing:read`._

GET /api/org/{orgId}/billing/status

type BillingPortalParams

type BillingPortalParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BillingPortalParams holds the parameters for `client.billing.portal`.

Every field is optional; pass nil to take the defaults.

type BillingRule added in v1.9.0

type BillingRule struct {
	ID          string                `json:"id"`
	Name        string                `json:"name"`
	Description *string               `json:"description"`
	Enabled     bool                  `json:"enabled"`
	Priority    int64                 `json:"priority"`
	Match       BillingRuleMatch      `json:"match"`
	Adjustment  BillingRuleAdjustment `json:"adjustment"`
	CreatedAt   string                `json:"createdAt"`
	UpdatedAt   string                `json:"updatedAt"`
}

BillingRule is the `BillingRule` schema.

type BillingRuleAdjustment added in v1.9.0

type BillingRuleAdjustment struct {
	// Kind: `percentage` multiplies matched spend (every matching percentage
	// rule applies, so two 10% markups compound to 21%). `fixed` adds a flat
	// amount per period, pro-rated across the queried range, and is never
	// multiplied by anything. `reallocation` moves matched spend onto another
	// cost centre or account; the first matching reallocation rule wins, so a
	// row moves exactly once and the organisation's total is unchanged.
	//
	// One of "percentage", "fixed", "reallocation".
	Kind string `json:"kind"`
	// Percent: `percentage` only. Signed: +15 marks up by 15%, -10 discounts by
	// 10%. Bounded below at -100 because a discount larger than the cost would
	// turn spend into income.
	Percent *float64 `json:"percent,omitempty"`
	// Amount: `fixed` only, in the major unit of `currency`, per `period`.
	Amount   *float64 `json:"amount,omitempty"`
	Currency *string  `json:"currency,omitempty"`
	// Period: `fixed` only. A monthly amount is pro-rated across partial months:
	// a range covering ten days of a 31-day month contributes 10/31 of it.
	//
	// One of "daily", "monthly".
	Period *string `json:"period,omitempty"`
	// TargetKind: Required on `reallocation`, optional on `fixed` (where the
	// flat charge is booked), never set on `percentage`.
	//
	// One of "cost_centre", "account".
	TargetKind *string `json:"targetKind,omitempty"`
	TargetID   *string `json:"targetId,omitempty"`
}

BillingRuleAdjustment is the `BillingRuleAdjustment` schema.

type BillingRuleInput added in v1.9.0

type BillingRuleInput struct {
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	// Enabled: Disabled rules are kept and excluded from every query. Switching
	// a markup off for a quarter is an edit, not a delete.
	Enabled *bool `json:"enabled,omitempty"`
	// Priority: Lower evaluates first. Percentage rules all apply regardless of
	// order (multiplication commutes); reallocation is first-match-wins, so
	// priority decides which one moves a row.
	Priority   int64                 `json:"priority"`
	Match      BillingRuleMatch      `json:"match"`
	Adjustment BillingRuleAdjustment `json:"adjustment"`
}

BillingRuleInput is the `BillingRuleInput` schema.

type BillingRuleMatch added in v1.9.0

type BillingRuleMatch struct {
	TagKey *string `json:"tagKey,omitempty"`
	// TagValue: Only meaningful with tagKey; alone, tagKey matches rows carrying
	// the key.
	TagValue  *string `json:"tagValue,omitempty"`
	AccountID *string `json:"accountId,omitempty"`
	PluginID  *string `json:"pluginId,omitempty"`
	Service   *string `json:"service,omitempty"`
	// ChargeType: Narrow to one kind of charge. A markup that recovers overhead
	// usually should not apply to credits, refunds or commitment purchases, and
	// this is how that is expressed.
	//
	// One of "usage", "commitment_covered_usage", "commitment_fee",
	// "commitment_discount", "credit", "tax", "refund", "adjustment", "support",
	// "other".
	ChargeType *string `json:"chargeType,omitempty"`
}

BillingRuleMatch: All set fields must match (AND); a rule with no fields matches all spend. The same vocabulary allocation rules use, plus chargeType.

type BillingRulesCreateParams added in v1.9.0

type BillingRulesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body BillingRuleInput
}

BillingRulesCreateParams holds the parameters for `client.billingRules.create`.

type BillingRulesDeleteParams added in v1.9.0

type BillingRulesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

BillingRulesDeleteParams holds the parameters for `client.billingRules.delete`.

type BillingRulesGetParams added in v1.9.0

type BillingRulesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

BillingRulesGetParams holds the parameters for `client.billingRules.get`.

type BillingRulesListParams added in v1.9.0

type BillingRulesListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BillingRulesListParams holds the parameters for `client.billingRules.list`.

Every field is optional; pass nil to take the defaults.

type BillingRulesNamespace added in v1.9.0

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

BillingRulesNamespace is `client.billingRules`.

func (*BillingRulesNamespace) Create added in v1.9.0

Create: Create a billing rule

Requires `org:settings:write` rather than `costs:write`: a billing rule changes every figure the organisation reports about itself, which is a governance act on the scale of stating an exchange rate, not the scale of saving a report.

_Requires permission: `org:settings:write`._

POST /api/org/{orgId}/billing-rules

Raises on 400: Bad request

Raises on 409: Conflict

func (*BillingRulesNamespace) Delete added in v1.9.0

Delete: Delete a billing rule

Nothing cascades and nothing is restated: no adjustment was ever written into stored cost data, so the next read simply computes without this rule.

_Requires permission: `org:settings:write`._

DELETE /api/org/{orgId}/billing-rules/{id}

Raises on 404: Not found

func (*BillingRulesNamespace) Get added in v1.9.0

Get: Get a billing rule

_Requires permission: `costs:read`._

GET /api/org/{orgId}/billing-rules/{id}

Raises on 404: Not found

func (*BillingRulesNamespace) List added in v1.9.0

List: List billing rules in evaluation order

Billing rules are the organisation's own adjustments to collected spend — a markup that recovers shared overhead, a discount negotiated outside the provider's pricing, a shared cluster reallocated onto the teams that use it.

**They are applied at query time and never written into stored cost data.** Collected spend stays exactly what the provider reported, so it can still be reconciled against an invoice, and editing or deleting a rule restates nothing.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/billing-rules

func (*BillingRulesNamespace) Update added in v1.9.0

Update: Update a billing rule

A full replace, `enabled` included — switching a markup off is an edit of the rule, so there is one audited action for “this rule changed” rather than two.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/billing-rules/{id}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

type BillingRulesUpdateParams added in v1.9.0

type BillingRulesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body BillingRuleInput
}

BillingRulesUpdateParams holds the parameters for `client.billingRules.update`.

type BillingStatus

type BillingStatus struct {
	// Complimentary: Platform-granted complimentary access: all paid perks,
	// uncapped AI chat, never billed.
	Complimentary bool           `json:"complimentary"`
	Subscription  *Subscription  `json:"subscription"`
	Capacity      CapacityStatus `json:"capacity"`
}

BillingStatus is the `BillingStatus` schema.

type BillingStatusParams

type BillingStatusParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BillingStatusParams holds the parameters for `client.billing.status`.

Every field is optional; pass nil to take the defaults.

type BlastRadiusDependant added in v1.13.0

type BlastRadiusDependant struct {
	Node *BlastRadiusNode `json:"node"`
	// Depth: Shortest hop count from the resource: 1 is a direct dependant, 2 or
	// more reached it through something else. The resource itself is never
	// listed.
	Depth int64 `json:"depth"`
	// Via: How a direct dependant reaches the resource. Absent for transitive
	// dependants, whose path is several edges and has no single caption.
	Via *BlastRadiusDependantVia `json:"via,omitempty"`
}

BlastRadiusDependant is the `BlastRadiusDependant` schema.

type BlastRadiusDependantVia added in v1.13.0

type BlastRadiusDependantVia struct {
	// FieldKey: The dependant's field holding the reference.
	FieldKey string `json:"fieldKey"`
	// OutputKey: The output or identity the reference reads.
	OutputKey string `json:"outputKey"`
	// Kind: Where the edge came from. Absent means `output-ref` — a reference
	// wired by hand.
	//
	// One of "output-ref", "declared", "containment", "field-match".
	Kind *string `json:"kind,omitempty"`
	// Label: How the plugin words the relationship ("in VPC"), when it declared
	// one.
	Label *string `json:"label,omitempty"`
}

BlastRadiusDependantVia is an object the spec declares inline.

type BlastRadiusFlowPeer added in v1.13.0

type BlastRadiusFlowPeer struct {
	// Ref: The peer's flow ref — a provider resource id, or a class token like
	// `internet`.
	Ref   string `json:"ref"`
	Label string `json:"label"`
	// Direction: Relative to the resource being deleted, not to the row the
	// provider captured.
	//
	// One of "egress", "ingress".
	Direction string `json:"direction"`
	// Scope: The boundary the traffic crossed.
	Scope         string  `json:"scope"`
	Bytes         float64 `json:"bytes"`
	EstimatedCost float64 `json:"estimatedCost"`
	Currency      string  `json:"currency"`
	// Days: Days in the window this peer appeared on — a spike versus a standing
	// flow.
	Days       int64       `json:"days"`
	ResourceID *ResourceID `json:"resourceId"`
}

BlastRadiusFlowPeer is the `BlastRadiusFlowPeer` schema.

type BlastRadiusGap added in v1.13.0

type BlastRadiusGap struct {
	// Kind: One of "network-flows", "dependency-graph", "references",
	// "workflow-source", "custom-graph-source".
	Kind string `json:"kind"`
	// Reason: A full sentence, written to be rendered verbatim to the person
	// deleting.
	Reason string `json:"reason"`
}

BlastRadiusGap is the `BlastRadiusGap` schema.

type BlastRadiusGetParams added in v1.13.0

type BlastRadiusGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ResourceID ResourceID
}

BlastRadiusGetParams holds the parameters for `client.blastRadius.get`.

type BlastRadiusNamespace added in v1.13.0

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

BlastRadiusNamespace is `client.blastRadius`.

func (*BlastRadiusNamespace) Get added in v1.13.0

Get: What breaks if this resource is deleted

An impact report for one resource, assembled from the dependency graph walked inbound, network flow attribution, and the org objects that name the resource without depending on it (dashboards, custom graphs, probes, status pages, metric alerts, leases, schedules, saved log queries, workflows, and its recorded owner).

The endpoint answers 200 with a partial report rather than failing when a source is unavailable; `unchecked` says which, in prose.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/blast-radius

Raises on 400: Missing resourceId

type BlastRadiusNode added in v1.13.0

type BlastRadiusNode struct {
	ID                ResourceID `json:"id"`
	DisplayName       string     `json:"displayName"`
	PluginID          string     `json:"pluginId"`
	PluginDisplayName string     `json:"pluginDisplayName"`
	// PluginLogoSvg: Inline SVG markup; may be empty.
	PluginLogoSvg     string `json:"pluginLogoSvg"`
	ResourceTypeID    string `json:"resourceTypeId"`
	ResourceTypeLabel string `json:"resourceTypeLabel"`
	AccountID         string `json:"accountId"`
	AccountName       string `json:"accountName"`
}

BlastRadiusNode: The resource itself, when it participates in the dependency graph.

The API may send null in its place.

type BlastRadiusReference added in v1.13.0

type BlastRadiusReference struct {
	// Kind: What kind of object names the resource.
	//
	// One of "dashboard", "custom-graph", "probe", "status-page",
	// "metric-alert", "lease", "schedule", "workflow", "log-query", "owner".
	Kind string `json:"kind"`
	// ID: The referring object's own id.
	ID   string `json:"id"`
	Name string `json:"name"`
	// Detail: One extra clause of context.
	Detail *string `json:"detail,omitempty"`
	// UserFacing: Set when the reference is visible outside the organization — a
	// published status page component, or the probe behind one. Any user-facing
	// reference makes the report high severity on its own.
	UserFacing *bool `json:"userFacing,omitempty"`
}

BlastRadiusReference is the `BlastRadiusReference` schema.

type BlastRadiusReport added in v1.13.0

type BlastRadiusReport struct {
	ResourceID ResourceID       `json:"resourceId"`
	Resource   *BlastRadiusNode `json:"resource"`
	// Dependants: Affected resources, direct first then by depth.
	Dependants      []BlastRadiusDependant `json:"dependants"`
	DirectCount     int64                  `json:"directCount"`
	TransitiveCount int64                  `json:"transitiveCount"`
	// References: Objects naming the resource without depending on it,
	// user-facing ones first.
	References []BlastRadiusReference `json:"references"`
	// FlowPeers: Measured network peers over the last 14 days, heaviest first.
	// Empty when flow collection is off — see `unchecked`.
	FlowPeers []BlastRadiusFlowPeer `json:"flowPeers"`
	// FlowTotals: Totals over `flowPeers`, or null when traffic could not be
	// measured at all. Zeroed totals mean collection is on and the resource is
	// quiet; null means nobody looked.
	FlowTotals *BlastRadiusReportFlowTotals `json:"flowTotals"`
	// Unchecked: What the report could not look at. An empty `dependants` list
	// with a non-empty `unchecked` list is not a clean bill of health, and
	// surfaces must not render it as one.
	Unchecked []BlastRadiusGap `json:"unchecked"`
	// Severity: `high` for anything user-facing or five or more direct
	// dependants; `unknown` when nothing was found but something could not be
	// checked.
	//
	// One of "none", "low", "medium", "high", "unknown".
	Severity string `json:"severity"`
	// Headline: One sentence, ready to render.
	Headline string `json:"headline"`
}

BlastRadiusReport is the `BlastRadiusReport` schema.

type BlastRadiusReportFlowTotals added in v1.13.0

type BlastRadiusReportFlowTotals struct {
	Bytes         float64 `json:"bytes"`
	EstimatedCost float64 `json:"estimatedCost"`
	Currency      string  `json:"currency"`
}

BlastRadiusReportFlowTotals is an object the spec declares inline.

type BudgetAlertEvent

type BudgetAlertEvent struct {
	ID    string `json:"id"`
	Month string `json:"month"`
	// ThresholdType: One of "actual", "forecast".
	ThresholdType       string `json:"thresholdType"`
	ThresholdPercent    int64  `json:"thresholdPercent"`
	ActualAmountCents   int64  `json:"actualAmountCents"`
	ForecastAmountCents *int64 `json:"forecastAmountCents"`
	TriggeredAt         string `json:"triggeredAt"`
}

BudgetAlertEvent is the `BudgetAlertEvent` schema.

type BudgetCostBasis added in v1.6.0

type BudgetCostBasis = string

BudgetCostBasis: The basis `actualCents` and `forecastCents` were measured on.

const (
	BudgetCostBasisCash      BudgetCostBasis = "cash"
	BudgetCostBasisAmortized BudgetCostBasis = "amortized"
)

The values BudgetCostBasis takes.

type BudgetCostFilter

type BudgetCostFilter struct {
	// Dimension: One of "provider", "account", "service", "region", "resource",
	// "tag", "charge_type", "commitment".
	Dimension string `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

BudgetCostFilter is the `BudgetCostFilter` schema.

type BudgetFull

type BudgetFull struct {
	ID             string             `json:"id"`
	OrganizationID string             `json:"organizationId"`
	Name           string             `json:"name"`
	AmountCents    int64              `json:"amountCents"`
	Currency       string             `json:"currency"`
	Filters        []BudgetCostFilter `json:"filters"`
	// SavedFilterID: A saved cost filter (see /saved-cost-filters) applied by
	// reference and AND-composed with `filters` when the budget is evaluated.
	// Updates are full replaces, so omitting it on PUT clears it. A reference
	// that fails to resolve errors the budget's evaluation rather than silently
	// measuring all spend.
	SavedFilterID *string `json:"savedFilterId"`
	// ScenarioModelID: A scenario model (see /cost-scenarios) this budget's
	// **forecast** thresholds are measured against. Null — the default, and the
	// value for every budget nobody deliberately opts in — keeps them on the
	// bare trend. Opting in is per-budget on purpose: a hypothesis somebody
	// typed into a form must not silently change when real people get paged.
	// `actual` thresholds are never affected; they measure money already spent.
	// Updates are full replaces, so omitting it on PUT clears the opt-in.
	ScenarioModelID *string           `json:"scenarioModelId"`
	Thresholds      []BudgetThreshold `json:"thresholds"`
	CostBasis       BudgetCostBasis   `json:"costBasis"`
	// UseAdjustedSpend: Measure this budget against billing-rule-adjusted spend
	// — the internal figure — instead of what the providers charged. False by
	// default, and for every budget nobody opted in. The default is a deliberate
	// refusal: a markup is organisation policy and a budget threshold pages a
	// real person, so adding one settings row must not be able to move every
	// on-call rota at once. Unlike a scenario this affects `actual` thresholds
	// too — an opted-in budget is measuring the internal number, and
	// month-to-date internal spend is as marked up as the forecast is. The alert
	// body says the figure is adjusted and names the collected one. Updates are
	// full replaces, so omitting it on PUT clears the opt-in.
	UseAdjustedSpend bool    `json:"useAdjustedSpend"`
	CreatedByUserID  *string `json:"createdByUserId"`
	DeletedAt        *string `json:"deletedAt"`
	CreatedAt        string  `json:"createdAt"`
	UpdatedAt        string  `json:"updatedAt"`
}

BudgetFull is the `BudgetFull` schema.

type BudgetInput

type BudgetInput struct {
	Name        string             `json:"name"`
	AmountCents int64              `json:"amountCents"`
	Currency    *string            `json:"currency,omitempty"`
	Filters     []BudgetCostFilter `json:"filters,omitempty"`
	// SavedFilterID: A saved cost filter (see /saved-cost-filters) applied by
	// reference and AND-composed with `filters` when the budget is evaluated.
	// Updates are full replaces, so omitting it on PUT clears it. A reference
	// that fails to resolve errors the budget's evaluation rather than silently
	// measuring all spend.
	SavedFilterID *string `json:"savedFilterId,omitempty"`
	// ScenarioModelID: A scenario model (see /cost-scenarios) this budget's
	// **forecast** thresholds are measured against. Null — the default, and the
	// value for every budget nobody deliberately opts in — keeps them on the
	// bare trend. Opting in is per-budget on purpose: a hypothesis somebody
	// typed into a form must not silently change when real people get paged.
	// `actual` thresholds are never affected; they measure money already spent.
	// Updates are full replaces, so omitting it on PUT clears the opt-in.
	ScenarioModelID *string           `json:"scenarioModelId,omitempty"`
	Thresholds      []BudgetThreshold `json:"thresholds"`
	CostBasis       *BudgetCostBasis  `json:"costBasis,omitempty"`
	// UseAdjustedSpend: Measure this budget against billing-rule-adjusted spend
	// — the internal figure — instead of what the providers charged. False by
	// default, and for every budget nobody opted in. The default is a deliberate
	// refusal: a markup is organisation policy and a budget threshold pages a
	// real person, so adding one settings row must not be able to move every
	// on-call rota at once. Unlike a scenario this affects `actual` thresholds
	// too — an opted-in budget is measuring the internal number, and
	// month-to-date internal spend is as marked up as the forecast is. The alert
	// body says the figure is adjusted and names the collected one. Updates are
	// full replaces, so omitting it on PUT clears the opt-in.
	UseAdjustedSpend *bool `json:"useAdjustedSpend,omitempty"`
}

BudgetInput is the `BudgetInput` schema.

type BudgetThreshold

type BudgetThreshold struct {
	// Type: One of "actual", "forecast".
	Type    string `json:"type"`
	Percent int64  `json:"percent"`
}

BudgetThreshold is the `BudgetThreshold` schema.

type BudgetWithStatus

type BudgetWithStatus struct {
	ID          string             `json:"id"`
	Name        string             `json:"name"`
	AmountCents int64              `json:"amountCents"`
	Currency    string             `json:"currency"`
	Filters     []BudgetCostFilter `json:"filters"`
	Thresholds  []BudgetThreshold  `json:"thresholds"`
	CostBasis   BudgetCostBasis    `json:"costBasis"`
	// SavedFilterID: A saved cost filter (see /saved-cost-filters) applied by
	// reference and AND-composed with `filters` when the budget is evaluated.
	// Updates are full replaces, so omitting it on PUT clears it. A reference
	// that fails to resolve errors the budget's evaluation rather than silently
	// measuring all spend.
	SavedFilterID *string `json:"savedFilterId"`
	// ScenarioModelID: A scenario model (see /cost-scenarios) this budget's
	// **forecast** thresholds are measured against. Null — the default, and the
	// value for every budget nobody deliberately opts in — keeps them on the
	// bare trend. Opting in is per-budget on purpose: a hypothesis somebody
	// typed into a form must not silently change when real people get paged.
	// `actual` thresholds are never affected; they measure money already spent.
	// Updates are full replaces, so omitting it on PUT clears the opt-in.
	ScenarioModelID *string `json:"scenarioModelId"`
	// ScenarioModelName: The opted-into model's name, so a card can say whose
	// assumptions are in the number.
	ScenarioModelName *string `json:"scenarioModelName"`
	// UseAdjustedSpend: Measure this budget against billing-rule-adjusted spend
	// — the internal figure — instead of what the providers charged. False by
	// default, and for every budget nobody opted in. The default is a deliberate
	// refusal: a markup is organisation policy and a budget threshold pages a
	// real person, so adding one settings row must not be able to move every
	// on-call rota at once. Unlike a scenario this affects `actual` thresholds
	// too — an opted-in budget is measuring the internal number, and
	// month-to-date internal spend is as marked up as the forecast is. The alert
	// body says the figure is adjusted and names the collected one. Updates are
	// full replaces, so omitting it on PUT clears the opt-in.
	UseAdjustedSpend bool `json:"useAdjustedSpend"`
	// RawActualCents: Month-to-date **collected** spend, non-null only for a
	// budget measuring adjusted spend. Null on an unadjusted budget rather than
	// a copy of `actualCents`: "there is no separate collected figure because
	// this one is it" and "the collected figure happens to equal the adjusted
	// one" are different facts, and captioning every budget in the organisation
	// would make the adjusted ones invisible.
	RawActualCents *int64 `json:"rawActualCents"`
	Month          string `json:"month"`
	ActualCents    int64  `json:"actualCents"`
	// ForecastCents: The **unadjusted trend** forecast, whether or not a
	// scenario is applied — so both numbers are always comparable.
	ForecastCents *int64 `json:"forecastCents"`
	// ScenarioForecastCents: The scenario-adjusted month forecast, set only for
	// a budget that opted into a model, and the number its forecast thresholds
	// are judged against. Null means the thresholds used `forecastCents`.
	ScenarioForecastCents *int64                               `json:"scenarioForecastCents"`
	CurrentMonthEvents    []BudgetWithStatusCurrentMonthEvents `json:"currentMonthEvents"`
	Placements            []BudgetWithStatusPlacements         `json:"placements"`
}

BudgetWithStatus is the `BudgetWithStatus` schema.

type BudgetWithStatusCurrentMonthEvents

type BudgetWithStatusCurrentMonthEvents struct {
	ID string `json:"id"`
	// ThresholdType: One of "actual", "forecast".
	ThresholdType    string `json:"thresholdType"`
	ThresholdPercent int64  `json:"thresholdPercent"`
	TriggeredAt      string `json:"triggeredAt"`
}

BudgetWithStatusCurrentMonthEvents is an object the spec declares inline.

type BudgetWithStatusPlacements added in v0.5.0

type BudgetWithStatusPlacements struct {
	WidgetID      string `json:"widgetId"`
	DashboardID   string `json:"dashboardId"`
	DashboardName string `json:"dashboardName"`
}

BudgetWithStatusPlacements is an object the spec declares inline.

type BudgetsCreateParams

type BudgetsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body BudgetInput
}

BudgetsCreateParams holds the parameters for `client.budgets.create`.

type BudgetsDeleteParams

type BudgetsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

BudgetsDeleteParams holds the parameters for `client.budgets.delete`.

type BudgetsEventsParams

type BudgetsEventsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

BudgetsEventsParams holds the parameters for `client.budgets.events`.

type BudgetsGetParams

type BudgetsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

BudgetsGetParams holds the parameters for `client.budgets.get`.

type BudgetsListParams

type BudgetsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BudgetsListParams holds the parameters for `client.budgets.list`.

Every field is optional; pass nil to take the defaults.

type BudgetsNamespace

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

BudgetsNamespace is `client.budgets`.

func (*BudgetsNamespace) Create

Create: Create a budget

POST /api/org/{orgId}/budgets

Raises on 400: Bad request

func (*BudgetsNamespace) Delete

func (n *BudgetsNamespace) Delete(ctx context.Context, params BudgetsDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete a budget

DELETE /api/org/{orgId}/budgets/{id}

Raises on 404: Not found

func (*BudgetsNamespace) Events

Events: Alert event history for a budget

GET /api/org/{orgId}/budgets/{id}/events

Raises on 404: Not found

func (*BudgetsNamespace) Get

Get: Get a budget with current-month status

GET /api/org/{orgId}/budgets/{id}

Raises on 404: Not found

func (*BudgetsNamespace) List

List: List budgets with current-month actuals and forecasts

GET /api/org/{orgId}/budgets

func (*BudgetsNamespace) Update

Update: Update a budget

PUT /api/org/{orgId}/budgets/{id}

Raises on 400: Bad request

Raises on 404: Not found

type BudgetsUpdateParams

type BudgetsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body BudgetInput
}

BudgetsUpdateParams holds the parameters for `client.budgets.update`.

type BusinessMetric added in v1.9.0

type BusinessMetric struct {
	ID              string                    `json:"id"`
	Key             string                    `json:"key"`
	Name            string                    `json:"name"`
	Unit            string                    `json:"unit"`
	Description     *string                   `json:"description"`
	Kind            BusinessMetricKind        `json:"kind"`
	Currency        *string                   `json:"currency"`
	CostScope       []BusinessMetricScopeTerm `json:"costScope"`
	SavedFilterID   *string                   `json:"savedFilterId"`
	CreatedByUserID *string                   `json:"createdByUserId"`
	CreatedAt       string                    `json:"createdAt"`
	UpdatedAt       string                    `json:"updatedAt"`
	Coverage        *BusinessMetricCoverage   `json:"coverage"`
}

BusinessMetric is the `BusinessMetric` schema.

type BusinessMetricCoverage added in v1.9.0

type BusinessMetricCoverage struct {
	// FirstDay: Earliest reported day, YYYY-MM-DD.
	FirstDay string `json:"firstDay"`
	LastDay  string `json:"lastDay"`
	// ReportedDays: Days carrying a value — compare against the span to spot a
	// sparse series.
	ReportedDays int64 `json:"reportedDays"`
}

BusinessMetricCoverage: Null when the metric has no values at all — not an error, but every unit-cost chart drawn from it is one continuous gap.

The API may send null in its place.

type BusinessMetricInput added in v1.9.0

type BusinessMetricInput struct {
	// Key: Stable lowercase slug (letters, digits, `_ . -`) that workflows and
	// the CLI address the metric by. Unique per organization among live metrics,
	// and independent of `name` so a rename never breaks a running job.
	Key  string `json:"key"`
	Name string `json:"name"`
	// Unit: Singular unit label used for display — the noun in "USD per
	// customer".
	Unit        string             `json:"unit"`
	Description *string            `json:"description,omitempty"`
	Kind        BusinessMetricKind `json:"kind"`
	// Currency: ISO-4217 code. **Required when `kind` is `currency`, and
	// rejected otherwise** — a revenue metric with no currency cannot have
	// margin computed against it, and a count metric carrying one would suggest
	// its numbers are money when they are requests.
	Currency *string `json:"currency,omitempty"`
	// CostScope: The spend this metric divides, in the same filter vocabulary
	// cost graphs and budgets use. Empty (the default) is all of the
	// organization's spend. A unit-cost query may narrow this further but can
	// never widen it: the scope is part of what the metric means, and a caller
	// who could drop it would be answering a different question under the same
	// name.
	CostScope []BusinessMetricScopeTerm `json:"costScope,omitempty"`
	// SavedFilterID: A saved cost filter AND-composed with `costScope`, resolved
	// server-side at query time. A reference that fails to resolve errors the
	// unit-cost query rather than silently widening the numerator to all spend.
	SavedFilterID *string `json:"savedFilterId,omitempty"`
}

BusinessMetricInput is the `BusinessMetricInput` schema.

type BusinessMetricKind added in v1.9.0

type BusinessMetricKind = string

BusinessMetricKind: What the metric's numbers are. `count` is a unit-less quantity (customers, requests, GB) and supports unit cost only. `currency` is money the business took in, denominated in the metric's own `currency`, and is the only kind margin can be computed against — `(revenue − cost) ÷ revenue` subtracts money from money and is undefined otherwise.

const (
	BusinessMetricKindCount    BusinessMetricKind = "count"
	BusinessMetricKindCurrency BusinessMetricKind = "currency"
)

The values BusinessMetricKind takes.

type BusinessMetricScopeTerm added in v1.9.0

type BusinessMetricScopeTerm struct {
	// Dimension: One of "provider", "account", "service", "region", "resource",
	// "tag", "charge_type", "commitment".
	Dimension string `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

BusinessMetricScopeTerm is the `BusinessMetricScopeTerm` schema.

type BusinessMetricValue added in v1.9.0

type BusinessMetricValue struct {
	// Day: UTC day, YYYY-MM-DD.
	Day   string  `json:"day"`
	Value float64 `json:"value"`
	// Source: One of "api", "workflow".
	Source    string `json:"source"`
	UpdatedAt string `json:"updatedAt"`
}

BusinessMetricValue is the `BusinessMetricValue` schema.

type BusinessMetricValuesInput added in v1.9.0

type BusinessMetricValuesInput struct {
	// Values: Days to report. **Re-reporting a day restates it rather than
	// adding to it**, so an unattended nightly job is safe to retry — an
	// accumulating write would double every number the first time the job
	// re-ran. A batch naming the same day twice keeps the last value, applying
	// the same rule within a batch that restatement applies between them.
	Values []BusinessMetricValuesInputValues `json:"values"`
}

BusinessMetricValuesInput is the `BusinessMetricValuesInput` schema.

type BusinessMetricValuesInputValues added in v1.9.0

type BusinessMetricValuesInputValues struct {
	Date  string  `json:"date"`
	Value float64 `json:"value"`
}

BusinessMetricValuesInputValues is an object the spec declares inline.

type BusinessMetricsCreateParams added in v1.9.0

type BusinessMetricsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body BusinessMetricInput
}

BusinessMetricsCreateParams holds the parameters for `client.businessMetrics.create`.

type BusinessMetricsDeleteParams added in v1.9.0

type BusinessMetricsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Metric id or key
	ID string
}

BusinessMetricsDeleteParams holds the parameters for `client.businessMetrics.delete`.

type BusinessMetricsGetGetOrgOrgIDBusinessMetricsIDParams added in v1.9.0

type BusinessMetricsGetGetOrgOrgIDBusinessMetricsIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Metric id or key
	ID string
}

BusinessMetricsGetGetOrgOrgIDBusinessMetricsIDParams holds the parameters for `client.businessMetrics.get.getOrgOrgIdBusinessMetricsId`.

type BusinessMetricsGetGetParams added in v1.9.0

type BusinessMetricsGetGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

BusinessMetricsGetGetParams holds the parameters for `client.businessMetrics.get.get`.

Every field is optional; pass nil to take the defaults.

type BusinessMetricsGetGetResponse added in v1.9.0

type BusinessMetricsGetGetResponse struct {
	Metrics []BusinessMetric `json:"metrics"`
}

BusinessMetricsGetGetResponse is an object the spec declares inline.

type BusinessMetricsGetNamespace added in v1.9.0

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

BusinessMetricsGetNamespace is `client.businessMetrics.get`.

func (*BusinessMetricsGetNamespace) Get added in v1.9.0

Get: List business metrics

The organization's declared denominators, by key, each with the range of days it has values for.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/business-metrics

func (*BusinessMetricsGetNamespace) GetOrgOrgIDBusinessMetricsID added in v1.9.0

GetOrgOrgIDBusinessMetricsID: Get a business metric

`id` accepts either the metric's id or its key.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/business-metrics/{id}

Raises on 404: Not found

type BusinessMetricsNamespace added in v1.9.0

type BusinessMetricsNamespace struct {

	// Get: `client.businessMetrics.get`.
	Get *BusinessMetricsGetNamespace
	// Values: `client.businessMetrics.values`.
	Values *BusinessMetricsValuesNamespace
	// contains filtered or unexported fields
}

BusinessMetricsNamespace is `client.businessMetrics`.

func (*BusinessMetricsNamespace) Create added in v1.9.0

Create: Create a business metric

Keys must be unique per organization among live metrics — they are how workflows and the CLI address the metric. A key collision is a 409.

_Requires permission: `costs:write`._

POST /api/org/{orgId}/business-metrics

Raises on 400: Bad request

Raises on 409: A live metric already uses this key.

func (*BusinessMetricsNamespace) Delete added in v1.9.0

Delete: Delete a business metric

Soft delete. Not refused when a dashboard card references the metric, unlike a saved cost filter: a unit-cost card whose metric is gone fails its query and says so, whereas a card that quietly reverted to plain spend would be a chart claiming to be something it is not.

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/business-metrics/{id}

Raises on 404: Not found

func (*BusinessMetricsNamespace) UnitCosts added in v1.9.0

UnitCosts: Query unit costs or margin

Divide spend by the metric, bucketed as asked. Three properties of the answer are worth knowing before reading it:

- **The ratio is computed at the requested bucket**, from a summed numerator and a summed denominator — never a mean of daily ratios, which weights a quiet day as heavily as a peak one. The same holds for `overallValue`. - **A missing or non-positive denominator is a gap** (`value: null` with a `gap` reason), never 0 and never infinite. - **Currencies are never merged.** Spend in a currency with no stated rate keeps its own series rather than being dropped or added to another.

There is no `groupBy`: a per-group ratio would need a per-group denominator, and dividing each service's spend by the whole customer count produces numbers that do not sum to the real one.

_Requires permission: `costs:read`._

POST /api/org/{orgId}/business-metrics/{id}/unit-costs

Raises on 400: Bad request

Raises on 404: Not found

func (*BusinessMetricsNamespace) Update added in v1.9.0

Update: Update a business metric

Replaces the whole definition. Changing `key` never orphans history — values are keyed on the metric's id — but it does break a workflow still writing to the old key, which is why the key is separate from the display name in the first place.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/business-metrics/{id}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: A live metric already uses this key.

type BusinessMetricsUnitCostsParams added in v1.9.0

type BusinessMetricsUnitCostsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Metric id or key
	ID string
	// Body: the JSON request body.
	Body UnitCostQueryRequest
}

BusinessMetricsUnitCostsParams holds the parameters for `client.businessMetrics.unitCosts`.

type BusinessMetricsUpdateParams added in v1.9.0

type BusinessMetricsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Metric id or key
	ID string
	// Body: the JSON request body.
	Body BusinessMetricInput
}

BusinessMetricsUpdateParams holds the parameters for `client.businessMetrics.update`.

type BusinessMetricsValuesCreateParams added in v1.9.0

type BusinessMetricsValuesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Metric id or key
	ID string
	// Body: the JSON request body.
	Body BusinessMetricValuesInput
}

BusinessMetricsValuesCreateParams holds the parameters for `client.businessMetrics.values.create`.

type BusinessMetricsValuesCreateResponse added in v1.9.0

type BusinessMetricsValuesCreateResponse struct {
	// Written: Days written, counting restatements.
	Written int64 `json:"written"`
}

BusinessMetricsValuesCreateResponse is an object the spec declares inline.

type BusinessMetricsValuesGetParams added in v1.9.0

type BusinessMetricsValuesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Metric id or key
	ID string
	// Limit: Default 90.
	Limit *int64
}

BusinessMetricsValuesGetParams holds the parameters for `client.businessMetrics.values.get`.

type BusinessMetricsValuesGetResponse added in v1.9.0

type BusinessMetricsValuesGetResponse struct {
	Values []BusinessMetricValue `json:"values"`
}

BusinessMetricsValuesGetResponse is an object the spec declares inline.

type BusinessMetricsValuesNamespace added in v1.9.0

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

BusinessMetricsValuesNamespace is `client.businessMetrics.values`.

func (*BusinessMetricsValuesNamespace) Create added in v1.9.0

Create: Report metric values

Write a batch of days. **Re-reporting a day restates it rather than accumulating**, which is what makes a nightly job safe to retry. Nothing lands unless the whole batch validates, so a bad row is a 400 rather than half a month restated. The same guarantees back `infra.businessMetrics.write(...)` in a workflow — both go through one validator.

_Requires permission: `costs:write`._

POST /api/org/{orgId}/business-metrics/{id}/values

Raises on 400: Bad request

Raises on 404: Not found

func (*BusinessMetricsValuesNamespace) Get added in v1.9.0

Get: List a metric's reported values

Newest day first.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/business-metrics/{id}/values

Raises on 400: Bad request

Raises on 404: Not found

type CalendarEvent added in v1.29.0

type CalendarEvent struct {
	// ID: Stable across renders for the same underlying thing, because it
	// becomes the iCalendar UID. Recurring sources (sleep windows, cron runs)
	// key it by occurrence.
	ID string `json:"id"`
	// Kind: Which of the organization's own records the event was projected
	// from. The kinds are sources rather than a severity taxonomy: a reader
	// scanning a month wants to know that one bar is a freeze and another is a
	// certificate.
	//
	// One of "change-freeze", "sleep-schedule", "expiry", "commitment-expiry",
	// "workflow-schedule", "incident".
	Kind   string  `json:"kind"`
	Title  string  `json:"title"`
	Detail *string `json:"detail"`
	// StartsAt: Clamped to the requested window's lower bound when the
	// underlying span began earlier; `openEnded` says so.
	StartsAt string `json:"startsAt"`
	// EndsAt: Null means a point in time — a deadline, a scheduled run — or a
	// span whose end is not known. `openEnded` distinguishes the two.
	EndsAt *string `json:"endsAt"`
	// OpenEnded: The span continues past an edge of the window, or has no
	// declared end at all (a freeze held until further notice, an unresolved
	// incident).
	OpenEnded bool `json:"openEnded"`
	// AllDay: The event is meaningful only to the day — a deadline read off a
	// date field. Rendering such a thing at the provider's stored midnight would
	// be false precision.
	AllDay bool `json:"allDay"`
	// Severity: One of "critical", "warning", "info".
	Severity string            `json:"severity"`
	Link     CalendarEventLink `json:"link"`
}

CalendarEvent is the `CalendarEvent` schema.

type CalendarEventLink = any

CalendarEventLink: Where opening the event should go — a hint rather than a URL, because each surface addresses its own pages differently.

The API may send null in its place.

type CalendarGetParams added in v1.29.0

type CalendarGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// From: Inclusive lower bound. Defaults to 7 days ago.
	From *string
	// To: Exclusive upper bound. Defaults to 35 days ahead.
	To *string
	// Kinds: Comma-separated `CalendarEventKind`s. Unknown members are ignored
	// rather than rejected; omitting the parameter returns every kind.
	Kinds *string
}

CalendarGetParams holds the parameters for `client.calendar.get`.

Every field is optional; pass nil to take the defaults.

type CalendarNamespace added in v1.29.0

type CalendarNamespace struct {

	// Subscriptions: `client.calendar.subscriptions`.
	Subscriptions *CalendarSubscriptionsNamespace
	// contains filtered or unexported fields
}

CalendarNamespace is `client.calendar`.

func (*CalendarNamespace) Get added in v1.29.0

Get: List dated operational events in a window

One time axis over six things the organization already stores: change freezes, sleep/wake schedules, declared deadlines (certificates, domains, keys and resource leases), commitment term ends, cron-triggered workflow runs, and declared incidents. Nothing here is a new record — the calendar is recomputed on every read, exactly as posture findings and backup coverage are.

The window defaults to the last 7 and next 35 days and may span at most 400. Recurring sources are expanded to at most 400 occurrences each, so one nightly schedule cannot flood a year-long query.

GET /api/org/{orgId}/calendar

Raises on 400: Bad request

type CalendarResponse added in v1.29.0

type CalendarResponse struct {
	// Events: Soonest first; longer spans before shorter ones.
	Events []CalendarEvent `json:"events"`
	From   string          `json:"from"`
	To     string          `json:"to"`
	// EmptyKinds: Kinds that were asked for and produced no events in this
	// window.
	EmptyKinds []string `json:"emptyKinds"`
	// FailedKinds: Sources that threw. Reported rather than swallowed: 'nothing
	// scheduled' and 'we could not read it' are different answers, and one
	// failing source must not empty the page.
	FailedKinds []string `json:"failedKinds"`
	GeneratedAt string   `json:"generatedAt"`
}

CalendarResponse is the `CalendarResponse` schema.

type CalendarSubscription added in v1.29.0

type CalendarSubscription struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// Kinds: Kinds the feed carries. Empty means every kind, including ones
	// added later.
	Kinds []string `json:"kinds"`
	// URL: The subscription URL, returned **only** by the create call — the
	// token it contains is stored hashed and cannot be shown again. Lose it and
	// mint a new feed.
	URL       *string `json:"url,omitempty"`
	CreatedAt string  `json:"createdAt"`
	// LastAccessedAt: Last fetch, written at most hourly. Its purpose is
	// answering 'is anyone still using this?' before revoking, which an hour of
	// staleness cannot change.
	LastAccessedAt *string `json:"lastAccessedAt"`
	RevokedAt      *string `json:"revokedAt"`
}

CalendarSubscription is the `CalendarSubscription` schema.

type CalendarSubscriptionCreate added in v1.29.0

type CalendarSubscriptionCreate struct {
	Name  string   `json:"name"`
	Kinds []string `json:"kinds,omitempty"`
}

CalendarSubscriptionCreate is the `CalendarSubscriptionCreate` schema.

type CalendarSubscriptionList added in v1.29.0

type CalendarSubscriptionList struct {
	Subscriptions []CalendarSubscription `json:"subscriptions"`
}

CalendarSubscriptionList is the `CalendarSubscriptionList` schema.

type CalendarSubscriptionsCreateParams added in v1.29.0

type CalendarSubscriptionsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *CalendarSubscriptionCreate
}

CalendarSubscriptionsCreateParams holds the parameters for `client.calendar.subscriptions.create`.

Every field is optional; pass nil to take the defaults.

type CalendarSubscriptionsDeleteParams added in v1.29.0

type CalendarSubscriptionsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID          *string
	SubscriptionID string
}

CalendarSubscriptionsDeleteParams holds the parameters for `client.calendar.subscriptions.delete`.

type CalendarSubscriptionsGetParams added in v1.29.0

type CalendarSubscriptionsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CalendarSubscriptionsGetParams holds the parameters for `client.calendar.subscriptions.get`.

Every field is optional; pass nil to take the defaults.

type CalendarSubscriptionsNamespace added in v1.29.0

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

CalendarSubscriptionsNamespace is `client.calendar.subscriptions`.

func (*CalendarSubscriptionsNamespace) Create added in v1.29.0

Create: Mint an iCalendar subscription URL

Returns the only copy of the feed URL. The token in it is 32 random bytes, stored as a SHA-256 hash, and is the sole credential on a route that runs outside every auth layer — treat the URL as a secret. The URL deliberately contains no organization id.

An organization may hold 25 live subscriptions; revoking makes room.

POST /api/org/{orgId}/calendar/subscriptions

Raises on 400: Bad request

func (*CalendarSubscriptionsNamespace) Delete added in v1.29.0

Delete: Revoke an iCalendar subscription

The URL stops working immediately. The row is kept, and revoking twice is not an error.

DELETE /api/org/{orgId}/calendar/subscriptions/{subscriptionId}

Raises on 404: Not found

func (*CalendarSubscriptionsNamespace) Get added in v1.29.0

Get: List the organization's iCalendar subscriptions

Feed URLs that have been minted, including revoked ones — a revoked row is kept so the audit trail still resolves. The token itself is never returned.

GET /api/org/{orgId}/calendar/subscriptions

type CapacityCheckoutRequest added in v0.37.0

type CapacityCheckoutRequest struct {
	// Quantity: Slots to buy. Defaults to 1. The buyer can still adjust it in
	// Checkout.
	Quantity *int64 `json:"quantity,omitempty"`
}

CapacityCheckoutRequest is the `CapacityCheckoutRequest` schema.

type CapacitySlot added in v0.37.0

type CapacitySlot struct {
	ID string `json:"id"`
	// Quantity: Seats this purchase grants for the whole of its term.
	Quantity int64 `json:"quantity"`
	// Status: A slot is only granting capacity when it is `active` AND
	// `expiresAt` is still in the future.
	//
	// One of "active", "refunded".
	Status          string `json:"status"`
	StartsAt        string `json:"startsAt"`
	ExpiresAt       string `json:"expiresAt"`
	TermMonths      int64  `json:"termMonths"`
	AmountPaidCents *int64 `json:"amountPaidCents"`
}

CapacitySlot is the `CapacitySlot` schema.

type CapacityStatus added in v0.37.0

type CapacityStatus struct {
	// Purchasable: False when this deployment has no one-time capacity price
	// configured; the purchase route returns 503 and clients should hide the
	// offer.
	Purchasable bool  `json:"purchasable"`
	TermMonths  int64 `json:"termMonths"`
	// PriceUsd: List price of one slot in whole dollars, for display copy.
	PriceUsd int64 `json:"priceUsd"`
	// Seats: Seats from slots still inside their term, excluding lapsed and
	// refunded. ADDITIONAL to `subscription.seatCount` — an org's capacity is
	// the two summed, and an org can hold slots with no subscription at all.
	Seats int64 `json:"seats"`
	// Slots: Every purchase ever made, newest first, including lapsed and
	// refunded.
	Slots []CapacitySlot `json:"slots"`
}

CapacityStatus is the `CapacityStatus` schema.

type ChangeCostBasis added in v1.18.0

type ChangeCostBasis = string

ChangeCostBasis: Which charge-type basis both windows are read on. `cash` (the default) is what the provider charged on the day it charged it; `amortized` spreads a commitment's up-front fee across the term it buys. It is echoed on every response because a delta whose basis is unstated is unreadable — an amortized 'after' against a cash 'before' looks exactly like a saving.

const (
	ChangeCostBasisCash      ChangeCostBasis = "cash"
	ChangeCostBasisAmortized ChangeCostBasis = "amortized"
)

The values ChangeCostBasis takes.

type ChangeCostImpact added in v1.18.0

type ChangeCostImpact struct {
	Status    ChangeCostImpactStatus `json:"status"`
	CostBasis ChangeCostBasis        `json:"costBasis"`
	// WindowDays: The half-window that was requested.
	WindowDays int64 `json:"windowDays"`
	// EffectiveWindowDays: The half-window the data supported. Clamped
	// symmetrically, so both means always average the same number of days.
	EffectiveWindowDays int64 `json:"effectiveWindowDays"`
	// EventDay: UTC day the change landed on. Excluded from both windows — it is
	// a mixed day.
	EventDay   string                     `json:"eventDay"`
	Before     *ChangeCostImpactWindow    `json:"before"`
	After      *ChangeCostImpactWindow    `json:"after"`
	Series     []ChangeCostImpactSeries   `json:"series"`
	Confidence ChangeCostImpactConfidence `json:"confidence"`
	Reasons    []ChangeCostImpactReason   `json:"reasons"`
	// OverlappingChanges: Other recorded changes to the same resource inside the
	// window. A delta is correlation, never causation; this is the number that
	// says how much else was going on.
	OverlappingChanges int64 `json:"overlappingChanges"`
}

ChangeCostImpact is the `ChangeCostImpact` schema.

type ChangeCostImpactAnnotationRequest added in v1.18.0

type ChangeCostImpactAnnotationRequest struct {
	// SubjectKind: One of "change", "deployment".
	SubjectKind string           `json:"subjectKind"`
	SubjectID   string           `json:"subjectId"`
	WindowDays  *int64           `json:"windowDays,omitempty"`
	CostBasis   *ChangeCostBasis `json:"costBasis,omitempty"`
}

ChangeCostImpactAnnotationRequest is the `ChangeCostImpactAnnotationRequest` schema.

type ChangeCostImpactAnnotationResponse added in v1.18.0

type ChangeCostImpactAnnotationResponse struct {
	AnnotationID string           `json:"annotationId"`
	Text         string           `json:"text"`
	Impact       ChangeCostImpact `json:"impact"`
}

ChangeCostImpactAnnotationResponse is the `ChangeCostImpactAnnotationResponse` schema.

type ChangeCostImpactConfidence added in v1.18.0

type ChangeCostImpactConfidence = string

ChangeCostImpactConfidence: How much the delta is worth believing. Derived from the number of comparable days per side (7+ high, 4+ medium, otherwise low) and dropped one tier when other recorded changes touched the same resource inside the window.

const (
	ChangeCostImpactConfidenceHigh   ChangeCostImpactConfidence = "high"
	ChangeCostImpactConfidenceMedium ChangeCostImpactConfidence = "medium"
	ChangeCostImpactConfidenceLow    ChangeCostImpactConfidence = "low"
	ChangeCostImpactConfidenceNone   ChangeCostImpactConfidence = "none"
)

The values ChangeCostImpactConfidence takes.

type ChangeCostImpactEntry added in v1.18.0

type ChangeCostImpactEntry struct {
	ChangeID   string           `json:"changeId"`
	ResourceID ResourceID       `json:"resourceId"`
	Impact     ChangeCostImpact `json:"impact"`
}

ChangeCostImpactEntry is the `ChangeCostImpactEntry` schema.

type ChangeCostImpactReason added in v1.18.0

type ChangeCostImpactReason = string

ChangeCostImpactReason: Why the result reads the way it does. Every non-`measured` status carries at least one, and `measured` carries whatever lowered its confidence. `period_native_provider` is the notable one: a provider that dates a whole invoice period to the period's start cannot be read by a day-window comparison at all.

const (
	ChangeCostImpactReasonNoCostIdentity       ChangeCostImpactReason = "no_cost_identity"
	ChangeCostImpactReasonPeriodNativeProvider ChangeCostImpactReason = "period_native_provider"
	ChangeCostImpactReasonNoCostData           ChangeCostImpactReason = "no_cost_data"
	ChangeCostImpactReasonNoCoverageBefore     ChangeCostImpactReason = "no_coverage_before"
	ChangeCostImpactReasonNoCoverageAfter      ChangeCostImpactReason = "no_coverage_after"
	ChangeCostImpactReasonShortWindow          ChangeCostImpactReason = "short_window"
	ChangeCostImpactReasonWindowClamped        ChangeCostImpactReason = "window_clamped"
	ChangeCostImpactReasonOverlappingChanges   ChangeCostImpactReason = "overlapping_changes"
)

The values ChangeCostImpactReason takes.

type ChangeCostImpactSeries added in v1.18.0

type ChangeCostImpactSeries struct {
	// Currency: ISO 4217 code. Currencies are never summed.
	Currency     string  `json:"currency"`
	BeforePerDay float64 `json:"beforePerDay"`
	AfterPerDay  float64 `json:"afterPerDay"`
	// DeltaPerDay: `afterPerDay - beforePerDay`. Positive means the change costs
	// more.
	DeltaPerDay float64 `json:"deltaPerDay"`
	// DeltaPercent: Null when the before window spent nothing — there is no
	// percentage.
	DeltaPercent *float64 `json:"deltaPercent"`
	BeforeTotal  float64  `json:"beforeTotal"`
	AfterTotal   float64  `json:"afterTotal"`
}

ChangeCostImpactSeries is the `ChangeCostImpactSeries` schema.

type ChangeCostImpactStatus added in v1.18.0

type ChangeCostImpactStatus = string

ChangeCostImpactStatus: `measured` — both windows had collected data and the delta is real. `insufficient_data` — the windows exist but are too short to compare. `unknown` — nothing here can answer the question. **`unknown` is never zero**: a resource with no cost data reports that we cannot say, not that the change was free.

const (
	ChangeCostImpactStatusMeasured         ChangeCostImpactStatus = "measured"
	ChangeCostImpactStatusInsufficientData ChangeCostImpactStatus = "insufficient_data"
	ChangeCostImpactStatusUnknown          ChangeCostImpactStatus = "unknown"
)

The values ChangeCostImpactStatus takes.

type ChangeCostImpactWindow added in v1.18.0

type ChangeCostImpactWindow struct {
	// From: Inclusive first UTC day, `YYYY-MM-DD`.
	From string `json:"from"`
	// To: Inclusive last UTC day.
	To string `json:"to"`
}

ChangeCostImpactWindow is the `ChangeCostImpactWindow` schema.

The API may send null in its place.

type ChangeCostImpactsRequest added in v1.18.0

type ChangeCostImpactsRequest struct {
	// ChangeIDs: Change ids from `GET /changes`. At most 50 — one feed page.
	ChangeIDs []string `json:"changeIds"`
	// WindowDays: Days either side of the change. Default 7; clamped
	// server-side.
	WindowDays *int64           `json:"windowDays,omitempty"`
	CostBasis  *ChangeCostBasis `json:"costBasis,omitempty"`
}

ChangeCostImpactsRequest is the `ChangeCostImpactsRequest` schema.

type ChangeCostImpactsResponse added in v1.18.0

type ChangeCostImpactsResponse struct {
	Impacts []ChangeCostImpactEntry `json:"impacts"`
}

ChangeCostImpactsResponse is the `ChangeCostImpactsResponse` schema.

type ChangeFreeze added in v0.23.0

type ChangeFreeze struct {
	ID              string  `json:"id"`
	Name            string  `json:"name"`
	Reason          *string `json:"reason"`
	StartsAt        string  `json:"startsAt"`
	EndsAt          *string `json:"endsAt"`
	Active          bool    `json:"active"`
	CreatedByUserID *string `json:"createdByUserId"`
	EndedByUserID   *string `json:"endedByUserId"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
}

ChangeFreeze is the `ChangeFreeze` schema.

type ChangeFreezeBlocked added in v0.23.0

type ChangeFreezeBlocked struct {
	Error string `json:"error"`
	// Code: One of "change_freeze_active".
	Code   string                    `json:"code"`
	Freeze ChangeFreezeBlockedFreeze `json:"freeze"`
}

ChangeFreezeBlocked is the `ChangeFreezeBlocked` schema.

type ChangeFreezeBlockedFreeze added in v0.23.0

type ChangeFreezeBlockedFreeze struct {
	ID       string  `json:"id"`
	Name     string  `json:"name"`
	Reason   *string `json:"reason"`
	StartsAt string  `json:"startsAt"`
	EndsAt   *string `json:"endsAt"`
}

ChangeFreezeBlockedFreeze is an object the spec declares inline.

type ChangeFreezeInput added in v0.23.0

type ChangeFreezeInput struct {
	Name     string  `json:"name"`
	Reason   *string `json:"reason,omitempty"`
	StartsAt *string `json:"startsAt,omitempty"`
	EndsAt   *string `json:"endsAt,omitempty"`
}

ChangeFreezeInput is the `ChangeFreezeInput` schema.

type ChangeFreezeStatus added in v0.23.0

type ChangeFreezeStatus struct {
	Freeze any `json:"freeze"`
}

ChangeFreezeStatus is the `ChangeFreezeStatus` schema.

type ChangeFreezesCreateParams added in v0.23.0

type ChangeFreezesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ChangeFreezeInput
}

ChangeFreezesCreateParams holds the parameters for `client.changeFreezes.create`.

type ChangeFreezesDeleteParams added in v0.23.0

type ChangeFreezesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

ChangeFreezesDeleteParams holds the parameters for `client.changeFreezes.delete`.

type ChangeFreezesEndParams added in v0.23.0

type ChangeFreezesEndParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

ChangeFreezesEndParams holds the parameters for `client.changeFreezes.end`.

type ChangeFreezesListParams added in v0.23.0

type ChangeFreezesListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

ChangeFreezesListParams holds the parameters for `client.changeFreezes.list`.

Every field is optional; pass nil to take the defaults.

type ChangeFreezesNamespace added in v0.23.0

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

ChangeFreezesNamespace is `client.changeFreezes`.

func (*ChangeFreezesNamespace) Create added in v0.23.0

Create: Declare a change freeze window

While the freeze is in effect, destructive actions (resource deletion, destructive plugin actions, secret-version destroys, deployment rollbacks) return `423` unless explicitly overridden by a caller with `freezes:override`.

_Requires permission: `freezes:write`._

POST /api/org/{orgId}/change-freezes

Raises on 400: Bad request

func (*ChangeFreezesNamespace) Delete added in v0.23.0

Delete: Delete a change freeze window

_Requires permission: `freezes:write`._

DELETE /api/org/{orgId}/change-freezes/{id}

Raises on 404: Not found

func (*ChangeFreezesNamespace) End added in v0.23.0

End: End a change freeze now

_Requires permission: `freezes:write`._

POST /api/org/{orgId}/change-freezes/{id}/end

Raises on 404: Not found

func (*ChangeFreezesNamespace) List added in v0.23.0

List: List change freeze windows, newest first

_Requires permission: `freezes:read`._

GET /api/org/{orgId}/change-freezes

func (*ChangeFreezesNamespace) Status added in v0.23.0

Status: The freeze currently in effect, if any

Returns the active freeze window (active, started, not yet past its end time) or `freeze: null`. Clients poll this to show the freeze banner and pre-warn before destructive actions.

_Requires permission: `freezes:read`._

GET /api/org/{orgId}/change-freezes/status

func (*ChangeFreezesNamespace) Update added in v0.23.0

Update: Update a change freeze window

_Requires permission: `freezes:write`._

PUT /api/org/{orgId}/change-freezes/{id}

Raises on 400: Bad request

Raises on 404: Not found

type ChangeFreezesStatusParams added in v0.23.0

type ChangeFreezesStatusParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

ChangeFreezesStatusParams holds the parameters for `client.changeFreezes.status`.

Every field is optional; pass nil to take the defaults.

type ChangeFreezesUpdateParams added in v0.23.0

type ChangeFreezesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body ChangeFreezeInput
}

ChangeFreezesUpdateParams holds the parameters for `client.changeFreezes.update`.

type ChangesAlertSettingsGetParams added in v0.27.0

type ChangesAlertSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

ChangesAlertSettingsGetParams holds the parameters for `client.changes.alertSettings.get`.

Every field is optional; pass nil to take the defaults.

type ChangesAlertSettingsNamespace added in v0.27.0

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

ChangesAlertSettingsNamespace is `client.changes.alertSettings`.

func (*ChangesAlertSettingsNamespace) Get added in v0.27.0

Get: Get the organization's resource-drift alert filter

Drift notifications are batched: at most one message per organization per `cooldownMinutes`, covering every change since the previous one. These settings decide which changes count and how often a message may go out. Who receives it is the `resourceDrift` opt-in on push preferences, Slack channels and Teams webhooks — off by default on all three.

GET /api/org/{orgId}/changes/alert-settings

func (*ChangesAlertSettingsNamespace) Update added in v0.27.0

Update: Update the organization's resource-drift alert filter

Every field is optional so a single toggle can be saved on its own. `cooldownMinutes` is floored at 5: below the poller's own cycle the notification rate would follow the sync rate again, which is what the batching exists to prevent.

PUT /api/org/{orgId}/changes/alert-settings

Raises on 400: Bad request

type ChangesAlertSettingsUpdateParams added in v0.27.0

type ChangesAlertSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *DriftAlertSettingsUpdate
}

ChangesAlertSettingsUpdateParams holds the parameters for `client.changes.alertSettings.update`.

Every field is optional; pass nil to take the defaults.

type ChangesCostImpactsParams added in v1.18.0

type ChangesCostImpactsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *ChangeCostImpactsRequest
}

ChangesCostImpactsParams holds the parameters for `client.changes.costImpacts`.

Every field is optional; pass nil to take the defaults.

type ChangesGetParams added in v0.22.0

type ChangesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	Page       *int64
	PageSize   *int64
	AccountID  *string
	ResourceID *string
	Kind       *ResourceChangeKind
	From       *string
	To         *string
}

ChangesGetParams holds the parameters for `client.changes.get`.

Every field is optional; pass nil to take the defaults.

type ChangesNamespace added in v0.22.0

type ChangesNamespace struct {

	// AlertSettings: `client.changes.alertSettings`.
	AlertSettings *ChangesAlertSettingsNamespace
	// Revert: `client.changes.revert`.
	Revert *ChangesRevertNamespace
	// contains filtered or unexported fields
}

ChangesNamespace is `client.changes`.

func (*ChangesNamespace) CostImpacts added in v1.18.0

CostImpacts: Cost impact of a page of changes

For each change, compares the resource's per-day spend over the window before it against the window after, and reports the difference as a run-rate delta.

A POST because it takes a list of ids, not because it writes: nothing is stored. The answer is recomputed on every call, deliberately — provider cost arrives late and is then restated, so a stored number would be a wrong number that never corrects itself.

Both windows exclude the change's own day (spend on it is half old shape, half new) and today (an accruing day always reads as a dip), and are clamped symmetrically to the days cost collection actually covers.

_Requires permission: `costs:read`._

POST /api/org/{orgId}/changes/cost-impacts

Raises on 400: Bad request

func (*ChangesNamespace) Get added in v0.22.0

Get: Org-wide change timeline (paginated, filterable)

Change events recorded by the resource poller: each poll cycle diffs the freshly fetched state against the stored snapshot and records resources that appeared, changed a stored field, or disappeared upstream. Cross-provider by construction — the diff runs on the generic stored record, so every plugin's resources show up here.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/changes

Raises on 400: Bad request

func (*ChangesNamespace) Resource added in v0.22.0

Resource: Change timeline for one resource

Recent change events for a single resource, newest first. The resource id travels as a query parameter because composite ids contain slashes and colons.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/changes/resource

Raises on 400: Bad request

type ChangesResourceParams added in v0.22.0

type ChangesResourceParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ResourceID string
	Limit      *int64
}

ChangesResourceParams holds the parameters for `client.changes.resource`.

type ChangesRevertCreateParams added in v1.17.0

type ChangesRevertCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	ChangeID string
}

ChangesRevertCreateParams holds the parameters for `client.changes.revert.create`.

type ChangesRevertGetParams added in v1.17.0

type ChangesRevertGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	ChangeID string
}

ChangesRevertGetParams holds the parameters for `client.changes.revert.get`.

type ChangesRevertNamespace added in v1.17.0

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

ChangesRevertNamespace is `client.changes.revert`.

func (*ChangesRevertNamespace) Create added in v1.17.0

Create: Revert one change event

Applies the inverse patch through the plugin's ordinary `updateResource` path — the same call the Edit form makes — and only for the fields the dry run marked `revertible`.

The plan is rebuilt against a fresh live read immediately before the write, so a field that moved between the preview and the apply becomes a conflict and drops out of the patch.

**This is a last-moment re-read, not an atomic compare-and-swap.** The gap between reading a field and writing it is one provider round-trip wide, and a third party writing inside that gap will be overwritten without warning. It cannot be closed generically: the plugin update contract carries no expected value, ETag or version token, so no conditional write can be expressed for a provider that supports one. Treat the conflict detection as a strong guard against stale plans, not as a mutual-exclusion guarantee against other writers.

Reverts of the *same event* are mutually exclusive: the event is claimed with a conditional update under a five-minute lease, so two concurrent reverts cannot both reach the provider and the loser gets `409`. A provider failure releases the claim immediately; a process that dies mid-write leaves a claim that expires, so an interrupted revert is retryable rather than permanently stuck. `revertedAt` is only set once the provider accepted the write.

The claim carries an owner token, and every write that ends a revert is fenced on it. An attempt whose provider call outlives the lease can therefore neither release nor complete the claim that replaced it — it gets `409` with `appliedFields` naming what it did write, so the caller can reconcile rather than assume. Two attempts can overlap in that case, but they cannot disagree: both invert the same recorded event to the same values, so the second one's patch is a subset of the first's.

If a write reaches the provider but recording it fails, the response is `500` with `appliedFields` — the resource moved and the timeline has not caught up. The claim is deliberately held in that case, and the next attempt after the lease expires finds every field already back and records the revert without touching the provider again, answering `200` with `reconciled: true` and an empty `appliedFields`. A resource put back by hand is not mistaken for this: reconciliation only happens on an event whose claim was still outstanding, which is the only state in which an unrecorded write is possible.

Blocked with `423` while an org change freeze is in effect. Every attempt whose write reached the provider is audit-logged as `resource.change_revert`, including one that lost its claim or could not record — the entry's `outcome` is `recorded`, `superseded`, `unrecorded` or `reconciled`, so a contested outcome reads as one mutation rather than as several reverts. An attempt that neither wrote nor recorded anything logs nothing. Attribution is best-effort: no transaction spans a third-party cloud API and Infrawrench's database, so if the audit insert itself fails the response carries `auditRecorded: false` and the details go to the server log rather than being silently dropped.

The stored resource snapshot is deliberately left untouched, so the next poll observes the reverted state and records it as an ordinary change event.

POST /api/org/{orgId}/changes/{changeId}/revert

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Already reverted, another revert holds the event, nothing in the plan is writable, or this attempt was superseded mid-write (its lease lapsed). The body carries `code: change_revert_conflict` for all but the writability case, and `appliedFields` when the provider write had already landed.

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

Raises on 500: The provider accepted the write but it could not be recorded against the event. The resource *has* been put back; `appliedFields` names what changed. A later retry reconciles the timeline.

Raises on 502: The provider couldn't be read. Nothing was written.

func (*ChangesRevertNamespace) Get added in v1.17.0

Get: Dry-run a revert of one change event

Inverts the recorded diff and reconciles it against the resource's *current* live fields, which is the whole point: the poller may have recorded this hours ago and the world may have moved on. Read-only — it reads from the provider and writes nothing.

Only `updated` events with a field diff can be reverted. `outputs.*` entries are provider-derived and are never written back, and whether a field is writable at all is the plugin's own edit-form rule (`editable`, minus `secret` and `association` kinds), so a revert can never issue a provider call an edit could not.

Gated on `resources:write` rather than `resources:read`: the plan names the write it is offering to make.

GET /api/org/{orgId}/changes/{changeId}/revert

Raises on 404: Not found

Raises on 502: The provider couldn't be read, so no plan can be made safely. Nothing was written.

type ChatAskQuestionAnswer added in v1.25.0

type ChatAskQuestionAnswer struct {
	// QuestionID: Id of the question being answered.
	QuestionID string `json:"questionId"`
	// OptionID: Listed option id, or `other` when the user typed a custom value.
	OptionID *string `json:"optionId,omitempty"`
	// Text: Required for text questions and when optionId is `other`.
	Text *string `json:"text,omitempty"`
}

ChatAskQuestionAnswer is the `ChatAskQuestionAnswer` schema.

type ChatAskQuestionInput added in v1.25.0

type ChatAskQuestionInput struct {
	// Answers: One answer per question the agent asked.
	Answers []ChatAskQuestionAnswer `json:"answers"`
}

ChatAskQuestionInput is the `ChatAskQuestionInput` schema.

type ChatAskQuestionResult added in v1.25.0

type ChatAskQuestionResult struct {
	OK bool `json:"ok"`
	// AllResolved: True when every pending action and secret request on this
	// assistant message is resolved, so the caller may POST {resume: true}.
	AllResolved bool `json:"allResolved"`
}

ChatAskQuestionResult is the `ChatAskQuestionResult` schema.

type ChatConversationsNamespace added in v1.24.0

type ChatConversationsNamespace struct {

	// Pending: `client.chat.conversations.pending`.
	Pending *ChatConversationsPendingNamespace
	// SecretRequests: `client.chat.conversations.secretRequests`.
	SecretRequests *ChatConversationsSecretRequestsNamespace
	// contains filtered or unexported fields
}

ChatConversationsNamespace is `client.chat.conversations`.

type ChatConversationsPendingAnswerParams added in v1.25.0

type ChatConversationsPendingAnswerParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ConversationID: Chat conversation id
	ConversationID string
	// PendingID: Pending ask_question action id
	PendingID string
	// Body: the JSON request body.
	Body ChatAskQuestionInput
}

ChatConversationsPendingAnswerParams holds the parameters for `client.chat.conversations.pending.answer`.

type ChatConversationsPendingNamespace added in v1.25.0

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

ChatConversationsPendingNamespace is `client.chat.conversations.pending`.

func (*ChatConversationsPendingNamespace) Answer added in v1.25.0

Answer: Answer an agent question

Submit answers to a chat-only `ask_question` pending action (selection with an Other field, or a textarea). Not used for destructive-tool approval.

_Requires permission: `chat:write`._

POST /api/org/{orgId}/chat/conversations/{conversationId}/pending/{pendingId}/answer

Raises on 400: Bad request

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

type ChatConversationsSecretRequestsCreateParams added in v1.24.0

type ChatConversationsSecretRequestsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ConversationID: Chat conversation id
	ConversationID string
	// RequestID: Pending secret request id
	RequestID string
	// Body: the JSON request body.
	Body WorkflowSecretValueWrite
}

ChatConversationsSecretRequestsCreateParams holds the parameters for `client.chat.conversations.secretRequests.create`.

type ChatConversationsSecretRequestsNamespace added in v1.24.0

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

ChatConversationsSecretRequestsNamespace is `client.chat.conversations.secretRequests`.

func (*ChatConversationsSecretRequestsNamespace) Create added in v1.24.0

Create: Submit a requested workflow secret

Human-only, write-only handoff from the chat password field to encrypted workflow-secret storage. The value is never returned or added to chat history.

POST /api/org/{orgId}/chat/conversations/{conversationId}/secret-requests/{requestId}

Raises on 400: Bad request

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

type ChatNamespace added in v1.24.0

type ChatNamespace struct {

	// Conversations: `client.chat.conversations`.
	Conversations *ChatConversationsNamespace
	// contains filtered or unexported fields
}

ChatNamespace is `client.chat`.

type ChatSecretRequestResult added in v1.24.0

type ChatSecretRequestResult struct {
	OK          bool `json:"ok"`
	AllResolved bool `json:"allResolved"`
}

ChatSecretRequestResult is the `ChatSecretRequestResult` schema.

type ChildResourceRef

type ChildResourceRef struct {
	ID             ResourceID `json:"id"`
	DisplayName    string     `json:"displayName"`
	ResourceTypeID string     `json:"resourceTypeId"`
	PluginID       string     `json:"pluginId"`
	AccountID      string     `json:"accountId"`
	Status         *StatusDot `json:"status,omitempty"`
	Fields         JSONObject `json:"fields,omitempty"`
}

ChildResourceRef is the `ChildResourceRef` schema.

type ChildTypeRef

type ChildTypeRef struct {
	ID                string       `json:"id"`
	DisplayName       string       `json:"displayName"`
	PluralDisplayName *string      `json:"pluralDisplayName,omitempty"`
	SupportsCreate    bool         `json:"supportsCreate"`
	Fields            []JSONObject `json:"fields,omitempty"`
}

ChildTypeRef is the `ChildTypeRef` schema.

type ClientOption

type ClientOption func(*clientConfig)

ClientOption configures a client at construction time.

func WithAPIKey

func WithAPIKey(apiKey string) ClientOption

WithAPIKey sets the API key or access token sent as "Authorization: Bearer". Leave it unset only if you are supplying that header yourself with WithHeader.

func WithBaseURL

func WithBaseURL(baseURL string) ClientOption

WithBaseURL points the client at a different deployment. Trailing slashes are trimmed, so both "https://host" and "https://host/" behave the same.

func WithHTTPClient

func WithHTTPClient(httpClient *http.Client) ClientOption

WithHTTPClient swaps the *http.Client used for every request — for proxies, custom transports, or a client with a timeout. Defaults to http.DefaultClient.

func WithHeader

func WithHeader(name, value string) ClientOption

WithHeader sets a header on every request. Call it more than once for more than one header; a per-call WithRequestHeader wins over it.

func WithOrgID

func WithOrgID(orgID string) ClientOption

WithOrgID sets the orgId every scoped call falls back to, so it can be left out of the parameters. A call that passes its own wins; a call that has neither returns ErrMissingPathParam.

func WithUserAgent

func WithUserAgent(userAgent string) ClientOption

WithUserAgent overrides the default "infrawrench-go/<version>" User-Agent.

type CommitmentCoverage added in v1.6.0

type CommitmentCoverage struct {
	// Available: False when every in-scope account was excluded — 'we cannot
	// tell' reported as unavailable, never as 0%.
	Available  bool                         `json:"available"`
	Currencies []CommitmentCoverageCurrency `json:"currencies"`
	// ExcludedAccountIDs: Accounts whose plugin cannot tell usage from other
	// charge types; their rows would drag coverage down for reasons unrelated to
	// purchasing.
	ExcludedAccountIDs []string `json:"excludedAccountIds"`
}

CommitmentCoverage is the `CommitmentCoverage` schema.

type CommitmentCoverageCurrency added in v1.6.0

type CommitmentCoverageCurrency struct {
	Currency string `json:"currency"`
	// CoveredAmount: Usage spend on rows stamped with a commitment id.
	CoveredAmount   float64 `json:"coveredAmount"`
	UncoveredAmount float64 `json:"uncoveredAmount"`
	// UncoveredEligibleAmount: Uncovered usage in cells where a commitment
	// landed in the window — provider evidence of committability, not a
	// hand-maintained service table.
	UncoveredEligibleAmount float64 `json:"uncoveredEligibleAmount"`
	// BroadRatio: Lower bound: covered ÷ (covered + all uncovered usage).
	BroadRatio *float64 `json:"broadRatio"`
	// NarrowRatio: Upper bound: covered ÷ (covered + uncovered usage in eligible
	// cells).
	NarrowRatio *float64 `json:"narrowRatio"`
}

CommitmentCoverageCurrency is the `CommitmentCoverageCurrency` schema.

type CommitmentHolding added in v1.6.0

type CommitmentHolding struct {
	AccountID   string   `json:"accountId"`
	AccountName string   `json:"accountName"`
	PluginID    PluginID `json:"pluginId"`
	// CommitmentID: Provider-native id — the join key against cost rows'
	// commitment dimension (an ARN where billing data carries ARNs, the bare id
	// where it does not).
	CommitmentID string `json:"commitmentId"`
	// Kind: One of "reservation", "savings_plan", "committed_use".
	Kind        string `json:"kind"`
	Description string `json:"description"`
	// Scope: Provider scope qualifier — an AZ, an instance family, 'Shared'.
	Scope *string `json:"scope"`
	// Region: Null means the commitment applies across regions (an AWS Compute
	// Savings Plan) — a real state, rendered as 'All regions', not missing data.
	Region    *string `json:"region"`
	StartDate *string `json:"startDate"`
	EndDate   *string `json:"endDate"`
	// TermDays: Provider-reported term length — never derived from the dates,
	// which stop spanning the term once a commitment is split or merged.
	TermDays *int64 `json:"termDays"`
	// PaymentOption: One of "all_upfront", "partial_upfront", "no_upfront",
	// "monthly".
	PaymentOption *string `json:"paymentOption"`
	// Currency: Null when the provider reports no money at all for this record.
	Currency *string `json:"currency"`
	// UpfrontAmount: Null means the provider did not report a price (Azure's
	// list API reports none) — 'not reported', never rendered as 'free'.
	UpfrontAmount   *float64 `json:"upfrontAmount"`
	RecurringAmount *float64 `json:"recurringAmount"`
	// RecurringPeriod: Atomic with recurringAmount: an amount without a period
	// is a 730× ambiguity.
	//
	// One of "hour", "month".
	RecurringPeriod *string `json:"recurringPeriod"`
	// HourlyCommitmentAmount: Committed spend per hour — what utilization is
	// measured against.
	HourlyCommitmentAmount *float64 `json:"hourlyCommitmentAmount"`
	// UnitCommitments: Committed resource quantities for unit-denominated
	// commitments (GCP CUDs). A record has either this or hourlyCommitmentAmount
	// — the split decides which utilization question is even askable.
	UnitCommitments []CommitmentUnitAmount `json:"unitCommitments"`
	// State: One of "active", "expired", "queued".
	State string `json:"state"`
	// ProviderUtilization: The provider's own utilization aggregates (Azure
	// reservations only), verbatim — never blended with the derived utilization
	// below.
	ProviderUtilization []CommitmentProviderUtilization `json:"providerUtilization"`
	LastSeenAt          string                          `json:"lastSeenAt"`
	Utilization         CommitmentUtilization           `json:"utilization"`
}

CommitmentHolding is the `CommitmentHolding` schema.

type CommitmentPlanner added in v1.6.0

type CommitmentPlanner struct {
	// Available: False when the data window is under the 60-day minimum.
	Available       bool                       `json:"available"`
	WindowDayCount  int64                      `json:"windowDayCount"`
	Recommendations []CommitmentRecommendation `json:"recommendations"`
	Rejected        []CommitmentRejectedCell   `json:"rejected"`
}

CommitmentPlanner is the `CommitmentPlanner` schema.

type CommitmentPollFailure added in v1.6.0

type CommitmentPollFailure struct {
	AccountID    string   `json:"accountId"`
	AccountName  string   `json:"accountName"`
	PluginID     PluginID `json:"pluginId"`
	Message      string   `json:"message"`
	FailureCount int64    `json:"failureCount"`
}

CommitmentPollFailure is the `CommitmentPollFailure` schema.

type CommitmentProviderUtilization added in v1.6.0

type CommitmentProviderUtilization struct {
	// GrainDays: Trailing window the aggregate covers (1, 7, 30).
	GrainDays int64 `json:"grainDays"`
	// Percentage: Utilization percentage 0–100, exactly as the provider reports
	// it.
	Percentage float64 `json:"percentage"`
}

CommitmentProviderUtilization is the `CommitmentProviderUtilization` schema.

type CommitmentRecommendation added in v1.6.0

type CommitmentRecommendation struct {
	PluginID PluginID `json:"pluginId"`
	Service  string   `json:"service"`
	Region   string   `json:"region"`
	Currency string   `json:"currency"`
	// RecommendedDailyCommitment: p10 of daily uncovered usage spend,
	// nearest-rank — the floor, not the average.
	RecommendedDailyCommitment  float64 `json:"recommendedDailyCommitment"`
	RecommendedHourlyCommitment float64 `json:"recommendedHourlyCommitment"`
	AnnualCommitment            float64 `json:"annualCommitment"`
	P50DailySpend               float64 `json:"p50DailySpend"`
	// SavingBasis: Published discounts are "up to" figures. `range` renders
	// "$X–$Y"; `upper_bound` renders "up to $Y" — never a bare "$Y".
	//
	// One of "range", "upper_bound".
	SavingBasis              string   `json:"savingBasis"`
	DiscountRateMin          *float64 `json:"discountRateMin,omitempty"`
	DiscountRateMax          float64  `json:"discountRateMax"`
	EstimatedAnnualSavingMin *float64 `json:"estimatedAnnualSavingMin,omitempty"`
	EstimatedAnnualSavingMax float64  `json:"estimatedAnnualSavingMax"`
	// BreakEvenUtilization: 1 − discount: below this utilization the commitment
	// loses to on-demand. Equivalently, the workload can shrink by the discount
	// before committing was a mistake.
	BreakEvenUtilization float64 `json:"breakEvenUtilization"`
	// AnnualLossIfUsageHalves: max(0, annualCommitment × (0.5 − discount)) at
	// the shallow end of the published discount — a ceiling on regret where no
	// floor rate is published.
	AnnualLossIfUsageHalves float64 `json:"annualLossIfUsageHalves"`
}

CommitmentRecommendation is the `CommitmentRecommendation` schema.

type CommitmentRejectedCell added in v1.6.0

type CommitmentRejectedCell struct {
	PluginID PluginID `json:"pluginId"`
	Service  string   `json:"service"`
	Region   string   `json:"region"`
	Currency string   `json:"currency"`
	// Gate: First gate the cell failed, in evaluation order — the most
	// actionable objection.
	//
	// One of "presence", "not_in_decline", "floor", "materiality".
	Gate string `json:"gate"`
}

CommitmentRejectedCell is the `CommitmentRejectedCell` schema.

type CommitmentUnitAmount added in v1.6.0

type CommitmentUnitAmount struct {
	// Unit: Provider-native unit label, untranslated — "VCPU", "MEMORY_MB",
	// "LOCAL_SSD_GB".
	Unit   string  `json:"unit"`
	Amount float64 `json:"amount"`
}

CommitmentUnitAmount is the `CommitmentUnitAmount` schema.

type CommitmentUtilization added in v1.6.0

type CommitmentUtilization struct {
	// Utilization: delivered ÷ obligation, unclamped (values above 1 mean spend
	// past the commitment). **Null means not measurable** — never 0, which would
	// read as 'unused'; the reason field says why.
	Utilization *float64 `json:"utilization"`
	// Reason: Why utilization is null: `unit_denominated` — the commitment is in
	// resource units (GCP CUDs) and cost rows cannot say how many ran;
	// `no_active_days` — the term does not intersect the window; `no_data_days`
	// — no cost data was collected on any active day; `unattributed_rows` — the
	// account's plugin does not stamp commitment ids onto cost rows, so
	// delivered spend would falsely read as zero.
	//
	// One of "unit_denominated", "no_active_days", "no_data_days",
	// "unattributed_rows".
	Reason *string `json:"reason,omitempty"`
	// ObligationAmount: hourlyCommitmentAmount × 24 × measuredDays, in the
	// commitment's currency.
	ObligationAmount *float64 `json:"obligationAmount"`
	DeliveredAmount  float64  `json:"deliveredAmount"`
	// ActiveDays: Days of the window the commitment was active.
	ActiveDays int64 `json:"activeDays"`
	// MeasuredDays: Active days with cost data — the only days in the
	// obligation. Counting a day the collection never ran would make a
	// fully-used plan read as under-utilized.
	MeasuredDays int64 `json:"measuredDays"`
	// MissingDays: Active days without cost data, reported rather than silently
	// counted.
	MissingDays int64 `json:"missingDays"`
	WindowDays  int64 `json:"windowDays"`
}

CommitmentUtilization is the `CommitmentUtilization` schema.

type CommitmentsFeed added in v1.6.0

type CommitmentsFeed struct {
	Holdings []CommitmentHolding     `json:"holdings"`
	Coverage CommitmentCoverage      `json:"coverage"`
	Planner  CommitmentPlanner       `json:"planner"`
	Failures []CommitmentPollFailure `json:"failures"`
	// PendingAccountIDs: Commitment-capable accounts never yet collected — named
	// rather than omitted.
	PendingAccountIDs     []string `json:"pendingAccountIds"`
	UtilizationWindowDays int64    `json:"utilizationWindowDays"`
	PlannerWindowDays     int64    `json:"plannerWindowDays"`
}

CommitmentsFeed is the `CommitmentsFeed` schema.

type CommitmentsGetParams added in v1.6.0

type CommitmentsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CommitmentsGetParams holds the parameters for `client.commitments.get`.

Every field is optional; pass nil to take the defaults.

type CommitmentsNamespace added in v1.6.0

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

CommitmentsNamespace is `client.commitments`.

func (*CommitmentsNamespace) Get added in v1.6.0

Get: Reservations, savings plans and committed-use discounts

The organization's purchased commitments — reserved instances, savings plans, committed-use discounts — with three derived readings.

**Coverage** is a range, not a number: the broad ratio counts every uncovered usage dollar in the denominator (a lower bound — egress and per-request charges can never be committed against), the narrow ratio only uncovered usage in cells where a commitment demonstrably landed (an upper bound). Accounts whose plugin cannot distinguish charge types are excluded and listed; a scope where every account is excluded reports unavailable, not 0%.

**Utilization** is measured only over days cost data was actually collected — a collection gap is reported as missing days, never counted as idle commitment. Unit-denominated commitments (GCP) report null with a reason, never 0%. Azure's own reported utilization rides on each holding separately and is never blended with the derived figure.

**The planner** recommends committing at the p10 floor of daily uncovered spend, gated on presence, trend, floor and materiality. Savings are quoted against published "up to" discount rates and marked as such. Nothing is ever purchased automatically.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/commitments

type ConfigApplyParams added in v1.2.0

type ConfigApplyParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body OrgConfigRequest
}

ConfigApplyParams holds the parameters for `client.config.apply`.

type ConfigExportParams added in v1.2.0

type ConfigExportParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Sections: Comma-separated subset of sections to export. Defaults to all
	// of: budgets, customGraphs, workflows, dashboards, metricAlerts, probes,
	// costCentres, tagPolicy, alertSettings.
	Sections *string
}

ConfigExportParams holds the parameters for `client.config.export`.

Every field is optional; pass nil to take the defaults.

type ConfigNamespace added in v1.2.0

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

ConfigNamespace is `client.config`.

func (*ConfigNamespace) Apply added in v1.2.0

Apply: Apply a configuration document

Applies the document in a single transaction and returns the plan that was executed — all or nothing, so a failure never leaves the organization halfway between two configurations.

Requires the write permission of every section the document carries, so this cannot be used to reach past a role that withholds one.

_Requires permission: `config:write`._

POST /api/org/{orgId}/config/apply

Raises on 400: Bad request

Raises on 402: Payment required — the organization's plan does not include this

Raises on 403: Forbidden

func (*ConfigNamespace) Export added in v1.2.0

Export: Export the organization's configuration as one document

Dashboards, workflows, custom graphs, budgets, metric alerts, synthetic probes, cost centres, the tag policy and the org-wide alert settings, addressed by stable keys rather than row ids so the result applies to any organization.

Credentials, accounts, resources and workflow signing secrets are never included. Ordering is stable, so re-exporting an unchanged organization produces the same bytes — commit it to git and the diff is the change.

Requires the read permission of every section exported; it refuses rather than silently omitting one, because a partial document applied in `replace` mode would delete what the exporter could not see.

_Requires permission: `config:read`._

GET /api/org/{orgId}/config/export

Raises on 400: Bad request

Raises on 403: Forbidden

func (*ConfigNamespace) Plan added in v1.2.0

Plan: Preview what applying a document would do

The dry run: validates the document, resolves its cross-references against this organization, and returns the create/update/delete/unchanged plan without writing anything. Read-only, so a reviewer with read access can run it on a pull request.

_Requires permission: `config:read`._

POST /api/org/{orgId}/config/plan

Raises on 400: Bad request

Raises on 403: Forbidden

type ConfigPlanParams added in v1.2.0

type ConfigPlanParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body OrgConfigRequest
}

ConfigPlanParams holds the parameters for `client.config.plan`.

type ConnectEnvDeployParams

type ConnectEnvDeployParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ConnectEnvDeployRequest
}

ConnectEnvDeployParams holds the parameters for `client.connect.envDeploy`.

type ConnectEnvDeployRequest

type ConnectEnvDeployRequest struct {
	SourceAccountID      string            `json:"sourceAccountId"`
	SourceResourceID     ResourceID        `json:"sourceResourceId"`
	SourcePluginID       string            `json:"sourcePluginId"`
	SourceResourceTypeID string            `json:"sourceResourceTypeId"`
	SourceExternalID     *string           `json:"sourceExternalId,omitempty"`
	TargetSSHHost        string            `json:"targetSshHost"`
	SSHKeyID             string            `json:"sshKeyId"`
	SSHUsername          string            `json:"sshUsername"`
	TemplateID           string            `json:"templateId"`
	KeyOverrides         map[string]string `json:"keyOverrides"`
	// Format: One of "dotenv", "profile".
	Format   string `json:"format"`
	FilePath string `json:"filePath"`
	Append   bool   `json:"append"`
}

ConnectEnvDeployRequest is the `ConnectEnvDeployRequest` schema.

type ConnectNamespace

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

ConnectNamespace is `client.connect`.

func (*ConnectNamespace) EnvDeploy

func (n *ConnectNamespace) EnvDeploy(ctx context.Context, params ConnectEnvDeployParams, opts ...RequestOption) (*OK, error)

EnvDeploy: Deploy env vars from a source resource to an SSH target

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/connect/env-deploy

Raises on 400: Bad request

Raises on 404: Not found

func (*ConnectNamespace) SecretExport

func (n *ConnectNamespace) SecretExport(ctx context.Context, params ConnectSecretExportParams, opts ...RequestOption) (*OK, error)

SecretExport: Materialize source outputs as a secret in the target (e.g. K8s)

_Requires permission: `resources:write`._

POST /api/org/{orgId}/connect/secret-export

Raises on 400: Bad request

Raises on 404: Not found

func (*ConnectNamespace) Templates

Templates: List secret-export templates and target capabilities

_Requires permission: `resources:read`._

POST /api/org/{orgId}/connect/templates

Raises on 404: Not found

type ConnectSecretExportParams

type ConnectSecretExportParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ConnectSecretExportRequest
}

ConnectSecretExportParams holds the parameters for `client.connect.secretExport`.

type ConnectSecretExportRequest

type ConnectSecretExportRequest struct {
	SourceAccountID      string            `json:"sourceAccountId"`
	SourceResourceID     ResourceID        `json:"sourceResourceId"`
	SourcePluginID       string            `json:"sourcePluginId"`
	SourceResourceTypeID string            `json:"sourceResourceTypeId"`
	SourceExternalID     *string           `json:"sourceExternalId,omitempty"`
	TargetAccountID      string            `json:"targetAccountId"`
	TargetPluginID       string            `json:"targetPluginId"`
	TemplateID           string            `json:"templateId"`
	Namespace            string            `json:"namespace"`
	SecretName           string            `json:"secretName"`
	KeyOverrides         map[string]string `json:"keyOverrides"`
}

ConnectSecretExportRequest is the `ConnectSecretExportRequest` schema.

type ConnectTemplatesParams

type ConnectTemplatesParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ConnectTemplatesRequest
}

ConnectTemplatesParams holds the parameters for `client.connect.templates`.

type ConnectTemplatesRequest

type ConnectTemplatesRequest struct {
	SourcePluginID       string `json:"sourcePluginId"`
	SourceResourceTypeID string `json:"sourceResourceTypeId"`
	TargetAccountID      string `json:"targetAccountId"`
	TargetPluginID       string `json:"targetPluginId"`
}

ConnectTemplatesRequest is the `ConnectTemplatesRequest` schema.

type ConnectTemplatesResponse

type ConnectTemplatesResponse struct {
	Templates               []SecretExportTemplate `json:"templates"`
	EffectiveResourceTypeID string                 `json:"effectiveResourceTypeId"`
	SupportsSecretImport    bool                   `json:"supportsSecretImport"`
	Namespaces              []string               `json:"namespaces"`
}

ConnectTemplatesResponse is the `ConnectTemplatesResponse` schema.

type CostAccountStatus

type CostAccountStatus struct {
	AccountID     string   `json:"accountId"`
	PluginID      string   `json:"pluginId"`
	DisplayName   string   `json:"displayName"`
	SupportsCosts bool     `json:"supportsCosts"`
	PeriodNative  bool     `json:"periodNative"`
	Dimensions    []string `json:"dimensions"`
	// ChargeTypes: Whether this account's plugin can tell one kind of charge
	// from another. False means every row it writes is recorded as `usage` — not
	// that the provider only bills usage.
	ChargeTypes bool `json:"chargeTypes"`
	// Amortization: Whether this account's plugin reports an amortized amount
	// distinct from the cash amount. Clients offer the amortized cost basis only
	// when at least one account says yes; elsewhere the amortized view is the
	// cash numbers under another name.
	Amortization bool `json:"amortization"`
	// Estimated: Whether this account's amounts are derived by Infrawrench —
	// inventory priced against a rate card, or metered usage priced at published
	// list rates — rather than reported as billed spend. True means the series
	// cannot be reconciled against an invoice: resources deleted part-way
	// through a period are no longer in inventory to be priced, all rates are
	// list rather than negotiated, and credits, tax and refunds never appear.
	Estimated            bool    `json:"estimated"`
	CostLastPolledAt     *string `json:"costLastPolledAt"`
	CostBackfilledAt     *string `json:"costBackfilledAt"`
	CostPollFailureCount int64   `json:"costPollFailureCount"`
	// CostPollError: Last cost-collection failure for this account, cleared on
	// the next success. `helpLink` points at the provider page that fixes a
	// setup problem when the plugin can identify one (e.g. GCP's billing export
	// console).
	CostPollError *CostAccountStatusCostPollError `json:"costPollError"`
	Coverage      *CostAccountStatusCoverage      `json:"coverage"`
}

CostAccountStatus is the `CostAccountStatus` schema.

type CostAccountStatusCostPollError

type CostAccountStatusCostPollError struct {
	Message  string                                  `json:"message"`
	HelpLink *CostAccountStatusCostPollErrorHelpLink `json:"helpLink"`
}

CostAccountStatusCostPollError is an object the spec declares inline.

type CostAccountStatusCostPollErrorHelpLink struct {
	Label string `json:"label"`
	URL   string `json:"url"`
}

CostAccountStatusCostPollErrorHelpLink is an object the spec declares inline.

type CostAccountStatusCoverage

type CostAccountStatusCoverage struct {
	FirstDay string `json:"firstDay"`
	LastDay  string `json:"lastDay"`
}

CostAccountStatusCoverage is an object the spec declares inline.

type CostAdjustmentSummary added in v1.9.0

type CostAdjustmentSummary struct {
	// Rules: The enabled rules in force for this answer, in evaluation order.
	Rules []CostAdjustmentSummaryRules `json:"rules"`
	// RawTotals: The collected, unadjusted totals for exactly the same rows,
	// summed in the same scan. Always present on an adjusted answer — this is
	// the figure that reconciles against an invoice. Per-series raw figures are
	// deliberately not offered: after a reallocation the series are a different
	// partition of the same money.
	RawTotals map[string]float64 `json:"rawTotals"`
	// FixedTotals: Fixed-amount charges over the period, pro-rated. On a cost
	// query these are reported here and **not** folded into `totals`, which
	// stays the sum of the series; the figure an organisation reports internally
	// is the adjusted total plus this. On a showback report they are
	// additionally booked onto the cost centre the rule names.
	FixedTotals map[string]float64 `json:"fixedTotals"`
}

CostAdjustmentSummary: What an adjusted answer did. Present whenever the request asked to be adjusted, even for an organisation with no rules — its absence means, and can only mean, that every figure in the response is exactly what the providers charged.

type CostAdjustmentSummaryRules added in v1.9.0

type CostAdjustmentSummaryRules struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// Kind: One of "percentage", "fixed", "reallocation".
	Kind    string `json:"kind"`
	Summary string `json:"summary"`
}

CostAdjustmentSummaryRules is an object the spec declares inline.

type CostAlert added in v1.6.0

type CostAlert struct {
	ID      string            `json:"id"`
	Name    string            `json:"name"`
	Filters []CostAlertFilter `json:"filters"`
	// GroupBy: Per-group fan-out. Null watches the scope's one total; a
	// dimension watches each group against its own prior window, and each
	// offending group fires its own event.
	//
	// One of "provider", "account", "service", "region", "resource", "tag",
	// "charge_type", "commitment".
	GroupBy              *string             `json:"groupBy"`
	GroupByTagKey        *string             `json:"groupByTagKey"`
	Cadence              CostChangeCadence   `json:"cadence"`
	ThresholdPercent     *int64              `json:"thresholdPercent"`
	ThresholdAmountCents *int64              `json:"thresholdAmountCents"`
	Direction            CostChangeDirection `json:"direction"`
	Enabled              bool                `json:"enabled"`
	LastEvaluatedAt      *string             `json:"lastEvaluatedAt"`
	LastFiredAt          *string             `json:"lastFiredAt"`
	CreatedAt            string              `json:"createdAt"`
	UpdatedAt            string              `json:"updatedAt"`
}

CostAlert: A change-based cost alert: fires when spend on its scope moves more than the configured threshold versus the prior period. The third alert family alongside budgets (absolute monthly total) and anomaly detection (statistical outliers against a learned baseline).

type CostAlertEvent added in v1.6.0

type CostAlertEvent struct {
	ID        string `json:"id"`
	AlertID   string `json:"alertId"`
	AlertName string `json:"alertName"`
	// PeriodKey: The cadence period the firing belongs to — a day, an ISO week
	// (2026-W32) or a month (2026-08). One period fires at most once per group
	// and currency.
	PeriodKey    string `json:"periodKey"`
	WindowFrom   string `json:"windowFrom"`
	WindowTo     string `json:"windowTo"`
	PreviousFrom string `json:"previousFrom"`
	PreviousTo   string `json:"previousTo"`
	// GroupKey: The offending group; empty when the alert watches one total.
	GroupKey            string `json:"groupKey"`
	Currency            string `json:"currency"`
	PreviousAmountCents int64  `json:"previousAmountCents"`
	CurrentAmountCents  int64  `json:"currentAmountCents"`
	// ChangePercent: Signed percent change. Null when the prior window had no
	// spend at all (new spend — the change is infinite); -100 when the group
	// vanished.
	ChangePercent *int64 `json:"changePercent"`
	// Direction: One of "increase", "decrease".
	Direction  string  `json:"direction"`
	FiredAt    string  `json:"firedAt"`
	NotifiedAt *string `json:"notifiedAt"`
}

CostAlertEvent is the `CostAlertEvent` schema.

type CostAlertFilter added in v1.6.0

type CostAlertFilter struct {
	// Dimension: One of "provider", "account", "service", "region", "resource",
	// "tag", "charge_type", "commitment".
	Dimension string `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

CostAlertFilter is the `CostAlertFilter` schema.

type CostAlertInput added in v1.6.0

type CostAlertInput struct {
	Name    string            `json:"name"`
	Filters []CostAlertFilter `json:"filters,omitempty"`
	// GroupBy: Per-group fan-out. Null watches the scope's one total; a
	// dimension watches each group against its own prior window, and each
	// offending group fires its own event.
	//
	// One of "provider", "account", "service", "region", "resource", "tag",
	// "charge_type", "commitment".
	GroupBy *string `json:"groupBy,omitempty"`
	// GroupByTagKey: Required when groupBy is tag.
	GroupByTagKey *string           `json:"groupByTagKey,omitempty"`
	Cadence       CostChangeCadence `json:"cadence"`
	// ThresholdPercent: Percent of the prior window's spend the change must
	// reach. At least one of the two thresholds must be set; when both are, BOTH
	// must hold before the alert fires.
	ThresholdPercent *int64 `json:"thresholdPercent,omitempty"`
	// ThresholdAmountCents: Cents the change must reach.
	ThresholdAmountCents *int64              `json:"thresholdAmountCents,omitempty"`
	Direction            CostChangeDirection `json:"direction"`
	Enabled              *bool               `json:"enabled,omitempty"`
}

CostAlertInput is the `CostAlertInput` schema.

type CostAlertsCreateParams added in v1.6.0

type CostAlertsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostAlertInput
}

CostAlertsCreateParams holds the parameters for `client.costAlerts.create`.

type CostAlertsDeleteParams added in v1.6.0

type CostAlertsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostAlertsDeleteParams holds the parameters for `client.costAlerts.delete`.

type CostAlertsEventsParams added in v1.6.0

type CostAlertsEventsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	AlertID *string
	Limit   *int64
}

CostAlertsEventsParams holds the parameters for `client.costAlerts.events`.

Every field is optional; pass nil to take the defaults.

type CostAlertsEventsResponse added in v1.6.0

type CostAlertsEventsResponse struct {
	Events []CostAlertEvent `json:"events"`
}

CostAlertsEventsResponse is an object the spec declares inline.

type CostAlertsGetGetOrgOrgIDCostAlertsIDParams added in v1.6.0

type CostAlertsGetGetOrgOrgIDCostAlertsIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostAlertsGetGetOrgOrgIDCostAlertsIDParams holds the parameters for `client.costAlerts.get.getOrgOrgIdCostAlertsId`.

type CostAlertsGetGetParams added in v1.6.0

type CostAlertsGetGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostAlertsGetGetParams holds the parameters for `client.costAlerts.get.get`.

Every field is optional; pass nil to take the defaults.

type CostAlertsGetGetResponse added in v1.6.0

type CostAlertsGetGetResponse struct {
	Alerts []CostAlert `json:"alerts"`
}

CostAlertsGetGetResponse is an object the spec declares inline.

type CostAlertsGetNamespace added in v1.6.0

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

CostAlertsGetNamespace is `client.costAlerts.get`.

func (*CostAlertsGetNamespace) Get added in v1.6.0

Get: List change-based cost alerts

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-alerts

func (*CostAlertsGetNamespace) GetOrgOrgIDCostAlertsID added in v1.6.0

GetOrgOrgIDCostAlertsID: Get a cost alert

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-alerts/{id}

Raises on 404: Not found

type CostAlertsNamespace added in v1.6.0

type CostAlertsNamespace struct {

	// Get: `client.costAlerts.get`.
	Get *CostAlertsGetNamespace
	// contains filtered or unexported fields
}

CostAlertsNamespace is `client.costAlerts`.

func (*CostAlertsNamespace) Create added in v1.6.0

Create: Create a change-based cost alert

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-alerts

Raises on 400: Bad request

func (*CostAlertsNamespace) Delete added in v1.6.0

func (n *CostAlertsNamespace) Delete(ctx context.Context, params CostAlertsDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete a cost alert

Soft delete. Fired events disappear from the org-wide event feed with it.

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/cost-alerts/{id}

Raises on 404: Not found

func (*CostAlertsNamespace) Events added in v1.6.0

Events: List recently fired cost-alert events

Newest first. Optionally scoped to one alert with ?alertId=; an unknown alertId is a 404, distinct from an alert that simply has no events yet.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-alerts/events

Raises on 400: Bad request

Raises on 404: Not found

func (*CostAlertsNamespace) Update added in v1.6.0

Update: Update a cost alert

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/cost-alerts/{id}

Raises on 400: Bad request

Raises on 404: Not found

type CostAlertsUpdateParams added in v1.6.0

type CostAlertsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body CostAlertInput
}

CostAlertsUpdateParams holds the parameters for `client.costAlerts.update`.

type CostAnnotation added in v1.9.0

type CostAnnotation struct {
	ID string `json:"id"`
	// StartDate: Inclusive first day (UTC) the note is about. Mapped to
	// whichever bucket holds it at the chart's binning — daily and cumulative
	// use the day itself, weekly the Monday that starts its week, monthly the
	// first of its month.
	StartDate string `json:"startDate"`
	// EndDate: Inclusive last day, or null for a note about a single moment. A
	// deploy is a moment; a migration is a week, and a week spelled as seven
	// notes misstates how many things happened. An end equal to the start is
	// stored as null — the same fact has one spelling.
	EndDate *string `json:"endDate"`
	Text    string  `json:"text"`
	// CostReportID: The report this note is scoped to, or null for **org-wide**.
	// Null is the useful default: an org-wide note is drawn on every cost chart,
	// because "we changed instance types" is not a fact about one report. An id
	// from another org is a 400.
	CostReportID    *string `json:"costReportId"`
	CreatedByUserID *string `json:"createdByUserId"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
	// CostAnomalyID: The detected cost anomaly this note was written to explain
	// (see POST /costs/anomalies/{anomalyId}/acknowledge), or null for a note
	// written by hand. The reverse of the anomaly's own
	// `acknowledgement.annotationId`, resolved from that same single link rather
	// than stored twice.
	CostAnomalyID *string `json:"costAnomalyId"`
}

CostAnnotation is the `CostAnnotation` schema.

type CostAnnotationInput added in v1.9.0

type CostAnnotationInput struct {
	// StartDate: Inclusive first day (UTC) the note is about. Mapped to
	// whichever bucket holds it at the chart's binning — daily and cumulative
	// use the day itself, weekly the Monday that starts its week, monthly the
	// first of its month.
	StartDate string `json:"startDate"`
	// EndDate: Inclusive last day, or null for a note about a single moment. A
	// deploy is a moment; a migration is a week, and a week spelled as seven
	// notes misstates how many things happened. An end equal to the start is
	// stored as null — the same fact has one spelling.
	EndDate *string `json:"endDate,omitempty"`
	Text    string  `json:"text"`
	// CostReportID: The report this note is scoped to, or null for **org-wide**.
	// Null is the useful default: an org-wide note is drawn on every cost chart,
	// because "we changed instance types" is not a fact about one report. An id
	// from another org is a 400.
	CostReportID *string `json:"costReportId,omitempty"`
}

CostAnnotationInput is the `CostAnnotationInput` schema.

type CostAnnotationsChangeImpactParams added in v1.18.0

type CostAnnotationsChangeImpactParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *ChangeCostImpactAnnotationRequest
}

CostAnnotationsChangeImpactParams holds the parameters for `client.costAnnotations.changeImpact`.

Every field is optional; pass nil to take the defaults.

type CostAnnotationsCreateParams added in v1.9.0

type CostAnnotationsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostAnnotationInput
}

CostAnnotationsCreateParams holds the parameters for `client.costAnnotations.create`.

type CostAnnotationsDeleteParams added in v1.9.0

type CostAnnotationsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostAnnotationsDeleteParams holds the parameters for `client.costAnnotations.delete`.

type CostAnnotationsGetParams added in v1.9.0

type CostAnnotationsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ReportID: Scope to the notes a chart for this report should draw.
	ReportID *string
}

CostAnnotationsGetParams holds the parameters for `client.costAnnotations.get`.

Every field is optional; pass nil to take the defaults.

type CostAnnotationsGetResponse added in v1.9.0

type CostAnnotationsGetResponse struct {
	Annotations []CostAnnotation `json:"annotations"`
}

CostAnnotationsGetResponse is an object the spec declares inline.

type CostAnnotationsNamespace added in v1.9.0

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

CostAnnotationsNamespace is `client.costAnnotations`.

func (*CostAnnotationsNamespace) ChangeImpact added in v1.18.0

ChangeImpact: Pin a change's or deploy's cost impact onto the cost charts

Writes the finding as a cost annotation, so the step in the run rate is explained on the graph where it shows. Re-posting the same subject **rewords the existing note** rather than adding a second — which is what makes it safe to pin a finding again once the provider has finished restating. The note's date and report scope are never rewritten: they may have been edited deliberately.

A subject with no measurable impact is a 400, not a note reading `$0.00/day`.

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-annotations/change-impact

Raises on 400: Bad request

Raises on 404: Not found

func (*CostAnnotationsNamespace) Create added in v1.9.0

Create: Create a cost annotation

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-annotations

Raises on 400: Bad request

func (*CostAnnotationsNamespace) Delete added in v1.9.0

Delete: Delete a cost annotation

A hard delete. A withdrawn explanation should stop being drawn, and nothing references a note by id.

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/cost-annotations/{id}

Raises on 404: Not found

func (*CostAnnotationsNamespace) Get added in v1.9.0

Get: List cost annotations

Dated notes drawn over cost charts. With `reportId`, the set a chart for that report draws: the org-wide notes plus that report's own. Without it, every annotation in the org. Annotations are an overlay — they never appear in a series, a total, or an axis.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-annotations

func (*CostAnnotationsNamespace) Update added in v1.9.0

Update: Update a cost annotation

Replaces the note's dates, text and scope. Moving a note between org-wide and one report is this same PUT with a different `costReportId`.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/cost-annotations/{id}

Raises on 400: Bad request

Raises on 404: Not found

type CostAnnotationsUpdateParams added in v1.9.0

type CostAnnotationsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body CostAnnotationInput
}

CostAnnotationsUpdateParams holds the parameters for `client.costAnnotations.update`.

type CostAnomaly added in v0.24.0

type CostAnomaly struct {
	ID string `json:"id"`
	// Day: The anomalous UTC day.
	Day string `json:"day"`
	// Kind: Which detection produced the row. `spike` is spend far above the
	// key's own trailing baseline; `new_source` is a provider or service with no
	// spend at all across the trailing window that suddenly has material spend —
	// it can never be a `spike`, since a zero baseline has no mean or deviation
	// to exceed. Rows written before new-source detection existed read as
	// `spike`.
	//
	// One of "spike", "new_source".
	Kind string `json:"kind"`
	// Dimension: One of "provider", "service".
	Dimension string `json:"dimension"`
	// DimensionKey: The dimension's value — a plugin id or a service name.
	DimensionKey string `json:"dimensionKey"`
	Currency     string `json:"currency"`
	ActualCents  int64  `json:"actualCents"`
	// BaselineCents: Mean daily spend over the trailing 28-day baseline, in
	// cents. Zero, or near it, for a `new_source` — clients must not compute a
	// percentage change from it.
	BaselineCents int64 `json:"baselineCents"`
	// ThresholdCents: The detection bar the day cleared, in cents: baseline mean + N·stddev for a `spike`, the new-source floor for a `new_source`.
	ThresholdCents int64  `json:"thresholdCents"`
	DetectedAt     string `json:"detectedAt"`
	// NotifiedAt: When the anomaly was delivered to a notification channel; null
	// when delivery failed or a recent anomaly for the same key suppressed it.
	NotifiedAt *string `json:"notifiedAt"`
	// Hints: Root-cause hints computed when the anomaly fired: human-readable
	// facts from the change timeline and audit log for the anomalous day and the
	// day before (e.g. "12 gce-instance resources appeared", a workflow run, a
	// lifted change freeze), ranked by likely relevance and capped at three.
	// Empty when nothing notable happened in the window or the anomaly predates
	// hint collection.
	Hints []string `json:"hints"`
	// Acknowledgement: Present once somebody has explained this finding, null
	// while it is still an open question. Acknowledging does not suppress
	// detection — the same key spiking again on a later day is a new anomaly and
	// fires as normal.
	Acknowledgement *CostAnomalyAcknowledgement `json:"acknowledgement"`
}

CostAnomaly is the `CostAnomaly` schema.

type CostAnomalyAcknowledgement added in v1.10.0

type CostAnomalyAcknowledgement struct {
	// Explanation: What somebody established this finding was. Also the
	// annotation's text.
	Explanation string `json:"explanation"`
	// AcknowledgedAt: When the current explanation was recorded — restamped by a
	// correction.
	AcknowledgedAt       string  `json:"acknowledgedAt"`
	AcknowledgedByUserID *string `json:"acknowledgedByUserId"`
	// AnnotationID: The cost annotation this created, drawn on every chart
	// covering the anomalous day. Null once that note has been deleted — which
	// removes the marker, never the acknowledgement: the finding stays
	// explained.
	AnnotationID *string `json:"annotationId"`
}

CostAnomalyAcknowledgement is an object the spec declares inline.

type CostAnomalySettings added in v0.27.0

type CostAnomalySettings struct {
	// Sigmas: Standard deviations above a key's own trailing mean that count as
	// a spike. Lower is more sensitive. Bounded at 1 — below that roughly a
	// third of ordinary days clear the bar — and at 10, above which nothing
	// short of a 10x jump fires. Defaults to 3.
	Sigmas float64 `json:"sigmas"`
	// MinDeltaCents: Minimum rise over the baseline mean before a spike alerts,
	// in USD cents (converted per series, so it means the same real amount in
	// every currency). Defaults to 1000 ($10).
	MinDeltaCents int64 `json:"minDeltaCents"`
	// NewSourceMinCents: Minimum first-day spend before a new spend source
	// alerts, in USD cents. A key with no prior spend has no statistical bar to
	// clear, so this absolute floor is the only thing keeping a new $0.02/day
	// service quiet. Defaults to 2500 ($25).
	NewSourceMinCents int64 `json:"newSourceMinCents"`
	// SmsAlerts: Which anomalies also text the organization's Twilio recipients.
	// Defaults to `off` — an organization with Twilio configured for budgets
	// does not start receiving anomaly texts until it asks to. `new_source`
	// texts only about spend appearing from nothing, which is what a leaked key
	// looks like on a bill; `all` adds spikes on existing lines. Delivery is
	// batched — one SMS per detection pass summarizing what it alerted on, at
	// most one every six hours per organization — and never places a voice call.
	// Push, Slack and Teams delivery is unaffected by this setting.
	//
	// One of "off", "new_source", "all".
	SmsAlerts string `json:"smsAlerts"`
}

CostAnomalySettings is the `CostAnomalySettings` schema.

type CostAnomalySettingsView added in v0.27.0

type CostAnomalySettingsView struct {
	// Sigmas: Standard deviations above a key's own trailing mean that count as
	// a spike. Lower is more sensitive. Bounded at 1 — below that roughly a
	// third of ordinary days clear the bar — and at 10, above which nothing
	// short of a 10x jump fires. Defaults to 3.
	Sigmas float64 `json:"sigmas"`
	// MinDeltaCents: Minimum rise over the baseline mean before a spike alerts,
	// in USD cents (converted per series, so it means the same real amount in
	// every currency). Defaults to 1000 ($10).
	MinDeltaCents int64 `json:"minDeltaCents"`
	// NewSourceMinCents: Minimum first-day spend before a new spend source
	// alerts, in USD cents. A key with no prior spend has no statistical bar to
	// clear, so this absolute floor is the only thing keeping a new $0.02/day
	// service quiet. Defaults to 2500 ($25).
	NewSourceMinCents int64 `json:"newSourceMinCents"`
	// SmsAlerts: Which anomalies also text the organization's Twilio recipients.
	// Defaults to `off` — an organization with Twilio configured for budgets
	// does not start receiving anomaly texts until it asks to. `new_source`
	// texts only about spend appearing from nothing, which is what a leaked key
	// looks like on a bill; `all` adds spikes on existing lines. Delivery is
	// batched — one SMS per detection pass summarizing what it alerted on, at
	// most one every six hours per organization — and never places a voice call.
	// Push, Slack and Teams delivery is unaffected by this setting.
	//
	// One of "off", "new_source", "all".
	SmsAlerts string `json:"smsAlerts"`
	// SmsConfigured: Whether an SMS raised right now could be delivered: paging
	// enabled for the organization, Twilio credentials and a from-number stored,
	// and at least one recipient opted into SMS. Read-only and derived — it is
	// not accepted on PUT.
	SmsConfigured bool `json:"smsConfigured"`
}

CostAnomalySettingsView is the `CostAnomalySettingsView` schema.

type CostBasis added in v1.6.0

type CostBasis = string

CostBasis: Which number to sum. `cash` is what the provider charged on the day it charged it — the default, and what every query returned before this existed. `amortized` spreads a commitment's up-front fee across the term it buys, so a year of capacity bought on one day is counted on the days it covers. Providers that report no amortized amount fall back to their cash amount, so an amortized query over a mixed estate never drops their spend.

const (
	CostBasisCash      CostBasis = "cash"
	CostBasisAmortized CostBasis = "amortized"
)

The values CostBasis takes.

type CostCentre added in v0.29.0

type CostCentre struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	// ParentID: The centre this one sits under; null is a top-level centre.
	// Nesting is a reporting structure only — allocation still resolves each
	// cost row to exactly one centre.
	ParentID  *string `json:"parentId"`
	CreatedAt string  `json:"createdAt"`
	UpdatedAt string  `json:"updatedAt"`
}

CostCentre is the `CostCentre` schema.

type CostCentreInput added in v0.29.0

type CostCentreInput struct {
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	// ParentID: Cost centre to nest this one under; null is the top level. On an
	// update, moving a centre is this field changing — omitting it leaves the
	// centre where it is. Rejected with 400 when the parent is unknown, is the
	// centre itself or one of its own descendants, or when the resulting tree
	// would be more than 4 levels deep (measured over the whole subtree being
	// moved).
	ParentID *string `json:"parentId,omitempty"`
}

CostCentreInput is the `CostCentreInput` schema.

type CostCentresCreateParams added in v0.29.0

type CostCentresCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostCentreInput
}

CostCentresCreateParams holds the parameters for `client.costCentres.create`.

type CostCentresDeleteParams added in v0.29.0

type CostCentresDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostCentresDeleteParams holds the parameters for `client.costCentres.delete`.

type CostCentresListParams added in v0.29.0

type CostCentresListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostCentresListParams holds the parameters for `client.costCentres.list`.

Every field is optional; pass nil to take the defaults.

type CostCentresNamespace added in v0.29.0

type CostCentresNamespace struct {

	// Rules: `client.costCentres.rules`.
	Rules *CostCentresRulesNamespace
	// contains filtered or unexported fields
}

CostCentresNamespace is `client.costCentres`.

func (*CostCentresNamespace) Create added in v0.29.0

Create: Create a cost centre

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-centres

Raises on 400: Bad request

func (*CostCentresNamespace) Delete added in v0.29.0

Delete: Delete a cost centre (its allocation rules go with it)

The centre's allocation rules are deleted with it, so the spend they claimed falls through to the next matching rule or to "Unallocated". Child centres are not deleted: they are re-parented onto the deleted centre's own parent (a root's children become roots), so a subtree keeps its shape and no ancestor's subtree total moves unexpectedly.

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/cost-centres/{id}

Raises on 404: Not found

func (*CostCentresNamespace) List added in v0.29.0

List: List cost centres

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-centres

func (*CostCentresNamespace) Update added in v0.29.0

Update: Update or move a cost centre

Renames, redescribes, and/or moves a centre. Moving is `parentId` changing; omitting the field leaves the centre where it is. 400 when the move would cycle or breach the depth cap.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/cost-centres/{id}

Raises on 400: Bad request

Raises on 404: Not found

type CostCentresRulesCreateParams added in v0.29.0

type CostCentresRulesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body AllocationRuleInput
}

CostCentresRulesCreateParams holds the parameters for `client.costCentres.rules.create`.

type CostCentresRulesDeleteParams added in v0.29.0

type CostCentresRulesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostCentresRulesDeleteParams holds the parameters for `client.costCentres.rules.delete`.

type CostCentresRulesListParams added in v0.29.0

type CostCentresRulesListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostCentresRulesListParams holds the parameters for `client.costCentres.rules.list`.

Every field is optional; pass nil to take the defaults.

type CostCentresRulesNamespace added in v0.29.0

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

CostCentresRulesNamespace is `client.costCentres.rules`.

func (*CostCentresRulesNamespace) Create added in v0.29.0

Create: Create an allocation rule

Maps spend onto a cost centre. Rules evaluate first-match-wins by ascending priority against each cost row's tags, account, provider, and service.

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-centres/rules

Raises on 400: Bad request

Raises on 404: Not found

func (*CostCentresRulesNamespace) Delete added in v0.29.0

Delete: Delete an allocation rule

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/cost-centres/rules/{id}

Raises on 404: Not found

func (*CostCentresRulesNamespace) List added in v0.29.0

List: List allocation rules in evaluation order

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-centres/rules

func (*CostCentresRulesNamespace) Swap added in v0.29.0

Swap: Swap the priorities of two allocation rules

Atomically swaps priorities so first-match-wins order can be edited without a half-applied pair of independent updates.

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-centres/rules/swap

Raises on 400: Bad request

Raises on 404: Not found

func (*CostCentresRulesNamespace) Update added in v0.29.0

Update: Update an allocation rule

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/cost-centres/rules/{id}

Raises on 400: Bad request

Raises on 404: Not found

type CostCentresRulesSwapParams added in v0.29.0

type CostCentresRulesSwapParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SwapAllocationRulesBody
}

CostCentresRulesSwapParams holds the parameters for `client.costCentres.rules.swap`.

type CostCentresRulesUpdateParams added in v0.29.0

type CostCentresRulesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body AllocationRuleInput
}

CostCentresRulesUpdateParams holds the parameters for `client.costCentres.rules.update`.

type CostCentresUpdateParams added in v0.29.0

type CostCentresUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body CostCentreInput
}

CostCentresUpdateParams holds the parameters for `client.costCentres.update`.

type CostChangeCadence added in v1.6.0

type CostChangeCadence = string

CostChangeCadence: Which window is compared to which, in complete UTC days (the accruing current day never counts). daily: one complete day vs the same weekday one week earlier. weekly: the last 7 complete days vs the 7 before them. monthly: month-to-date vs the same number of days at the start of the prior month — never MTD vs the full prior month.

const (
	CostChangeCadenceDaily   CostChangeCadence = "daily"
	CostChangeCadenceWeekly  CostChangeCadence = "weekly"
	CostChangeCadenceMonthly CostChangeCadence = "monthly"
)

The values CostChangeCadence takes.

type CostChangeDirection added in v1.6.0

type CostChangeDirection = string

CostChangeDirection is the `CostChangeDirection` schema.

const (
	CostChangeDirectionIncrease CostChangeDirection = "increase"
	CostChangeDirectionDecrease CostChangeDirection = "decrease"
	CostChangeDirectionBoth     CostChangeDirection = "both"
)

The values CostChangeDirection takes.

type CostChargeType added in v1.6.0

type CostChargeType = string

CostChargeType is the `CostChargeType` schema.

const (
	CostChargeTypeUsage                  CostChargeType = "usage"
	CostChargeTypeCommitmentCoveredUsage CostChargeType = "commitment_covered_usage"
	CostChargeTypeCommitmentFee          CostChargeType = "commitment_fee"
	CostChargeTypeCommitmentDiscount     CostChargeType = "commitment_discount"
	CostChargeTypeCredit                 CostChargeType = "credit"
	CostChargeTypeTax                    CostChargeType = "tax"
	CostChargeTypeRefund                 CostChargeType = "refund"
	CostChargeTypeAdjustment             CostChargeType = "adjustment"
	CostChargeTypeSupport                CostChargeType = "support"
	CostChargeTypeOther                  CostChargeType = "other"
)

The values CostChargeType takes.

type CostDateRange added in v1.6.0

type CostDateRange = any

CostDateRange: A relative preset resolves against today every time the report runs, so a saved report keeps meaning 'the last 30 days'; an absolute range pins it to fixed dates.

type CostDimension

type CostDimension = string

CostDimension is the `CostDimension` schema.

const (
	CostDimensionProvider   CostDimension = "provider"
	CostDimensionAccount    CostDimension = "account"
	CostDimensionService    CostDimension = "service"
	CostDimensionRegion     CostDimension = "region"
	CostDimensionResource   CostDimension = "resource"
	CostDimensionTag        CostDimension = "tag"
	CostDimensionChargeType CostDimension = "charge_type"
	CostDimensionCommitment CostDimension = "commitment"
)

The values CostDimension takes.

type CostDimensionValues

type CostDimensionValues struct {
	Values []any `json:"values"`
}

CostDimensionValues is the `CostDimensionValues` schema.

type CostEfficiencySettings added in v1.9.0

type CostEfficiencySettings struct {
	// CommitmentExpiryEnabled: Whether commitments approaching their term end
	// raise alerts. Defaults to true.
	CommitmentExpiryEnabled bool `json:"commitmentExpiryEnabled"`
	// CommitmentExpiryHorizonDays: Days of notice, each firing at most once per
	// commitment per term end. Defaults to [60, 30, 7]. A commitment fires at
	// the *smallest* horizon it has reached, so an account connected 30 days
	// before a term ends gets one alert, not two.
	CommitmentExpiryHorizonDays []int64 `json:"commitmentExpiryHorizonDays"`
	// CommitmentExpiryAlertOnExpired: Whether a commitment that lapsed without
	// any horizon warning having fired raises one alert anyway. Defaults to
	// true, and bounded to terms that ended within the last 90 days — connecting
	// an account with years of dead reservations produces one pass of recent
	// news, not an archive.
	CommitmentExpiryAlertOnExpired bool `json:"commitmentExpiryAlertOnExpired"`
	// CommitmentIdleEnabled: Whether under-used commitments raise alerts.
	// Defaults to true.
	CommitmentIdleEnabled bool `json:"commitmentIdleEnabled"`
	// CommitmentIdleThresholdPercent: Utilization percent the whole window must
	// stay under. Defaults to 70 — roughly where a 1-year no-upfront commitment
	// stops beating on-demand for the usage it covers.
	CommitmentIdleThresholdPercent int64 `json:"commitmentIdleThresholdPercent"`
	// CommitmentIdleWindowDays: Trailing days utilization is aggregated over.
	// Defaults to 30. Aggregated, never sampled per day: a weekday-only workload
	// reads about 71% over a month and does not fire, which is the point.
	CommitmentIdleWindowDays int64 `json:"commitmentIdleWindowDays"`
	// CommitmentIdleMinMeasuredDays: Window days that must carry cost data
	// before anything is judged. Defaults to 14. A commitment whose utilization
	// cannot be measured at all — a unit-denominated GCP CUD, or an account
	// whose plugin reports no commitment attribution — never alerts, regardless
	// of this value.
	CommitmentIdleMinMeasuredDays int64 `json:"commitmentIdleMinMeasuredDays"`
	// CommitmentIdleMinWasteCents: Least wasted money (obligation − delivered)
	// before alerting, in USD cents, restated per currency. Defaults to 5000
	// ($50).
	CommitmentIdleMinWasteCents int64 `json:"commitmentIdleMinWasteCents"`
	// UnitCostRegressionEnabled: Whether rising cost per business-metric unit
	// raises alerts. Defaults to true.
	UnitCostRegressionEnabled bool `json:"unitCostRegressionEnabled"`
	// UnitCostThresholdPercent: Percent the unit cost must rise versus the prior
	// window. Defaults to 20.
	UnitCostThresholdPercent int64 `json:"unitCostThresholdPercent"`
	// UnitCostWindowDays: Length of each of the two compared windows. Defaults
	// to 14 — two whole weekly cycles a side, so a weekday-shaped unit cost
	// compares like with like.
	UnitCostWindowDays int64 `json:"unitCostWindowDays"`
	// UnitCostMinReportedDays: Days inside **each** window that must carry a
	// reported, positive metric value. Defaults to 10. A day with no reported
	// value is a gap and contributes to neither the numerator nor the
	// denominator; a window that fails this bar produces no comparison at all
	// rather than a comparison against a gap.
	UnitCostMinReportedDays int64 `json:"unitCostMinReportedDays"`
	// UnitCostMinSpendCents: Least spend in the current window before alerting,
	// in USD cents, restated per currency. Defaults to 10000 ($100).
	UnitCostMinSpendCents int64 `json:"unitCostMinSpendCents"`
}

CostEfficiencySettings is the `CostEfficiencySettings` schema.

type CostEstimate added in v0.43.0

type CostEstimate struct {
	MonthlyAmount float64                `json:"monthlyAmount"`
	Currency      string                 `json:"currency"`
	LineItems     []CostEstimateLineItem `json:"lineItems"`
	Partial       *bool                  `json:"partial,omitempty"`
	Notes         []string               `json:"notes,omitempty"`
}

CostEstimate is the `CostEstimate` schema.

The API may send null in its place.

type CostEstimateLineItem added in v0.43.0

type CostEstimateLineItem struct {
	Label         string   `json:"label"`
	MonthlyAmount float64  `json:"monthlyAmount"`
	Detail        *string  `json:"detail,omitempty"`
	Quantity      *float64 `json:"quantity,omitempty"`
	Unit          *string  `json:"unit,omitempty"`
}

CostEstimateLineItem is the `CostEstimateLineItem` schema.

type CostEstimateRequest added in v0.43.0

type CostEstimateRequest struct {
	AccountID        string            `json:"accountId"`
	ResourceTypeID   string            `json:"resourceTypeId"`
	Fields           map[string]string `json:"fields,omitempty"`
	ResourceID       *ResourceID       `json:"resourceId,omitempty"`
	PluginID         *string           `json:"pluginId,omitempty"`
	ParentResourceID *ResourceID       `json:"parentResourceId,omitempty"`
}

CostEstimateRequest is the `CostEstimateRequest` schema.

type CostExport added in v1.6.0

type CostExport struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// Format: One of "csv", "ndjson".
	Format string          `json:"format"`
	Query  CostExportQuery `json:"query"`
	// Cadence: One of "daily", "weekly", "monthly".
	Cadence         string                `json:"cadence"`
	Hour            int64                 `json:"hour"`
	Timezone        string                `json:"timezone"`
	RestatementDays int64                 `json:"restatementDays"`
	Enabled         bool                  `json:"enabled"`
	Destination     CostExportDestination `json:"destination"`
	HasCredentials  bool                  `json:"hasCredentials"`
	// CredentialHint: Redacted marker, e.g. `AKIA…7F2Q`. No route ever returns
	// the credential itself.
	CredentialHint *string `json:"credentialHint"`
	LastRunAt      *string `json:"lastRunAt"`
	// LastStatus: One of "pending", "succeeded", "failed".
	LastStatus string `json:"lastStatus"`
	// LastError: Why the last run failed, verbatim from the destination where
	// possible.
	LastError       *string `json:"lastError"`
	LastObjectCount *int64  `json:"lastObjectCount"`
	LastRowCount    *int64  `json:"lastRowCount"`
	NextRunAt       *string `json:"nextRunAt"`
	CreatedByUserID *string `json:"createdByUserId"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
}

CostExport is the `CostExport` schema.

type CostExportDestination added in v1.6.0

type CostExportDestination = any

CostExportDestination is the `CostExportDestination` schema.

type CostExportFilter added in v1.6.0

type CostExportFilter struct {
	// Dimension: One of "provider", "account", "service", "region", "resource",
	// "tag", "charge_type", "commitment".
	Dimension string `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

CostExportFilter is the `CostExportFilter` schema.

type CostExportInput added in v1.6.0

type CostExportInput struct {
	Name string `json:"name"`
	// Format: One of "csv", "ndjson".
	Format string          `json:"format"`
	Query  CostExportQuery `json:"query"`
	// Cadence: How often a run happens and — because a run writes one object per
	// period — what a period is: a calendar day, an ISO week (Monday-start), or
	// a calendar month.
	//
	// One of "daily", "weekly", "monthly".
	Cadence string `json:"cadence"`
	// Hour: Local hour in `timezone` a run fires at.
	Hour int64 `json:"hour"`
	// Timezone: IANA zone, e.g. `Europe/Berlin`. Validated against `Intl`.
	Timezone string `json:"timezone"`
	// RestatementDays: Trailing days of already-written periods each run
	// re-exports. Providers restate spend for days after the fact, so the object
	// written for yesterday is not final; every period overlapping this window
	// is rebuilt in full at its existing key, which overwrites rather than
	// duplicates. 0 disables it and is only correct for an org whose providers
	// never revise.
	RestatementDays int64                 `json:"restatementDays"`
	Enabled         bool                  `json:"enabled"`
	Destination     CostExportDestination `json:"destination"`
	// AccessKeyID: S3 only. Write-only; omit on update to keep the stored
	// credential.
	AccessKeyID *string `json:"accessKeyId,omitempty"`
	// SecretAccessKey: S3 only. Write-only, never returned.
	SecretAccessKey *string `json:"secretAccessKey,omitempty"`
	// URL: HTTPS destinations only. Write-only, never returned — a signed URL
	// carries its own signature, so it is treated as a bearer credential.
	URL *string `json:"url,omitempty"`
}

CostExportInput is the `CostExportInput` schema.

type CostExportObject added in v1.6.0

type CostExportObject struct {
	// PeriodStart: The period's first day, in the export's own timezone.
	PeriodStart string `json:"periodStart"`
	From        string `json:"from"`
	To          string `json:"to"`
	// Key: `{prefix}/cost-export/{exportId}/{cadence}/{periodStart}.{format}`.
	// Deterministic, so re-exporting a restated period overwrites this object
	// instead of adding a second copy.
	Key       string `json:"key"`
	RowCount  int64  `json:"rowCount"`
	ByteCount int64  `json:"byteCount"`
}

CostExportObject is the `CostExportObject` schema.

type CostExportQuery added in v1.6.0

type CostExportQuery struct {
	Version float64 `json:"version"`
	// Dimensions: Row-identity columns kept in the output. Dropping one
	// aggregates over it — an export grouped to provider + service is orders of
	// magnitude smaller than a per-resource one.
	Dimensions []string `json:"dimensions"`
	// TagKeys: Tag keys emitted as their own `tag_<key>` columns.
	TagKeys     []string           `json:"tagKeys"`
	Filters     []CostExportFilter `json:"filters"`
	ChargeTypes []string           `json:"chargeTypes,omitempty"`
	// CostBasis: One of "cash", "amortized".
	CostBasis *string `json:"costBasis,omitempty"`
}

CostExportQuery: The rows a run selects. Reuses the same `CostFilter` and dimension vocabulary the dashboards, budgets and cost reports store, so a filter means the same thing everywhere.

type CostExportRunResult added in v1.6.0

type CostExportRunResult struct {
	ExportID string `json:"exportId"`
	// Status: One of "pending", "succeeded", "failed".
	Status   string             `json:"status"`
	Objects  []CostExportObject `json:"objects"`
	RowCount int64              `json:"rowCount"`
	// CollectionWatermark: The newest day every cost-reporting account in the
	// org had data for when the run started. Stamped into every row as
	// `collection_watermark`; rows dated after it are still arriving.
	CollectionWatermark *string `json:"collectionWatermark"`
	Error               *string `json:"error"`
}

CostExportRunResult is the `CostExportRunResult` schema.

type CostExportsCreateParams added in v1.6.0

type CostExportsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostExportInput
}

CostExportsCreateParams holds the parameters for `client.costExports.create`.

type CostExportsDeleteParams added in v1.6.0

type CostExportsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostExportsDeleteParams holds the parameters for `client.costExports.delete`.

type CostExportsGetParams added in v1.6.0

type CostExportsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostExportsGetParams holds the parameters for `client.costExports.get`.

type CostExportsListParams added in v1.6.0

type CostExportsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostExportsListParams holds the parameters for `client.costExports.list`.

Every field is optional; pass nil to take the defaults.

type CostExportsNamespace added in v1.6.0

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

CostExportsNamespace is `client.costExports`.

func (*CostExportsNamespace) Create added in v1.6.0

Create: Create a cost export

Credentials are required on create. They are encrypted at rest and no route ever returns them; responses carry a redacted `credentialHint` instead.

_Requires permission: `org:settings:write`._

POST /api/org/{orgId}/cost-exports

Raises on 400: Bad request

func (*CostExportsNamespace) Delete added in v1.6.0

Delete: Delete a cost export

Soft delete. Objects already written to the destination are left alone.

_Requires permission: `org:settings:write`._

DELETE /api/org/{orgId}/cost-exports/{id}

Raises on 404: Not found

func (*CostExportsNamespace) Get added in v1.6.0

Get: Get a cost export

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-exports/{id}

Raises on 404: Not found

func (*CostExportsNamespace) List added in v1.6.0

List: List scheduled cost exports

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-exports

func (*CostExportsNamespace) Run added in v1.6.0

Run: Run a cost export now

Runs the export immediately against the same code path the poller uses, writing every period in the restatement window. Answers 200 with `status: "failed"` and a message rather than an error status when the destination rejects the write — the caller wants the reason, and the same failure is recorded on the export.

_Requires permission: `org:settings:write`._

POST /api/org/{orgId}/cost-exports/{id}/run

Raises on 404: Not found

func (*CostExportsNamespace) Update added in v1.6.0

Update: Update a cost export

Replaces everything but the credential. Omit `accessKeyId`/`secretAccessKey`/`url` to keep the stored credential; changing the destination type requires supplying a new one. Saving reschedules the export from now.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/cost-exports/{id}

Raises on 400: Bad request

Raises on 404: Not found

type CostExportsRunParams added in v1.6.0

type CostExportsRunParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostExportsRunParams holds the parameters for `client.costExports.run`.

type CostExportsUpdateParams added in v1.6.0

type CostExportsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body CostExportInput
}

CostExportsUpdateParams holds the parameters for `client.costExports.update`.

type CostFilter

type CostFilter struct {
	Dimension CostDimension `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

CostFilter is the `CostFilter` schema.

type CostGraphConfig added in v1.6.0

type CostGraphConfig struct {
	Version float64 `json:"version"`
	// ChartType: One of "stacked_bar", "multi_bar", "line", "area", "pie".
	ChartType string `json:"chartType"`
	// Binning: One of "daily", "weekly", "monthly", "cumulative".
	Binning   string        `json:"binning"`
	DateRange CostDateRange `json:"dateRange"`
	// GroupBy: One of "none", "provider", "account", "service", "region",
	// "resource", "tag", "charge_type", "commitment".
	GroupBy       string             `json:"groupBy"`
	GroupByTagKey *string            `json:"groupByTagKey,omitempty"`
	Filters       []CostReportFilter `json:"filters,omitempty"`
	// SavedFilterID: A saved cost filter (see /saved-cost-filters) applied by
	// reference and AND-composed with `filters` at query time, server-side.
	// Editing the saved filter changes every graph, report and budget
	// referencing it; a reference that fails to resolve makes the query error
	// rather than silently run unfiltered.
	SavedFilterID         *string `json:"savedFilterId,omitempty"`
	TopN                  *int64  `json:"topN,omitempty"`
	ComparePreviousPeriod *bool   `json:"comparePreviousPeriod,omitempty"`
	ShowForecast          *bool   `json:"showForecast,omitempty"`
	// ScenarioModelID: A scenario model (see /cost-scenarios) overlaid on the
	// forecast — known future cost the trend cannot see, drawn as a second
	// dashed line beside the trend rather than instead of it. Only meaningful
	// alongside `showForecast`.
	ScenarioModelID *string `json:"scenarioModelId,omitempty"`
	// CostBasis: One of "cash", "amortized".
	CostBasis *string `json:"costBasis,omitempty"`
}

CostGraphConfig: The saved graph. Identical to the config an ad-hoc `cost_graph` dashboard widget stores inline — a report is that config given a name and an id.

type CostPushRequest added in v0.6.0

type CostPushRequest struct {
	// Source: Stable slug naming the system that owns these rows: letters,
	// digits, `.`, `_` and `-`. It groups the rows under an `External` provider
	// and an `external:<source>` account, and re-pushing the same source over
	// the same days restates only its own rows.
	Source string          `json:"source"`
	Rows   []PushedCostRow `json:"rows"`
}

CostPushRequest is the `CostPushRequest` schema.

type CostPushResponse added in v0.6.0

type CostPushResponse struct {
	Written int64 `json:"written"`
}

CostPushResponse is the `CostPushResponse` schema.

type CostQueryRequest

type CostQueryRequest struct {
	From string `json:"from"`
	To   string `json:"to"`
	// Binning: One of "daily", "weekly", "monthly", "cumulative".
	Binning string `json:"binning"`
	// GroupBy: One of "none", "provider", "account", "service", "region",
	// "resource", "tag", "charge_type", "commitment".
	GroupBy       string       `json:"groupBy"`
	GroupByTagKey *string      `json:"groupByTagKey,omitempty"`
	Filters       []CostFilter `json:"filters,omitempty"`
	// Query: The same filter written as text, in the cost query language — an
	// alternative to `filters`, compiled server-side into exactly that
	// structure.
	//
	// Grammar: a conjunction of equality terms joined by `AND`. A term is
	// `dimension = 'value'`, `dimension != 'value'`, `dimension IN ('a','b')` or
	// `dimension NOT IN ('a','b')`; the tag dimension takes its key in brackets,
	// `tag['owner'] = 'platform'`. Keywords are case-insensitive, strings may be
	// single- or double-quoted, and a quote inside a value is escaped by
	// doubling it (`'it”s'`) or with a backslash (`'it\'s'`).
	//
	// `OR` is deliberately not supported: the stored filter is a conjunction, so
	// several values of one dimension go in an `IN` list and unrelated
	// alternatives need separate queries. Anything the structured filter cannot
	// express is a parse error rather than a second execution path.
	//
	// Sending both `query` and a non-empty `filters` is a 400, not a precedence
	// rule. A parse failure is a 400 whose body carries `queryError` with the
	// character `offset`, the `length` of the offending span, and the `expected`
	// alternatives there.
	Query *string `json:"query,omitempty"`
	// SavedFilterID: A saved cost filter (see /saved-cost-filters) applied by
	// reference. Resolved server-side at query time and AND-composed with
	// whichever of `filters`/`query` is present — unlike those two it is a
	// composition, not an alternative. An id that does not resolve to a live
	// filter is a 400; the query is never silently run unfiltered.
	SavedFilterID         *string `json:"savedFilterId,omitempty"`
	TopN                  *int64  `json:"topN,omitempty"`
	ComparePreviousPeriod *bool   `json:"comparePreviousPeriod,omitempty"`
	Forecast              *bool   `json:"forecast,omitempty"`
	// ScenarioModelID: Apply a scenario model (see /cost-scenarios) to the
	// projection: known future cost the trend cannot see. Requires `forecast:
	// true` — sending it without one is a 400, not a no-op, because a caller who
	// asked for assumptions and silently got none back is the failure this
	// feature exists to prevent. The adjusted projection comes back as
	// `scenario`, **alongside** the untouched `forecast`, never instead of it.
	// An id that does not resolve is a 400.
	ScenarioModelID *string    `json:"scenarioModelId,omitempty"`
	CostBasis       *CostBasis `json:"costBasis,omitempty"`
	// ChargeTypes: Restrict to these kinds of charge. Omitted is all of them,
	// which is what makes an unfiltered total net rather than gross — credits,
	// refunds and commitment discounts are included. Rows collected before
	// charge types existed, and rows from providers that cannot distinguish
	// them, are `usage`.
	ChargeTypes []CostChargeType `json:"chargeTypes,omitempty"`
	// Adjusted: Apply the organization's billing rules (see /billing-rules) —
	// markups, discounts, reallocations. Omitted (the default, and what every
	// unattended reader sends) is raw collected spend. Present, the response
	// carries `adjustment` with the collected totals beside the adjusted ones
	// and the rules that moved them; it is set even for an organization with no
	// rules, because the absence of that field is the only signal that a figure
	// is unadjusted.
	Adjusted *bool `json:"adjusted,omitempty"`
}

CostQueryRequest is the `CostQueryRequest` schema.

type CostQueryResponse

type CostQueryResponse struct {
	Series     []CostQuerySeries `json:"series"`
	Comparison []CostQuerySeries `json:"comparison,omitempty"`
	// Forecast: The **unadjusted trend** projection. Stays the trend even when a
	// scenario is applied, so a reader can always see what the fit said before
	// anybody's assumptions touched it.
	Forecast   []CostSeriesPoint   `json:"forecast,omitempty"`
	Scenario   *CostScenarioResult `json:"scenario,omitempty"`
	Currencies []string            `json:"currencies"`
	// Totals: Period total per currency, and always exactly the sum of `series`.
	// Fixed-amount billing-rule charges are deliberately **not** folded in here
	// — they have no series behind them and are reported in
	// `adjustment.fixedTotals` instead.
	Totals         map[string]float64     `json:"totals"`
	PreviousTotals map[string]float64     `json:"previousTotals,omitempty"`
	Adjustment     *CostAdjustmentSummary `json:"adjustment,omitempty"`
}

CostQueryResponse is the `CostQueryResponse` schema.

type CostQuerySeries

type CostQuerySeries struct {
	Key      string            `json:"key"`
	Label    string            `json:"label"`
	Currency string            `json:"currency"`
	Points   []CostSeriesPoint `json:"points"`
}

CostQuerySeries is the `CostQuerySeries` schema.

type CostReport added in v1.6.0

type CostReport struct {
	ID          string          `json:"id"`
	Name        string          `json:"name"`
	Description *string         `json:"description"`
	Config      CostGraphConfig `json:"config"`
	// FolderID: Folder the report is filed under (see /cost-report-folders);
	// null is the top level of the Reports list. Moving a report is this same
	// PUT with a different folderId; an id from another org is a 400. Deleting a
	// folder never deletes its reports — they fall back to the top level.
	FolderID        *string `json:"folderId"`
	CreatedByUserID *string `json:"createdByUserId"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
	// Placements: The dashboards carrying a `cost_report` card for this report.
	// Empty is normal — a report exists, and can be run, whether or not any
	// dashboard shows it. Deleting the report removes these cards; removing a
	// card leaves the report alone.
	Placements []CostReportPlacement `json:"placements"`
}

CostReport is the `CostReport` schema.

type CostReportFilter added in v1.6.0

type CostReportFilter struct {
	// Dimension: One of "provider", "account", "service", "region", "resource",
	// "tag", "charge_type", "commitment".
	Dimension string `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

CostReportFilter is the `CostReportFilter` schema.

type CostReportFolder added in v1.6.0

type CostReportFolder struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// ParentFolderID: Parent folder for nesting; null is a top-level folder.
	// Nesting is capped at 3 levels, and moving a folder inside itself or one of
	// its own subfolders is rejected — both are 400s.
	ParentFolderID *string `json:"parentFolderId"`
	CreatedAt      string  `json:"createdAt"`
	UpdatedAt      string  `json:"updatedAt"`
}

CostReportFolder is the `CostReportFolder` schema.

type CostReportFolderInput added in v1.6.0

type CostReportFolderInput struct {
	Name string `json:"name"`
	// ParentFolderID: Parent folder for nesting; null is a top-level folder.
	// Nesting is capped at 3 levels, and moving a folder inside itself or one of
	// its own subfolders is rejected — both are 400s.
	ParentFolderID *string `json:"parentFolderId,omitempty"`
}

CostReportFolderInput is the `CostReportFolderInput` schema.

type CostReportFoldersCreateParams added in v1.6.0

type CostReportFoldersCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostReportFolderInput
}

CostReportFoldersCreateParams holds the parameters for `client.costReportFolders.create`.

type CostReportFoldersDeleteParams added in v1.6.0

type CostReportFoldersDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostReportFoldersDeleteParams holds the parameters for `client.costReportFolders.delete`.

type CostReportFoldersListParams added in v1.6.0

type CostReportFoldersListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostReportFoldersListParams holds the parameters for `client.costReportFolders.list`.

Every field is optional; pass nil to take the defaults.

type CostReportFoldersNamespace added in v1.6.0

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

CostReportFoldersNamespace is `client.costReportFolders`.

func (*CostReportFoldersNamespace) Create added in v1.6.0

Create: Create a cost-report folder

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-report-folders

Raises on 400: Bad request

func (*CostReportFoldersNamespace) Delete added in v1.6.0

Delete: Delete a cost-report folder

Never blocked by contents and never destructive to them: the folder's reports and immediate subfolders fall back to the top level. Deleting a folder cannot delete a report.

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/cost-report-folders/{id}

Raises on 404: Not found

func (*CostReportFoldersNamespace) List added in v1.6.0

List: List cost-report folders

The org's report folders as a flat list — build the tree from `parentFolderId`. Folders organize the Reports list and nothing else; a report's id, URL and dashboard cards are unchanged by where it is filed.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-report-folders

func (*CostReportFoldersNamespace) Update added in v1.6.0

Update: Update a cost-report folder

Rename and/or reparent. Filing a *report* is not here — that is `PUT /cost-reports/{id}` with a different `folderId`. Reparenting past the 3-level depth limit, or under the folder's own subtree, is a 400.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/cost-report-folders/{id}

Raises on 400: Bad request

Raises on 404: Not found

type CostReportFoldersUpdateParams added in v1.6.0

type CostReportFoldersUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body CostReportFolderInput
}

CostReportFoldersUpdateParams holds the parameters for `client.costReportFolders.update`.

type CostReportInput added in v1.6.0

type CostReportInput struct {
	Name        string          `json:"name"`
	Description *string         `json:"description,omitempty"`
	Config      CostGraphConfig `json:"config"`
	// FolderID: Folder the report is filed under (see /cost-report-folders);
	// null is the top level of the Reports list. Moving a report is this same
	// PUT with a different folderId; an id from another org is a 400. Deleting a
	// folder never deletes its reports — they fall back to the top level.
	FolderID *string `json:"folderId,omitempty"`
}

CostReportInput is the `CostReportInput` schema.

type CostReportNotificationsListParams added in v1.6.0

type CostReportNotificationsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostReportNotificationsListParams holds the parameters for `client.costReportNotifications.list`.

Every field is optional; pass nil to take the defaults.

type CostReportNotificationsNamespace added in v1.6.0

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

CostReportNotificationsNamespace is `client.costReportNotifications`.

func (*CostReportNotificationsNamespace) List added in v1.6.0

List: List every delivery schedule in the organization

All reports' schedules in one call — what the CLI's schedules column reads. Schedules of deleted reports are excluded.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-report-notifications

type CostReportPlacement added in v1.6.0

type CostReportPlacement struct {
	WidgetID      string `json:"widgetId"`
	DashboardID   string `json:"dashboardId"`
	DashboardName string `json:"dashboardName"`
}

CostReportPlacement is the `CostReportPlacement` schema.

type CostReportRunResult added in v1.6.0

type CostReportRunResult struct {
	ReportID string            `json:"reportId"`
	Name     string            `json:"name"`
	From     string            `json:"from"`
	To       string            `json:"to"`
	Result   CostQueryResponse `json:"result"`
}

CostReportRunResult is the `CostReportRunResult` schema.

type CostReportsCreateParams added in v1.6.0

type CostReportsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostReportInput
}

CostReportsCreateParams holds the parameters for `client.costReports.create`.

type CostReportsDeleteParams added in v1.6.0

type CostReportsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostReportsDeleteParams holds the parameters for `client.costReports.delete`.

type CostReportsGetParams added in v1.6.0

type CostReportsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostReportsGetParams holds the parameters for `client.costReports.get`.

type CostReportsListParams added in v1.6.0

type CostReportsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostReportsListParams holds the parameters for `client.costReports.list`.

Every field is optional; pass nil to take the defaults.

type CostReportsNamespace added in v1.6.0

type CostReportsNamespace struct {

	// Notifications: `client.costReports.notifications`.
	Notifications *CostReportsNotificationsNamespace
	// contains filtered or unexported fields
}

CostReportsNamespace is `client.costReports`.

func (*CostReportsNamespace) Create added in v1.6.0

Create: Create a cost report

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-reports

Raises on 400: Bad request

func (*CostReportsNamespace) Delete added in v1.6.0

Delete: Delete a cost report

Soft delete. Every dashboard card pointing at the report is removed with it — a card whose report is gone could only ever render as an unavailable tile.

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/cost-reports/{id}

Raises on 404: Not found

func (*CostReportsNamespace) Get added in v1.6.0

Get: Get a cost report

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-reports/{id}

Raises on 404: Not found

func (*CostReportsNamespace) List added in v1.6.0

List: List saved cost reports

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-reports

func (*CostReportsNamespace) Run added in v1.6.0

Run: Run a cost report

Executes the report's saved config and returns the series, along with the inclusive window a relative preset resolved to. Takes no body: the report *is* the query, so a caller never has to reassemble its config to get the numbers.

_Requires permission: `costs:read`._

POST /api/org/{orgId}/cost-reports/{id}/run

Raises on 400: Bad request

Raises on 404: Not found

func (*CostReportsNamespace) Update added in v1.6.0

Update: Update a cost report

Replaces the report's name, description, config and folder. Every dashboard showing the report picks up the new config — that is what referencing a report by id buys.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/cost-reports/{id}

Raises on 400: Bad request

Raises on 404: Not found

type CostReportsNotificationsCreateParams added in v1.6.0

type CostReportsNotificationsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body ReportNotificationInput
}

CostReportsNotificationsCreateParams holds the parameters for `client.costReports.notifications.create`.

type CostReportsNotificationsDeleteParams added in v1.6.0

type CostReportsNotificationsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID          *string
	ID             string
	NotificationID string
}

CostReportsNotificationsDeleteParams holds the parameters for `client.costReports.notifications.delete`.

type CostReportsNotificationsListParams added in v1.6.0

type CostReportsNotificationsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostReportsNotificationsListParams holds the parameters for `client.costReports.notifications.list`.

type CostReportsNotificationsNamespace added in v1.6.0

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

CostReportsNotificationsNamespace is `client.costReports.notifications`.

func (*CostReportsNotificationsNamespace) Create added in v1.6.0

Create: Create a delivery schedule

On its cadence the server runs the report and sends a composed text summary — period total (converted to the org's display currency where configured, with the conversion caveat), change vs the previous period, top groups, and a deep link. No chart images. An empty result still sends, saying so.

_Requires permission: `org:settings:write`._

POST /api/org/{orgId}/cost-reports/{id}/notifications

Raises on 400: Bad request

Raises on 404: Not found

func (*CostReportsNotificationsNamespace) Delete added in v1.6.0

Delete: Delete a delivery schedule

_Requires permission: `org:settings:write`._

DELETE /api/org/{orgId}/cost-reports/{id}/notifications/{notificationId}

Raises on 404: Not found

func (*CostReportsNotificationsNamespace) List added in v1.6.0

List: List a report's delivery schedules

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-reports/{id}/notifications

Raises on 404: Not found

func (*CostReportsNotificationsNamespace) Send added in v1.6.0

Send: Send a schedule's report now

Runs the report and delivers it to this schedule's destinations immediately, ignoring the schedule and its enabled flag. Fails with a 400 naming the reason when nothing could be delivered. A successful manual send clears a parked failure — it is the documented recovery for a partial delivery.

_Requires permission: `org:settings:write`._

POST /api/org/{orgId}/cost-reports/{id}/notifications/{notificationId}/send

Raises on 400: Bad request

Raises on 404: Not found

func (*CostReportsNotificationsNamespace) Targets added in v1.6.0

Targets: List the destinations a schedule can deliver to

The org's live Slack channels and Teams webhooks, and whether this deployment can send mail. Destinations are picked from here — a schedule can only point at surfaces the org already connected.

_Requires permission: `org:settings:write`._

GET /api/org/{orgId}/cost-reports/{id}/notifications/targets

func (*CostReportsNotificationsNamespace) Update added in v1.6.0

Update: Update a delivery schedule

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/cost-reports/{id}/notifications/{notificationId}

Raises on 400: Bad request

Raises on 404: Not found

type CostReportsNotificationsSendParams added in v1.6.0

type CostReportsNotificationsSendParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID          *string
	ID             string
	NotificationID string
}

CostReportsNotificationsSendParams holds the parameters for `client.costReports.notifications.send`.

type CostReportsNotificationsTargetsParams added in v1.6.0

type CostReportsNotificationsTargetsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostReportsNotificationsTargetsParams holds the parameters for `client.costReports.notifications.targets`.

type CostReportsNotificationsUpdateParams added in v1.6.0

type CostReportsNotificationsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID          *string
	ID             string
	NotificationID string
	// Body: the JSON request body.
	Body ReportNotificationInput
}

CostReportsNotificationsUpdateParams holds the parameters for `client.costReports.notifications.update`.

type CostReportsRunParams added in v1.6.0

type CostReportsRunParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostReportsRunParams holds the parameters for `client.costReports.run`.

type CostReportsUpdateParams added in v1.6.0

type CostReportsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body CostReportInput
}

CostReportsUpdateParams holds the parameters for `client.costReports.update`.

type CostScenarioAdjustment added in v1.9.0

type CostScenarioAdjustment struct {
	// ID: Stable within the model; also the key of its per-adjustment total.
	ID string `json:"id"`
	// Label: What this adjustment is. Named on the chart whenever the scenario
	// moves a number.
	Label string `json:"label"`
	// Kind: `one_off` is a single amount on a single day; `recurring` is an
	// amount every period from a date; `rate_change` is ±X% of the trend from a
	// date. The split between an amount and a percentage of the trend is what
	// fixes the composition order — see the `scenario` field on the cost query
	// response.
	//
	// One of "one_off", "recurring", "rate_change".
	Kind      string `json:"kind"`
	StartDate string `json:"startDate"`
	// EndDate: Inclusive last day, or null for indefinitely. Refused for
	// `one_off`, which is one day.
	EndDate *string `json:"endDate"`
	// AmountCents: Minor units of the model's currency, for the amount kinds;
	// null for `rate_change`. May be negative — turning off an old cluster is as
	// real a known future cost as buying a new one.
	AmountCents *int64 `json:"amountCents"`
	// Currency: Always the model's own currency; a model that held two would sum
	// two kinds of money.
	Currency *string `json:"currency"`
	// Period: How often a `recurring` amount charges. A monthly amount is spread
	// evenly across each calendar month it covers rather than landing as a spike
	// on the 1st, so a month the scenario only partly covers costs
	// proportionally less.
	//
	// One of "daily", "monthly".
	Period *string `json:"period"`
	// Percent: Percent change to the trend, for `rate_change`. -20 is a fifth
	// cheaper.
	Percent *float64 `json:"percent"`
	// Scope: Which spend this adjustment describes; empty is the whole
	// organization. For a rate change the scope is what the percentage is *of*.
	// For an amount it decides whether the adjustment applies to a given chart
	// at all — a GCP commitment does not belong on a chart filtered to AWS, and
	// one that is excluded is named in `scenario.outOfScope`.
	Scope []CostScenarioScopeTerm `json:"scope"`
}

CostScenarioAdjustment is the `CostScenarioAdjustment` schema.

type CostScenarioModel added in v1.9.0

type CostScenarioModel struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	// Currency: The one currency every amount in this model is denominated in.
	Currency        string                   `json:"currency"`
	Adjustments     []CostScenarioAdjustment `json:"adjustments"`
	CreatedByUserID *string                  `json:"createdByUserId"`
	CreatedAt       string                   `json:"createdAt"`
	UpdatedAt       string                   `json:"updatedAt"`
}

CostScenarioModel is the `CostScenarioModel` schema.

type CostScenarioModelInput added in v1.9.0

type CostScenarioModelInput struct {
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	// Currency: Three-letter code. Every amount in the model must be in it — a
	// model that mixed two would produce a projection that is the sum of two
	// kinds of money, so this is refused rather than converted behind the
	// caller's back.
	Currency    string                   `json:"currency"`
	Adjustments []CostScenarioAdjustment `json:"adjustments"`
}

CostScenarioModelInput is the `CostScenarioModelInput` schema.

type CostScenarioReferent added in v1.9.0

type CostScenarioReferent struct {
	// Kind: One of "budget", "cost_report", "cost_graph_widget".
	Kind string `json:"kind"`
	// ID: Budget id, report id, or dashboard-widget id.
	ID   string `json:"id"`
	Name string `json:"name"`
	// DashboardID: Set for `cost_graph_widget` referents.
	DashboardID   *string `json:"dashboardId,omitempty"`
	DashboardName *string `json:"dashboardName,omitempty"`
}

CostScenarioReferent is the `CostScenarioReferent` schema.

type CostScenarioResult added in v1.9.0

type CostScenarioResult struct {
	ModelID   string `json:"modelId"`
	ModelName string `json:"modelName"`
	Currency  string `json:"currency"`
	// Points: The adjusted projection — exactly the same days as `forecast`,
	// never one more or fewer. A scenario modifies the projected region; it does
	// not extend it, and it can never touch a day that already has recorded
	// spend behind it.
	Points []CostSeriesPoint `json:"points"`
	// Contributions: Signed total each adjustment added across the horizon, in
	// model order.
	Contributions []CostScenarioResultContributions `json:"contributions"`
	// TotalDelta: Signed difference from the baseline across the horizon.
	TotalDelta float64 `json:"totalDelta"`
	// ConvertedFrom: Set when the model's amounts were converted at the org's
	// stated rates.
	ConvertedFrom *string `json:"convertedFrom,omitempty"`
	// OutOfScope: Adjustments this chart's own filters exclude, by label — a GCP
	// commitment on an AWS-filtered chart is correctly left out, and saying so
	// is what makes the number trustworthy rather than quietly assumed broken.
	OutOfScope []string `json:"outOfScope"`
}

CostScenarioResult is the `CostScenarioResult` schema.

type CostScenarioResultContributions added in v1.9.0

type CostScenarioResultContributions struct {
	AdjustmentID string `json:"adjustmentId"`
	Label        string `json:"label"`
	// Kind: One of "one_off", "recurring", "rate_change".
	Kind   string  `json:"kind"`
	Amount float64 `json:"amount"`
}

CostScenarioResultContributions is an object the spec declares inline.

type CostScenarioScopeTerm added in v1.9.0

type CostScenarioScopeTerm struct {
	// Dimension: One of "provider", "account", "service", "region", "resource",
	// "tag", "charge_type", "commitment".
	Dimension string `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

CostScenarioScopeTerm is the `CostScenarioScopeTerm` schema.

type CostScenariosCreateParams added in v1.9.0

type CostScenariosCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostScenarioModelInput
}

CostScenariosCreateParams holds the parameters for `client.costScenarios.create`.

type CostScenariosDeleteParams added in v1.9.0

type CostScenariosDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostScenariosDeleteParams holds the parameters for `client.costScenarios.delete`.

type CostScenariosGetGetOrgOrgIDCostScenariosIDParams added in v1.9.0

type CostScenariosGetGetOrgOrgIDCostScenariosIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostScenariosGetGetOrgOrgIDCostScenariosIDParams holds the parameters for `client.costScenarios.get.getOrgOrgIdCostScenariosId`.

type CostScenariosGetGetParams added in v1.9.0

type CostScenariosGetGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostScenariosGetGetParams holds the parameters for `client.costScenarios.get.get`.

Every field is optional; pass nil to take the defaults.

type CostScenariosGetGetResponse added in v1.9.0

type CostScenariosGetGetResponse struct {
	Models []CostScenarioModel `json:"models"`
}

CostScenariosGetGetResponse is an object the spec declares inline.

type CostScenariosGetNamespace added in v1.9.0

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

CostScenariosGetNamespace is `client.costScenarios.get`.

func (*CostScenariosGetNamespace) Get added in v1.9.0

Get: List scenario models

Named, reusable sets of adjustments an organization overlays on a cost forecast — the **known future cost a trend fit cannot see**. Pass an id as `POST /costs/query`'s `scenarioModelId` (alongside `forecast: true`) to get the adjusted projection back *beside* the unadjusted one, never instead of it.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-scenarios

func (*CostScenariosGetNamespace) GetOrgOrgIDCostScenariosID added in v1.9.0

GetOrgOrgIDCostScenariosID: Get a scenario model

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-scenarios/{id}

Raises on 404: Not found

type CostScenariosNamespace added in v1.9.0

type CostScenariosNamespace struct {

	// Get: `client.costScenarios.get`.
	Get *CostScenariosGetNamespace
	// contains filtered or unexported fields
}

CostScenariosNamespace is `client.costScenarios`.

func (*CostScenariosNamespace) Create added in v1.9.0

Create: Create a scenario model

Names must be unique per organization (case-insensitively) — the name is what a chart prints under its scenario line and what the CLI's `--scenario <name>` addresses, so two models sharing one would make both meaningless. A model needs at least one adjustment: an empty model changes nothing, which is the same as applying no scenario.

_Requires permission: `costs:write`._

POST /api/org/{orgId}/cost-scenarios

Raises on 400: Bad request

Raises on 409: A live scenario model already uses this name.

func (*CostScenariosNamespace) Delete added in v1.9.0

Delete: Delete a scenario model

Soft delete — **refused with a 409 while anything references the model**, with the referents in the body. For a chart, deleting would silently drop the assumptions from a projection somebody is reading; for a budget it would move the forecast thresholds back to the bare trend, changing when people get paged. Detaching the referents is a deliberate step, never a side effect of deletion.

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/cost-scenarios/{id}

Raises on 404: Not found

Raises on 409: Still referenced — the body lists every referent.

func (*CostScenariosNamespace) Referents added in v1.9.0

Referents: List a scenario model's referents

Every budget, cost report and dashboard cost graph referencing this model — what an edit will change, and what a delete would be refused over. Budgets come first: they are the referents that page people.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/cost-scenarios/{id}/referents

Raises on 404: Not found

func (*CostScenariosNamespace) Update added in v1.9.0

Update: Update a scenario model

Replaces the whole model. This is the high-leverage write: every chart drawing it, and **every budget whose forecast thresholds are measured against it**, uses the new numbers on its next evaluation — which for a budget can change which alerts fire. `GET /{id}/referents` names what a change will touch.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/cost-scenarios/{id}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: A live scenario model already uses this name.

type CostScenariosReferentsParams added in v1.9.0

type CostScenariosReferentsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CostScenariosReferentsParams holds the parameters for `client.costScenarios.referents`.

type CostScenariosReferentsResponse added in v1.9.0

type CostScenariosReferentsResponse struct {
	Referents []CostScenarioReferent `json:"referents"`
}

CostScenariosReferentsResponse is an object the spec declares inline.

type CostScenariosUpdateParams added in v1.9.0

type CostScenariosUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body CostScenarioModelInput
}

CostScenariosUpdateParams holds the parameters for `client.costScenarios.update`.

type CostSeriesPoint

type CostSeriesPoint struct {
	Bucket string  `json:"bucket"`
	Amount float64 `json:"amount"`
}

CostSeriesPoint is the `CostSeriesPoint` schema.

type CostsAnomaliesAcknowledgeParams added in v1.10.0

type CostsAnomaliesAcknowledgeParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	AnomalyID string
	// Body: the JSON request body.
	Body *CostsAnomaliesAcknowledgeRequest
}

CostsAnomaliesAcknowledgeParams holds the parameters for `client.costs.anomalies.acknowledge`.

type CostsAnomaliesAcknowledgeRequest added in v1.10.0

type CostsAnomaliesAcknowledgeRequest struct {
	// Explanation: One sentence on what caused the spend. Becomes the
	// annotation's text, so the annotation's 500-character ceiling applies.
	Explanation string `json:"explanation"`
}

CostsAnomaliesAcknowledgeRequest is an object the spec declares inline.

type CostsAnomaliesGetParams added in v1.10.0

type CostsAnomaliesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Days: Window in days over anomalous days, 1-90. Defaults to 30.
	Days *string
}

CostsAnomaliesGetParams holds the parameters for `client.costs.anomalies.get`.

Every field is optional; pass nil to take the defaults.

type CostsAnomaliesGetResponse added in v1.10.0

type CostsAnomaliesGetResponse struct {
	Anomalies []CostAnomaly `json:"anomalies"`
}

CostsAnomaliesGetResponse is an object the spec declares inline.

type CostsAnomaliesNamespace added in v1.10.0

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

CostsAnomaliesNamespace is `client.costs.anomalies`.

func (*CostsAnomaliesNamespace) Acknowledge added in v1.10.0

Acknowledge: Explain a detected cost anomaly

Record what a finding actually was, and publish that sentence as a cost annotation on **every** chart covering the anomalous day — the point being that 'we migrated the fleet' is not a fact about whichever report somebody happened to open. The note's date (the anomalous day) and its org-wide scope are derived from the anomaly and are not the caller's to choose.

The reply is the updated anomaly, carrying `acknowledgement` with the id of the note it created. Sending it again replaces the sentence and rewords that note rather than filing a second one; it will not recreate a note that has since been deleted, since deleting a note is a deliberate act and the finding stays explained without it.

This does not suppress detection. If the same provider or service spikes again on a later day, that is a new anomaly and it is detected and alerted on as normal.

POST /api/org/{orgId}/costs/anomalies/{anomalyId}/acknowledge

Raises on 400: Bad request

Raises on 403: Forbidden

Raises on 404: Not found

func (*CostsAnomaliesNamespace) Get added in v1.10.0

Get: List recently detected cost anomalies

Spend anomalies detected by the daily background pass. Two kinds share the list: a `spike`, where a provider's or service's spend exceeded its trailing 28-day baseline by a statistical threshold (mean + N·stddev, with an absolute floor to ignore penny-scale noise), and a `new_source`, where a provider or service with no spend at all across that window suddenly billed a material amount. Thresholds are per organization — see GET /costs/anomaly-settings. Newest day first, capped at 200 rows.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/costs/anomalies

Raises on 400: Bad request

type CostsAnomalySettingsGetParams added in v0.27.0

type CostsAnomalySettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostsAnomalySettingsGetParams holds the parameters for `client.costs.anomalySettings.get`.

Every field is optional; pass nil to take the defaults.

type CostsAnomalySettingsNamespace added in v0.27.0

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

CostsAnomalySettingsNamespace is `client.costs.anomalySettings`.

func (*CostsAnomalySettingsNamespace) Get added in v0.27.0

Get: Get the organization's anomaly detection thresholds

The tunable part of cost anomaly detection. Everything else about the model — the 28-day baseline, the 7-day notification cooldown, the minimum history a baseline needs — is fixed. An organization that has never changed a threshold reads back the defaults. The response also carries the derived, read-only `smsConfigured`.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/costs/anomaly-settings

func (*CostsAnomalySettingsNamespace) Update added in v0.27.0

Update: Update the organization's anomaly detection thresholds

Takes effect on the next detection pass (which runs after each cost collection). Anomalies already stored are not re-judged. All four fields are required — this is a PUT of the whole settings object, not a patch — and `smsAlerts` deliberately has no server-side default, so a client that omits it is rejected rather than silently switching an organization's SMS paging back off. `smsConfigured` is derived and is not accepted here.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/costs/anomaly-settings

Raises on 400: Bad request

type CostsAnomalySettingsUpdateParams added in v0.27.0

type CostsAnomalySettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostAnomalySettings
}

CostsAnomalySettingsUpdateParams holds the parameters for `client.costs.anomalySettings.update`.

type CostsDimensionsParams

type CostsDimensionsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Dimension: One of "provider", "account", "service", "region", "resource",
	// "tag", "charge_type", "commitment", "tag-keys".
	Dimension string
	TagKey    *string
}

CostsDimensionsParams holds the parameters for `client.costs.dimensions`.

type CostsEfficiencyAlertSettingsGetParams added in v1.9.0

type CostsEfficiencyAlertSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostsEfficiencyAlertSettingsGetParams holds the parameters for `client.costs.efficiencyAlertSettings.get`.

Every field is optional; pass nil to take the defaults.

type CostsEfficiencyAlertSettingsNamespace added in v1.9.0

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

CostsEfficiencyAlertSettingsNamespace is `client.costs.efficiencyAlertSettings`.

func (*CostsEfficiencyAlertSettingsNamespace) Get added in v1.9.0

Get: Get the organization's efficiency alert tuning

Thresholds for the commitment-expiry, idle-commitment and unit-cost-regression detectors. An organization that has never changed one reads back the defaults, which are chosen to work with no setup.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/costs/efficiency-alert-settings

func (*CostsEfficiencyAlertSettingsNamespace) Update added in v1.9.0

Update: Update the organization's efficiency alert tuning

Takes effect on the next evaluation pass (which runs after each cost collection). Already-fired alerts are not re-judged, and horizons that have already fired for a commitment's current term do not fire again — widening the horizon list warns about future crossings, not past ones. A PUT of the whole object, not a patch.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/costs/efficiency-alert-settings

Raises on 400: Bad request

type CostsEfficiencyAlertSettingsUpdateParams added in v1.9.0

type CostsEfficiencyAlertSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostEfficiencySettings
}

CostsEfficiencyAlertSettingsUpdateParams holds the parameters for `client.costs.efficiencyAlertSettings.update`.

type CostsEfficiencyAlertsParams added in v1.9.0

type CostsEfficiencyAlertsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Kind: Restrict to one detector. Omitted returns all three, interleaved by
	// time.
	//
	// One of "commitment_expiry", "commitment_idle", "unit_cost_regression".
	Kind *string
	// Limit: Rows to return, newest first. Defaults to 50.
	Limit *int64
}

CostsEfficiencyAlertsParams holds the parameters for `client.costs.efficiencyAlerts`.

Every field is optional; pass nil to take the defaults.

type CostsEfficiencyAlertsResponse added in v1.9.0

type CostsEfficiencyAlertsResponse struct {
	Events []EfficiencyAlertEvent `json:"events"`
}

CostsEfficiencyAlertsResponse is an object the spec declares inline.

type CostsNamespace

type CostsNamespace struct {

	// Anomalies: `client.costs.anomalies`.
	Anomalies *CostsAnomaliesNamespace
	// AnomalySettings: `client.costs.anomalySettings`.
	AnomalySettings *CostsAnomalySettingsNamespace
	// EfficiencyAlertSettings: `client.costs.efficiencyAlertSettings`.
	EfficiencyAlertSettings *CostsEfficiencyAlertSettingsNamespace
	// contains filtered or unexported fields
}

CostsNamespace is `client.costs`.

func (*CostsNamespace) Dimensions

Dimensions: List distinct values for a cost dimension

Feeds the filter and group-by pickers. Pass dimension=tag-keys for tag keys; dimension=tag requires tagKey. `charge_type` answers from the fixed set of charge types rather than from the stored data, so the picker is populated before any provider has reported one.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/costs/dimensions

Raises on 400: Bad request

func (*CostsNamespace) EfficiencyAlerts added in v1.9.0

EfficiencyAlerts: Recently fired efficiency alerts

The three slow-lane cost alerts in one feed, newest first: commitments about to lapse, commitments that are not being used, and business metrics whose cost per unit rose. Unlike budgets, anomalies and change alerts — all of which compare a spend total against another spend total — these read the commitment calendar and the volume the spend bought, so they see the two surprises the other three structurally cannot.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/costs/efficiency-alerts

Raises on 400: Bad request

func (*CostsNamespace) Query

Query: Query aggregated cost series

Aggregates collected provider spend into per-bucket, per-group series for cost graphs. Currencies are never merged; mixed-currency orgs get one series per currency. Optionally returns a previous-period comparison and a trend forecast.

`costBasis` chooses between cash and amortized money, and `chargeTypes` narrows which kinds of charge count. Both the comparison period and the forecast are computed on the same basis and charge types as the series itself.

The filter can be sent structurally as `filters` or as text in the cost query language via `query` (`provider = 'aws' AND tag['env'] != 'dev'`). They are two spellings of one filter: sending both is a 400, and a query that does not parse is a 400 carrying the offset of the mistake.

_Requires permission: `costs:read`._

POST /api/org/{orgId}/costs/query

Raises on 400: Bad request

func (*CostsNamespace) Rows added in v0.6.0

Rows: Push cost rows from your own systems

Reports spend Infrawrench has no provider plugin for — a parsed SaaS invoice, an internal chargeback, a colo bill — into the same store the provider collectors write to, so it appears in cost graphs, dimension filters, and budgets alongside everything else.

Rows are grouped under a caller-chosen `source`. Writes are idempotent per `(source, day, service, region, resourceId, tags, currency)`: pushing the same day again restates that day rather than adding to it, so a nightly job can safely re-push a trailing window. Rows pushed under a source can never overwrite rows a provider collector wrote.

The whole batch is validated before anything is stored, so a 400 means nothing was written.

_Requires permission: `costs:write`._

POST /api/org/{orgId}/costs/rows

Raises on 400: Bad request

func (*CostsNamespace) Showback added in v0.29.0

func (n *CostsNamespace) Showback(ctx context.Context, params *CostsShowbackParams, opts ...RequestOption) (*ShowbackReport, error)

Showback: Spend grouped by cost centre (showback)

Runs the org's allocation rules over collected spend and sums per cost centre and currency. Spend no rule claims comes back as the "Unallocated" bucket; every defined centre appears even with zero spend.

Cost centres nest, so the list is a depth-first tree. Each entry carries `totals` (spend allocated directly to it) and `subtreeTotals` (its own plus every descendant's) — "Engineering, of which Platform" needs both. Rules still evaluate first-match-wins by ascending priority against a flat list, so a row is allocated exactly once even when a rule targets a parent and another targets its child; at equal priority the more deeply nested centre wins.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/costs/showback

Raises on 400: Bad request

func (*CostsNamespace) Status

Status: Per-account cost collection status

Which accounts support cost collection, whether their history backfill has completed, and the ingested date coverage.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/costs/status

func (*CostsNamespace) Untagged added in v0.29.0

Untagged: Untagged spend over the required tag keys

Spend on cost rows missing at least one of the org's required tag keys, overall and per key, plus the largest untagged (account, service) buckets. Empty when no tag policy is configured — untagged is only meaningful against a policy.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/costs/untagged

Raises on 400: Bad request

type CostsQueryParams

type CostsQueryParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostQueryRequest
}

CostsQueryParams holds the parameters for `client.costs.query`.

type CostsRowsParams added in v0.6.0

type CostsRowsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostPushRequest
}

CostsRowsParams holds the parameters for `client.costs.rows`.

type CostsShowbackParams added in v0.29.0

type CostsShowbackParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// From: Defaults to 30 days ago.
	From *string
	// To: Defaults to today.
	To *string
	// Basis: Which money to sum. `cash` (the default) is what the provider
	// charged on the day it charged it; `amortized` spreads a commitment's
	// up-front fee across the term it buys. Providers that report no amortized
	// amount fall back to their cash amount.
	//
	// One of "cash", "amortized".
	Basis *string
	// Adjusted: Apply the organization's billing rules (see /billing-rules):
	// markups multiply, and a reallocation moves a centre's spend onto another
	// centre. Off by default — a chargeback report that silently showed
	// marked-up numbers is one the receiving team could not reconcile. On, the
	// response carries `adjustment` with the collected totals beside the
	// adjusted ones. Fixed-amount rules are booked onto the cost centre they
	// name (or "Unallocated" when they name none), pro-rated across the period.
	//
	// One of "true", "false".
	Adjusted *string
}

CostsShowbackParams holds the parameters for `client.costs.showback`.

Every field is optional; pass nil to take the defaults.

type CostsStatusParams

type CostsStatusParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CostsStatusParams holds the parameters for `client.costs.status`.

Every field is optional; pass nil to take the defaults.

type CostsStatusResponse

type CostsStatusResponse struct {
	Accounts []CostAccountStatus `json:"accounts"`
}

CostsStatusResponse is an object the spec declares inline.

type CostsUntaggedParams added in v0.29.0

type CostsUntaggedParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// From: Defaults to 30 days ago.
	From *string
	// To: Defaults to today.
	To *string
	// Basis: Which money to sum. `cash` (the default) is what the provider
	// charged on the day it charged it; `amortized` spreads a commitment's
	// up-front fee across the term it buys. Providers that report no amortized
	// amount fall back to their cash amount.
	//
	// One of "cash", "amortized".
	Basis *string
}

CostsUntaggedParams holds the parameters for `client.costs.untagged`.

Every field is optional; pass nil to take the defaults.

type CreateAPIKeyRequest

type CreateAPIKeyRequest struct {
	Name      string       `json:"name"`
	Scopes    []Permission `json:"scopes"`
	ExpiresAt *string      `json:"expiresAt,omitempty"`
}

CreateAPIKeyRequest is the `CreateApiKeyRequest` schema.

Spec schema: `CreateApiKeyRequest`.

type CreateAccountRequest

type CreateAccountRequest struct {
	PluginID    string            `json:"pluginId"`
	DisplayName string            `json:"displayName"`
	Credentials map[string]string `json:"credentials"`
	// BastionID: Optional bastion id to route this account's cloud API traffic
	// through.
	BastionID *string `json:"bastionId,omitempty"`
}

CreateAccountRequest is the `CreateAccountRequest` schema.

type CreateAccountResponse

type CreateAccountResponse struct {
	ID        string                          `json:"id"`
	SyncError *CreateAccountResponseSyncError `json:"syncError,omitempty"`
}

CreateAccountResponse is the `CreateAccountResponse` schema.

type CreateAccountResponseSyncError

type CreateAccountResponseSyncError struct {
	Message string `json:"message"`
}

CreateAccountResponseSyncError is an object the spec declares inline.

type CreateAgentSession

type CreateAgentSession struct {
	Repo          *string        `json:"repo,omitempty"`
	ProjectName   *string        `json:"projectName,omitempty"`
	WorkspaceName *string        `json:"workspaceName,omitempty"`
	Settings      *AgentSettings `json:"settings"`
}

CreateAgentSession is the `CreateAgentSession` schema.

type CreateBastionRequest

type CreateBastionRequest struct {
	Name string `json:"name"`
}

CreateBastionRequest is the `CreateBastionRequest` schema.

type CreateBastionResponse

type CreateBastionResponse struct {
	ID          string `json:"id"`
	Name        string `json:"name"`
	TokenPrefix string `json:"tokenPrefix"`
	// Token: Enrollment token in the form `iwb_<random>`. Pass to the agent
	// container as `BASTION_TOKEN`. Returned once — not recoverable later.
	Token string `json:"token"`
}

CreateBastionResponse is the `CreateBastionResponse` schema.

type CreateConfigRequest

type CreateConfigRequest struct {
	AccountID        string      `json:"accountId"`
	ResourceTypeID   string      `json:"resourceTypeId"`
	PluginID         *string     `json:"pluginId,omitempty"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

CreateConfigRequest is the `CreateConfigRequest` schema.

type CreateJiraIssueInput added in v1.6.0

type CreateJiraIssueInput struct {
	SourceKind JiraSourceKind `json:"sourceKind"`
	// SourceID: The finding's own id, as the detector reports it.
	SourceID    string `json:"sourceId"`
	ProjectKey  string `json:"projectKey"`
	IssueTypeID string `json:"issueTypeId"`
	Summary     string `json:"summary"`
	// Description: Plain text. Converted server-side to Atlassian Document
	// Format, which is what the Jira REST v3 description field requires; blank
	// lines become paragraphs.
	Description *string `json:"description,omitempty"`
	// Labels: Whitespace inside a label is replaced with '-', since Jira rejects
	// it.
	Labels []string `json:"labels,omitempty"`
}

CreateJiraIssueInput is the `CreateJiraIssueInput` schema.

type CreateJiraIssueResult added in v1.6.0

type CreateJiraIssueResult struct {
	Issue CreateJiraIssueResultIssue `json:"issue"`
	Link  JiraIssueLink              `json:"link"`
}

CreateJiraIssueResult is the `CreateJiraIssueResult` schema.

type CreateJiraIssueResultIssue added in v1.6.0

type CreateJiraIssueResultIssue struct {
	ID  string `json:"id"`
	Key string `json:"key"`
	URL string `json:"url"`
}

CreateJiraIssueResultIssue is an object the spec declares inline.

type CreateLinearIssueInput added in v1.6.0

type CreateLinearIssueInput struct {
	SourceKind LinearSourceKind `json:"sourceKind"`
	// SourceID: The finding's own id, as the detector reports it.
	SourceID string `json:"sourceId"`
	// TeamID: Team to file into. Every Linear issue belongs to exactly one team.
	TeamID string `json:"teamId"`
	Title  string `json:"title"`
	// Description: Markdown, passed to Linear as-is — unlike Jira, where the
	// server converts plain text to Atlassian Document Format.
	Description *string `json:"description,omitempty"`
	// LabelIDs: Ids of existing labels in the workspace. Linear cannot create
	// labels here.
	LabelIDs []string `json:"labelIds,omitempty"`
	// ProjectID: Optional project to attach the issue to.
	ProjectID *string `json:"projectId,omitempty"`
}

CreateLinearIssueInput is the `CreateLinearIssueInput` schema.

type CreateLinearIssueResult added in v1.6.0

type CreateLinearIssueResult struct {
	Issue CreateLinearIssueResultIssue `json:"issue"`
	Link  LinearIssueLink              `json:"link"`
}

CreateLinearIssueResult is the `CreateLinearIssueResult` schema.

type CreateLinearIssueResultIssue added in v1.6.0

type CreateLinearIssueResultIssue struct {
	ID         string `json:"id"`
	Identifier string `json:"identifier"`
	URL        string `json:"url"`
}

CreateLinearIssueResultIssue is an object the spec declares inline.

type CreateOrgRequest

type CreateOrgRequest struct {
	DisplayName string `json:"displayName"`
}

CreateOrgRequest is the `CreateOrgRequest` schema.

type CreatePricingRequest

type CreatePricingRequest struct {
	AccountID        string                      `json:"accountId"`
	ResourceTypeID   string                      `json:"resourceTypeId"`
	RegionID         *string                     `json:"regionId,omitempty"`
	Sizes            []CreatePricingRequestSizes `json:"sizes"`
	PluginID         *string                     `json:"pluginId,omitempty"`
	ParentResourceID *ResourceID                 `json:"parentResourceId,omitempty"`
}

CreatePricingRequest is the `CreatePricingRequest` schema.

type CreatePricingRequestSizes

type CreatePricingRequestSizes struct {
	ID       string  `json:"id"`
	Vcpus    float64 `json:"vcpus"`
	MemoryMb float64 `json:"memoryMb"`
}

CreatePricingRequestSizes is an object the spec declares inline.

type CreateResourceRequest

type CreateResourceRequest struct {
	AccountID        string            `json:"accountId"`
	PluginID         string            `json:"pluginId"`
	ResourceTypeID   string            `json:"resourceTypeId"`
	Fields           map[string]string `json:"fields"`
	ParentResourceID *ResourceID       `json:"parentResourceId,omitempty"`
}

CreateResourceRequest is the `CreateResourceRequest` schema.

type CreateResourceResponse

type CreateResourceResponse struct {
	ID          ResourceID `json:"id"`
	DisplayName string     `json:"displayName"`
	Warnings    []string   `json:"warnings,omitempty"`
}

CreateResourceResponse is the `CreateResourceResponse` schema.

type CreateSharedConsole added in v1.14.0

type CreateSharedConsole struct {
	// LiveConsoleID: The pty to share, as the terminal's WebSocket reported it
	// in its `ssh:connected` frame. Everything else about the session — host,
	// account, recording — is read from the proxy's own registration rather than
	// from this body.
	LiveConsoleID string `json:"liveConsoleId"`
	RoutingKey    string `json:"routingKey"`
	// AllowHandover: Defaults to true.
	AllowHandover *bool `json:"allowHandover,omitempty"`
	// InviteTTLMinutes: Defaults to 15.
	InviteTTLMinutes *int64 `json:"inviteTtlMinutes,omitempty"`
}

CreateSharedConsole is the `CreateSharedConsole` schema.

type CreateWidgetRequest

type CreateWidgetRequest struct {
	DashboardID string              `json:"dashboardId"`
	Kind        DashboardWidgetKind `json:"kind"`
	Title       *string             `json:"title,omitempty"`
	Config      JSONObject          `json:"config"`
}

CreateWidgetRequest is the `CreateWidgetRequest` schema.

type CreatedAPIKey

type CreatedAPIKey struct {
	ID string `json:"id"`
	// Key: Plaintext key. Returned once. Format: `iwk_<base64url>`.
	Key string `json:"key"`
}

CreatedAPIKey is the `CreatedApiKey` schema.

Spec schema: `CreatedApiKey`.

type CredentialExport

type CredentialExport struct {
	Content  string                   `json:"content"`
	Filename string                   `json:"filename"`
	MimeType string                   `json:"mimeType"`
	Fields   []CredentialExportFields `json:"fields,omitempty"`
	Warning  *string                  `json:"warning,omitempty"`
}

CredentialExport is the `CredentialExport` schema.

type CredentialExportFields added in v0.7.0

type CredentialExportFields struct {
	Label     string  `json:"label"`
	Value     string  `json:"value"`
	Sensitive *bool   `json:"sensitive,omitempty"`
	Hint      *string `json:"hint,omitempty"`
}

CredentialExportFields is an object the spec declares inline.

type CredentialField

type CredentialField struct {
	Key          string                   `json:"key"`
	Label        string                   `json:"label"`
	Description  *string                  `json:"description,omitempty"`
	Placeholder  *string                  `json:"placeholder,omitempty"`
	Sensitive    *bool                    `json:"sensitive,omitempty"`
	Multiline    *bool                    `json:"multiline,omitempty"`
	DefaultValue *string                  `json:"defaultValue,omitempty"`
	Regions      []CredentialFieldRegion  `json:"regions,omitempty"`
	HelpLink     *CredentialFieldHelpLink `json:"helpLink,omitempty"`
}

CredentialField is the `CredentialField` schema.

type CredentialFieldHelpLink struct {
	Label string `json:"label"`
	URL   string `json:"url"`
}

CredentialFieldHelpLink is an object the spec declares inline.

type CredentialFieldRegion

type CredentialFieldRegion struct {
	ID       string  `json:"id"`
	Label    string  `json:"label"`
	Location *string `json:"location,omitempty"`
	Flag     *string `json:"flag,omitempty"`
}

CredentialFieldRegion is the `CredentialFieldRegion` schema.

type CredentialFormat

type CredentialFormat struct {
	// ID: Passed back as `formatId` on export.
	ID          string  `json:"id"`
	Label       string  `json:"label"`
	Description *string `json:"description,omitempty"`
	// MediaType: How the credential body should be presented. `binary-base64`
	// means `content` is base64.
	//
	// One of "json", "text", "ini", "binary-base64".
	MediaType string `json:"mediaType"`
	// FilenameTemplate: Suggested filename; `{resource}` is replaced with the
	// resource's external id.
	FilenameTemplate *string `json:"filenameTemplate,omitempty"`
}

CredentialFormat is the `CredentialFormat` schema.

type CredentialHygieneGetParams added in v0.43.0

type CredentialHygieneGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// WindowDays: Activity window. Defaults to 90.
	WindowDays *int64
}

CredentialHygieneGetParams holds the parameters for `client.credentialHygiene.get`.

Every field is optional; pass nil to take the defaults.

type CredentialHygieneNamespace added in v0.43.0

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

CredentialHygieneNamespace is `client.credentialHygiene`.

func (*CredentialHygieneNamespace) Get added in v0.43.0

Get: Credential hygiene report

API keys nobody uses, SSH keys nothing references, and members holding write permissions they have never exercised — derived entirely from data the server already holds. No provider call and nothing to enable.

**The audit log only witnesses writes.** Reading a resource list or a cost graph leaves no audit row by design, so this report draws no conclusion about read permissions: an absence of evidence about them proves nothing. `permissionFindingsWithheld` is set when the organization does not yet have enough audit history for the unused-permission finding to be meaningful. Both are load-bearing — a governance report that overclaims is worse than none.

Gated on `audit:read` rather than a permission of its own: every fact here is already reachable by anyone who can read the audit log, so this is a lens rather than a new disclosure.

_Requires permission: `audit:read`._

GET /api/org/{orgId}/credential-hygiene

Raises on 400: Bad request

type CreditBurndown added in v0.43.0

type CreditBurndown struct {
	Pots     []CreditPot         `json:"pots"`
	Failures []CreditPollFailure `json:"failures"`
	// PendingAccountIDs: Credit-capable accounts never yet collected — named
	// rather than omitted.
	PendingAccountIDs []string `json:"pendingAccountIds"`
	BurnWindowDays    int64    `json:"burnWindowDays"`
}

CreditBurndown is the `CreditBurndown` schema.

type CreditPollFailure added in v0.43.0

type CreditPollFailure struct {
	AccountID   string   `json:"accountId"`
	AccountName string   `json:"accountName"`
	PluginID    PluginID `json:"pluginId"`
	Error       string   `json:"error"`
	HelpLabel   *string  `json:"helpLabel"`
	// HelpURL: Set when the plugin reported a permission gap rather than an
	// outage.
	HelpURL      *string `json:"helpUrl"`
	FailureCount int64   `json:"failureCount"`
}

CreditPollFailure is the `CreditPollFailure` schema.

type CreditPot added in v0.43.0

type CreditPot struct {
	AccountID   string   `json:"accountId"`
	AccountName string   `json:"accountName"`
	PluginID    PluginID `json:"pluginId"`
	// CapabilityLabel: The provider's own word for this pot — "Credits",
	// "Balance".
	CapabilityLabel string  `json:"capabilityLabel"`
	TopUpURL        *string `json:"topUpUrl"`
	// PotKey: Stable identity for this pot within the account — a currency code,
	// a project id — so successive readings line up into a series.
	PotKey    string  `json:"potKey"`
	Label     string  `json:"label"`
	Remaining float64 `json:"remaining"`
	Currency  string  `json:"currency"`
	// Granted: What was granted, when the provider reports it.
	Granted *float64 `json:"granted"`
	// CreditExpiresAt: Hard expiry on the credit itself, independent of burn.
	CreditExpiresAt *string `json:"creditExpiresAt"`
	ObservedAt      string  `json:"observedAt"`
	// BurnPerDay: Spend per day over the observed span. **Null means there is
	// not enough history to say** — never 0, which would read as 'nothing is
	// being spent'.
	BurnPerDay   *float64 `json:"burnPerDay"`
	BurnSpanDays float64  `json:"burnSpanDays"`
	Observations int64    `json:"observations"`
	// TopUps: Increases seen between consecutive readings. A top-up is recorded,
	// never netted off the burn — subtracting the endpoints of a window
	// containing one reports a negative burn and an infinite runway.
	TopUps      int64    `json:"topUps"`
	RunwayDays  *float64 `json:"runwayDays"`
	ExhaustedAt *string  `json:"exhaustedAt"`
	// NeverEmpties: Nothing has been spent over the observed span.
	NeverEmpties bool `json:"neverEmpties"`
	// LimitedByExpiry: The credit's own expiry, not the burn rate, is the
	// binding deadline.
	LimitedByExpiry bool `json:"limitedByExpiry"`
	// Urgency: One of "critical", "warning", "ok", "unknown".
	Urgency string `json:"urgency"`
}

CreditPot is the `CreditPot` schema.

type CreditsGetParams added in v0.43.0

type CreditsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CreditsGetParams holds the parameters for `client.credits.get`.

Every field is optional; pass nil to take the defaults.

type CreditsNamespace added in v0.43.0

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

CreditsNamespace is `client.credits`.

func (*CreditsNamespace) Get added in v0.43.0

Get: Prepaid credit balances, burn rate and runway

Every prepaid pot the organization holds, most urgent first. A provider that bills in arrears sends an invoice you can argue with; a prepaid pot that empties simply stops answering — so this is an availability number as much as a finance one.

The burn rate is measured from the server's own series of readings rather than reported by the provider, and it is the sum of the **decreases** between consecutive readings: a top-up inside the window is recorded separately, never netted off. The runway is bounded by both the burn and the credit's own expiry, whichever comes first.

Only providers that expose a balance appear here; most bill in arrears and have no pot.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/credits

type CurrencyConfig added in v1.6.0

type CurrencyConfig struct {
	// DisplayCurrency: ISO 4217 code, upper-case.
	DisplayCurrency *string        `json:"displayCurrency"`
	Rates           []ExchangeRate `json:"rates"`
}

CurrencyConfig is the `CurrencyConfig` schema.

type CurrencyGetParams added in v1.6.0

type CurrencyGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CurrencyGetParams holds the parameters for `client.currency.get`.

Every field is optional; pass nil to take the defaults.

type CurrencyNamespace added in v1.6.0

type CurrencyNamespace struct {

	// Rates: `client.currency.rates`.
	Rates *CurrencyRatesNamespace
	// contains filtered or unexported fields
}

CurrencyNamespace is `client.currency`.

func (*CurrencyNamespace) Get added in v1.6.0

Get: The org's display currency and exchange rate table

Readable with `costs:read` rather than a settings permission: anyone who can see a converted total has to be able to see what it was converted at, or the number is unauditable.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/currency

func (*CurrencyNamespace) Update added in v1.6.0

Update: Set or clear the org's display currency

Setting a currency opts the organization into converted totals; `null` turns conversion off everywhere and restores the per-currency view. Clearing does not delete the rate table, so conversion can be turned back on without re-stating anything. Only currencies with a configured rate are converted — Infrawrench never fetches live exchange rates.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/currency

Raises on 400: Bad request

type CurrencyRatesDeleteParams added in v1.6.0

type CurrencyRatesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID  *string
	RateID string
}

CurrencyRatesDeleteParams holds the parameters for `client.currency.rates.delete`.

type CurrencyRatesDeleteResponse added in v1.6.0

type CurrencyRatesDeleteResponse struct {
	OK bool `json:"ok"`
}

CurrencyRatesDeleteResponse is an object the spec declares inline.

type CurrencyRatesNamespace added in v1.6.0

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

CurrencyRatesNamespace is `client.currency.rates`.

func (*CurrencyRatesNamespace) Delete added in v1.6.0

Delete: Delete one exchange rate

Removing a rate makes the days it covered fall back to the next-older rate, or to unconverted if none remains. Spend never disappears — it reverts to its own currency.

_Requires permission: `org:settings:write`._

DELETE /api/org/{orgId}/currency/rates/{rateId}

Raises on 404: Not found

func (*CurrencyRatesNamespace) Update added in v1.6.0

Update: Create or replace one exchange rate

Upserts on (`fromCurrency`, `toCurrency`, `effectiveFrom`) — one rate per pair per day, so correcting a rate replaces it rather than adding a second one whose precedence a reader would have to guess. Rates are stated to the display currency in one hop: nothing inverts a rate or chains two, because both produce a number you never stated.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/currency/rates

Raises on 400: Bad request

type CurrencyRatesUpdateParams added in v1.6.0

type CurrencyRatesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ExchangeRateInput
}

CurrencyRatesUpdateParams holds the parameters for `client.currency.rates.update`.

type CurrencySettings added in v1.6.0

type CurrencySettings struct {
	// DisplayCurrency: The currency converted amounts are expressed in, or
	// `null` for no conversion at all. `null` is the default and the state of
	// every organization that has not opted in: cost data is stored per currency
	// and never merged unless you ask.
	DisplayCurrency *string `json:"displayCurrency"`
}

CurrencySettings is the `CurrencySettings` schema.

type CurrencyUpdateParams added in v1.6.0

type CurrencyUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CurrencySettings
}

CurrencyUpdateParams holds the parameters for `client.currency.update`.

type CustomGraphCheckRequest added in v0.16.0

type CustomGraphCheckRequest struct {
	Source string `json:"source"`
}

CustomGraphCheckRequest is the `CustomGraphCheckRequest` schema.

type CustomGraphCheckResult added in v0.16.0

type CustomGraphCheckResult struct {
	Diagnostics []CustomGraphCheckResultDiagnostics `json:"diagnostics"`
	HasErrors   bool                                `json:"hasErrors"`
	Degraded    bool                                `json:"degraded"`
}

CustomGraphCheckResult is the `CustomGraphCheckResult` schema.

type CustomGraphCheckResultDiagnostics added in v0.16.0

type CustomGraphCheckResultDiagnostics struct {
	Line     int64  `json:"line"`
	Column   int64  `json:"column"`
	Code     int64  `json:"code"`
	Category string `json:"category"`
	Message  string `json:"message"`
}

CustomGraphCheckResultDiagnostics is an object the spec declares inline.

type CustomGraphFull added in v0.16.0

type CustomGraphFull struct {
	ID                 string  `json:"id"`
	OrganizationID     string  `json:"organizationId"`
	Name               string  `json:"name"`
	Description        *string `json:"description"`
	Source             string  `json:"source"`
	CreatedByUserID    *string `json:"createdByUserId"`
	SourceAuthorUserID *string `json:"sourceAuthorUserId"`
	DeletedAt          *string `json:"deletedAt"`
	CreatedAt          string  `json:"createdAt"`
	UpdatedAt          string  `json:"updatedAt"`
}

CustomGraphFull is the `CustomGraphFull` schema.

type CustomGraphInput added in v0.16.0

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

CustomGraphInput is the `CustomGraphInput` schema.

type CustomGraphRenderRequest added in v0.16.0

type CustomGraphRenderRequest struct {
	Controls map[string]any `json:"controls,omitempty"`
	Button   *string        `json:"button,omitempty"`
	// Trigger: One of "manual", "refresh", "interaction".
	Trigger *string `json:"trigger,omitempty"`
}

CustomGraphRenderRequest is the `CustomGraphRenderRequest` schema.

type CustomGraphRenderResult added in v0.16.0

type CustomGraphRenderResult struct {
	OK         bool                          `json:"ok"`
	Spec       JSONObject                    `json:"spec"`
	Error      *string                       `json:"error"`
	Logs       []CustomGraphRenderResultLogs `json:"logs"`
	RenderedAt string                        `json:"renderedAt"`
	DurationMs int64                         `json:"durationMs"`
}

CustomGraphRenderResult is the `CustomGraphRenderResult` schema.

type CustomGraphRenderResultLogs added in v0.16.0

type CustomGraphRenderResultLogs struct {
	// Level: One of "info", "warn", "error".
	Level   string `json:"level"`
	Message string `json:"message"`
}

CustomGraphRenderResultLogs is an object the spec declares inline.

type CustomGraphSummary added in v0.16.0

type CustomGraphSummary struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	CreatedAt   string  `json:"createdAt"`
	UpdatedAt   string  `json:"updatedAt"`
}

CustomGraphSummary is the `CustomGraphSummary` schema.

type CustomGraphUpdate added in v0.16.0

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

CustomGraphUpdate is the `CustomGraphUpdate` schema.

type CustomGraphsCheckParams added in v0.16.0

type CustomGraphsCheckParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CustomGraphCheckRequest
}

CustomGraphsCheckParams holds the parameters for `client.customGraphs.check`.

type CustomGraphsCreateParams added in v0.16.0

type CustomGraphsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CustomGraphInput
}

CustomGraphsCreateParams holds the parameters for `client.customGraphs.create`.

type CustomGraphsDeleteParams added in v0.16.0

type CustomGraphsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CustomGraphsDeleteParams holds the parameters for `client.customGraphs.delete`.

type CustomGraphsGetParams added in v0.16.0

type CustomGraphsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

CustomGraphsGetParams holds the parameters for `client.customGraphs.get`.

type CustomGraphsListParams added in v0.16.0

type CustomGraphsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CustomGraphsListParams holds the parameters for `client.customGraphs.list`.

Every field is optional; pass nil to take the defaults.

type CustomGraphsNamespace added in v0.16.0

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

CustomGraphsNamespace is `client.customGraphs`.

func (*CustomGraphsNamespace) Check added in v0.16.0

Check: Type-check custom-graph source without saving it

_Requires permission: `dashboards:read`._

POST /api/org/{orgId}/custom-graphs/check

Raises on 400: Bad request

func (*CustomGraphsNamespace) Create added in v0.16.0

Create: Create a custom graph (paid plan required)

_Requires permission: `dashboards:write`._

POST /api/org/{orgId}/custom-graphs

Raises on 400: Bad request

Raises on 402: Payment required — the organization's plan does not include this

func (*CustomGraphsNamespace) Delete added in v0.16.0

Delete: Delete a custom graph (and its dashboard cards)

_Requires permission: `dashboards:write`._

DELETE /api/org/{orgId}/custom-graphs/{id}

Raises on 404: Not found

func (*CustomGraphsNamespace) Get added in v0.16.0

Get: Get a custom graph (including source)

_Requires permission: `dashboards:read`._

GET /api/org/{orgId}/custom-graphs/{id}

Raises on 404: Not found

func (*CustomGraphsNamespace) List added in v0.16.0

List: List custom graphs

_Requires permission: `dashboards:read`._

GET /api/org/{orgId}/custom-graphs

func (*CustomGraphsNamespace) Render added in v0.16.0

Render: Run the graph's script and return its render spec (paid plan required)

_Requires permission: `dashboards:read`._

POST /api/org/{orgId}/custom-graphs/{id}/render

Raises on 400: Bad request

Raises on 402: Payment required — the organization's plan does not include this

Raises on 404: Not found

func (*CustomGraphsNamespace) Typings added in v0.16.0

Typings: The ambient graph.d.ts for custom-graph source

_Requires permission: `dashboards:read`._

GET /api/org/{orgId}/custom-graphs/typings

func (*CustomGraphsNamespace) Update added in v0.16.0

Update: Update a custom graph (paid plan required)

_Requires permission: `dashboards:write`._

PUT /api/org/{orgId}/custom-graphs/{id}

Raises on 400: Bad request

Raises on 402: Payment required — the organization's plan does not include this

Raises on 404: Not found

type CustomGraphsRenderParams added in v0.16.0

type CustomGraphsRenderParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body *CustomGraphRenderRequest
}

CustomGraphsRenderParams holds the parameters for `client.customGraphs.render`.

type CustomGraphsTypingsParams added in v0.16.0

type CustomGraphsTypingsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

CustomGraphsTypingsParams holds the parameters for `client.customGraphs.typings`.

Every field is optional; pass nil to take the defaults.

type CustomGraphsUpdateParams added in v0.16.0

type CustomGraphsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body CustomGraphUpdate
}

CustomGraphsUpdateParams holds the parameters for `client.customGraphs.update`.

type DNSGetParams added in v0.43.0

type DNSGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

DNSGetParams holds the parameters for `client.dns.get`.

Every field is optional; pass nil to take the defaults.

type DNSInventoryCounts added in v0.43.0

type DNSInventoryCounts struct {
	Zones       int64 `json:"zones"`
	Records     int64 `json:"records"`
	Owned       int64 `json:"owned"`
	Dangling    int64 `json:"dangling"`
	External    int64 `json:"external"`
	NotAnalysed int64 `json:"notAnalysed"`
}

DNSInventoryCounts: Record counts per status; zones counted separately.

Spec schema: `DnsInventoryCounts`.

type DNSInventoryResponse added in v0.43.0

type DNSInventoryResponse struct {
	// Zones: Sorted by domain, then account name.
	Zones []DNSZone `json:"zones"`
	// Records: Sorted worst status first, then by name.
	Records []DNSRecord        `json:"records"`
	Counts  DNSInventoryCounts `json:"counts"`
	// SkippedNamespaces: Provider namespaces that were declared but not
	// evaluated, and why — either no account for the plugin is connected, or no
	// claimant resource has synced. Both are missing data rather than a clean
	// bill of health, so they are reported rather than hidden.
	SkippedNamespaces []DNSSkippedNamespace `json:"skippedNamespaces"`
	GeneratedAt       string                `json:"generatedAt"`
}

DNSInventoryResponse is the `DnsInventoryResponse` schema.

Spec schema: `DnsInventoryResponse`.

type DNSNamespace added in v0.43.0

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

DNSNamespace is `client.dns`.

func (*DNSNamespace) Get added in v0.43.0

Get: List every DNS zone and record, with dangling targets flagged

One view over every zone and record across the connected DNS providers (Cloudflare, Route 53, Cloud DNS, DigitalOcean, Netlify, Azure DNS, Vercel), with each record target classified against the rest of the workspace. No provider API calls are made and no DNS is resolved — results reflect the last sync.

A `dangling` target is a subdomain-takeover candidate: the record points into a provider namespace this workspace manages and nothing synced claims it. The same records surface as `dns-dangling-target` findings on `GET /posture` and alert through the posture channel, so there is no separate DNS alert setting.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/dns

type DNSRecord added in v0.43.0

type DNSRecord struct {
	// ResourceID: Infrawrench resource id of the record itself.
	ResourceID       string   `json:"resourceId"`
	PluginID         PluginID `json:"pluginId"`
	PluginName       string   `json:"pluginName"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
	AccountName      string   `json:"accountName"`
	// ZoneResourceID: Owning zone's resource id, or null when the record could
	// not be attributed.
	ZoneResourceID *string `json:"zoneResourceId"`
	ZoneDomain     *string `json:"zoneDomain"`
	// Name: Fully qualified, lowercased, no trailing dot.
	Name     string   `json:"name"`
	Type     string   `json:"type"`
	TTL      *float64 `json:"ttl"`
	Priority *float64 `json:"priority"`
	// Proxied: Whether the provider proxies the record (Cloudflare's orange
	// cloud).
	Proxied bool              `json:"proxied"`
	Targets []DNSRecordTarget `json:"targets"`
	// Status: Worst classification across `targets`.
	//
	// One of "owned", "dangling", "external", "not-analysed".
	Status string `json:"status"`
}

DNSRecord is the `DnsRecord` schema.

Spec schema: `DnsRecord`.

type DNSRecordTarget added in v0.43.0

type DNSRecordTarget struct {
	// Value: The target as stored, lowercased with any trailing dot removed.
	Value string `json:"value"`
	// Classification: What can be said about a record target from synced state
	// alone. `owned` — the value is an identity of a synced resource. `dangling`
	// — the value falls inside a provider namespace this workspace manages (an
	// S3 endpoint, a `*.vercel.app` alias) and no synced resource claims it,
	// which is the subdomain-takeover signature. `external` — the value points
	// somewhere there is no declaration for; not a finding. `not-analysed` — the
	// record type carries no host target that is reasoned about (TXT, MX, SOA,
	// CAA, SRV).
	//
	// One of "owned", "dangling", "external", "not-analysed".
	Classification string             `json:"classification"`
	Resource       *DNSTargetResource `json:"resource"`
	Service        *DNSTargetService  `json:"service"`
}

DNSRecordTarget is the `DnsRecordTarget` schema.

Spec schema: `DnsRecordTarget`.

type DNSSkippedNamespace added in v0.43.0

type DNSSkippedNamespace struct {
	PluginID   PluginID `json:"pluginId"`
	PluginName string   `json:"pluginName"`
	Label      string   `json:"label"`
	Reason     string   `json:"reason"`
}

DNSSkippedNamespace is the `DnsSkippedNamespace` schema.

Spec schema: `DnsSkippedNamespace`.

type DNSTargetResource added in v0.43.0

type DNSTargetResource struct {
	ResourceID       string   `json:"resourceId"`
	DisplayName      string   `json:"displayName"`
	PluginID         PluginID `json:"pluginId"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
}

DNSTargetResource: Set only when classification is "owned".

Spec schema: `DnsTargetResource`.

The API may send null in its place.

type DNSTargetService added in v0.43.0

type DNSTargetService struct {
	PluginID       PluginID `json:"pluginId"`
	PluginName     string   `json:"pluginName"`
	ResourceTypeID string   `json:"resourceTypeId"`
	RuleID         string   `json:"ruleId"`
	Label          string   `json:"label"`
	// Severity: One of "critical", "high", "medium", "low".
	Severity string `json:"severity"`
	// Reason: Plugin-authored note on what claiming the name gets an attacker.
	Reason string `json:"reason"`
	// ClaimLabel: The instance-identifying part of the hostname, e.g. the bucket
	// or app name.
	ClaimLabel string `json:"claimLabel"`
}

DNSTargetService: Set only when classification is "dangling".

Spec schema: `DnsTargetService`.

The API may send null in its place.

type DNSZone added in v0.43.0

type DNSZone struct {
	ResourceID       string   `json:"resourceId"`
	PluginID         PluginID `json:"pluginId"`
	PluginName       string   `json:"pluginName"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
	AccountName      string   `json:"accountName"`
	Domain           string   `json:"domain"`
	Status           *string  `json:"status"`
	// IsPrivate: Split-horizon/internal zone; listed but never analysed for
	// takeover.
	IsPrivate bool `json:"isPrivate"`
	// RecordCount: Records synced into this zone.
	RecordCount int64 `json:"recordCount"`
	// ProviderRecordCount: The provider's own record count, when reported. May
	// exceed `recordCount` — several plugins list zones without listing their
	// records.
	ProviderRecordCount *int64 `json:"providerRecordCount"`
	DanglingCount       int64  `json:"danglingCount"`
}

DNSZone is the `DnsZone` schema.

Spec schema: `DnsZone`.

type Dashboard

type Dashboard struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	IsDefault bool   `json:"isDefault"`
}

Dashboard is the `Dashboard` schema.

type DashboardFull

type DashboardFull struct {
	ID             string  `json:"id"`
	OrganizationID string  `json:"organizationId"`
	Name           string  `json:"name"`
	IsDefault      bool    `json:"isDefault"`
	CreatedAt      string  `json:"createdAt"`
	UpdatedAt      string  `json:"updatedAt"`
	DeletedAt      *string `json:"deletedAt"`
	SyncVersion    int64   `json:"syncVersion"`
}

DashboardFull is the `DashboardFull` schema.

type DashboardPin

type DashboardPin struct {
	PinID      string     `json:"pinId"`
	ResourceID ResourceID `json:"resourceId"`
	GridX      int64      `json:"gridX"`
	GridY      int64      `json:"gridY"`
	GridW      int64      `json:"gridW"`
	GridH      int64      `json:"gridH"`
}

DashboardPin is the `DashboardPin` schema.

type DashboardWidget

type DashboardWidget struct {
	ID          string              `json:"id"`
	DashboardID string              `json:"dashboardId"`
	Kind        DashboardWidgetKind `json:"kind"`
	Title       string              `json:"title"`
	Config      JSONObject          `json:"config"`
	GridX       int64               `json:"gridX"`
	GridY       int64               `json:"gridY"`
	GridW       int64               `json:"gridW"`
	GridH       int64               `json:"gridH"`
}

DashboardWidget is the `DashboardWidget` schema.

type DashboardWidgetFull

type DashboardWidgetFull struct {
	ID             string              `json:"id"`
	OrganizationID string              `json:"organizationId"`
	DashboardID    string              `json:"dashboardId"`
	Kind           DashboardWidgetKind `json:"kind"`
	Title          string              `json:"title"`
	Config         JSONObject          `json:"config"`
	GridX          int64               `json:"gridX"`
	GridY          int64               `json:"gridY"`
	GridW          int64               `json:"gridW"`
	GridH          int64               `json:"gridH"`
	SyncVersion    int64               `json:"syncVersion"`
	DeletedAt      *string             `json:"deletedAt"`
	CreatedAt      string              `json:"createdAt"`
	UpdatedAt      string              `json:"updatedAt"`
}

DashboardWidgetFull is the `DashboardWidgetFull` schema.

type DashboardWidgetKind

type DashboardWidgetKind = string

DashboardWidgetKind: `cost_graph` stores its whole config inline — a one-off card. `cost_report` points at a saved cost report by id, so editing the report updates every dashboard showing it.

const (
	DashboardWidgetKindCostGraph   DashboardWidgetKind = "cost_graph"
	DashboardWidgetKindCostReport  DashboardWidgetKind = "cost_report"
	DashboardWidgetKindBudget      DashboardWidgetKind = "budget"
	DashboardWidgetKindCustomGraph DashboardWidgetKind = "custom_graph"
)

The values DashboardWidgetKind takes.

type DashboardWithPins

type DashboardWithPins struct {
	Dashboard    DashboardFull          `json:"dashboard"`
	Pins         []DashboardPin         `json:"pins"`
	WorkflowPins []DashboardWorkflowPin `json:"workflowPins"`
	Widgets      []DashboardWidget      `json:"widgets"`
}

DashboardWithPins is the `DashboardWithPins` schema.

type DashboardWorkflowPin

type DashboardWorkflowPin struct {
	PinID      string                        `json:"pinId"`
	WorkflowID string                        `json:"workflowId"`
	GridX      int64                         `json:"gridX"`
	Name       string                        `json:"name"`
	LastRunAt  *string                       `json:"lastRunAt"`
	LastStatus *string                       `json:"lastStatus"`
	Metrics    []DashboardWorkflowPinMetrics `json:"metrics"`
}

DashboardWorkflowPin is the `DashboardWorkflowPin` schema.

type DashboardWorkflowPinMetrics

type DashboardWorkflowPinMetrics struct {
	Key   string  `json:"key"`
	Label string  `json:"label"`
	Unit  *string `json:"unit"`
	Value any     `json:"value,omitempty"`
}

DashboardWorkflowPinMetrics is an object the spec declares inline.

type DashboardsCreateParams

type DashboardsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body DashboardsCreateRequest
}

DashboardsCreateParams holds the parameters for `client.dashboards.create`.

type DashboardsCreateRequest

type DashboardsCreateRequest struct {
	Name string `json:"name"`
}

DashboardsCreateRequest is an object the spec declares inline.

type DashboardsDefaultFullParams

type DashboardsDefaultFullParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

DashboardsDefaultFullParams holds the parameters for `client.dashboards.default.full`.

Every field is optional; pass nil to take the defaults.

type DashboardsDefaultNamespace

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

DashboardsDefaultNamespace is `client.dashboards.default`.

func (*DashboardsDefaultNamespace) Full

Full: Get-or-create the default dashboard with its pins

_Requires permission: `dashboards:read`._

GET /api/org/{orgId}/dashboards/default/full

type DashboardsDeleteParams

type DashboardsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

DashboardsDeleteParams holds the parameters for `client.dashboards.delete`.

type DashboardsGetParams

type DashboardsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

DashboardsGetParams holds the parameters for `client.dashboards.get`.

type DashboardsListParams

type DashboardsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

DashboardsListParams holds the parameters for `client.dashboards.list`.

Every field is optional; pass nil to take the defaults.

type DashboardsNamespace

type DashboardsNamespace struct {

	// Default: `client.dashboards.default`.
	Default *DashboardsDefaultNamespace
	// Pin: `client.dashboards.pin`.
	Pin *DashboardsPinNamespace
	// Widgets: `client.dashboards.widgets`.
	Widgets *DashboardsWidgetsNamespace
	// contains filtered or unexported fields
}

DashboardsNamespace is `client.dashboards`.

func (*DashboardsNamespace) Create

Create: Create a dashboard

_Requires permission: `dashboards:write`._

POST /api/org/{orgId}/dashboards

func (*DashboardsNamespace) Delete

func (n *DashboardsNamespace) Delete(ctx context.Context, params DashboardsDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete a dashboard

Cannot delete the default dashboard.

_Requires permission: `dashboards:write`._

DELETE /api/org/{orgId}/dashboards/{id}

Raises on 400: Bad request

Raises on 404: Not found

func (*DashboardsNamespace) Get

Get: Get a dashboard with its pins

_Requires permission: `dashboards:read`._

GET /api/org/{orgId}/dashboards/{id}

Raises on 404: Not found

func (*DashboardsNamespace) List

List: List dashboards

_Requires permission: `dashboards:read`._

GET /api/org/{orgId}/dashboards

func (*DashboardsNamespace) Probe

Probe: Read cached stats/metrics for dashboard cards

_Requires permission: `dashboards:read`._

POST /api/org/{orgId}/dashboards/probe

func (*DashboardsNamespace) Rename

func (n *DashboardsNamespace) Rename(ctx context.Context, params DashboardsRenameParams, opts ...RequestOption) (*OK, error)

Rename: Rename a dashboard

_Requires permission: `dashboards:write`._

POST /api/org/{orgId}/dashboards/{id}/rename

func (*DashboardsNamespace) Reorder

func (n *DashboardsNamespace) Reorder(ctx context.Context, params DashboardsReorderParams, opts ...RequestOption) (*OK, error)

Reorder: Reorder dashboard cards

Persists the order of a dashboard's grid. Pass `cards` to order resource pins, workflow pins, and widgets as one sequence; `resourceIds` orders resource pins alone.

_Requires permission: `dashboards:write`._

POST /api/org/{orgId}/dashboards/{id}/reorder

Raises on 404: Not found

func (*DashboardsNamespace) Unpin

func (n *DashboardsNamespace) Unpin(ctx context.Context, params DashboardsUnpinParams, opts ...RequestOption) (*OK, error)

Unpin: Unpin a resource

_Requires permission: `dashboards:write`._

POST /api/org/{orgId}/dashboards/unpin

Raises on 404: Not found

func (*DashboardsNamespace) ValidateTabs

ValidateTabs: Validate workspace tab targets still exist

_Requires permission: `dashboards:read`._

POST /api/org/{orgId}/dashboards/validate-tabs

func (*DashboardsNamespace) WorkflowPin

func (n *DashboardsNamespace) WorkflowPin(ctx context.Context, params DashboardsWorkflowPinParams, opts ...RequestOption) (*OK, error)

WorkflowPin: Pin a workflow's metrics to a dashboard

POST /api/org/{orgId}/dashboards/workflow-pin

Raises on 404: Not found

func (*DashboardsNamespace) WorkflowUnpin

func (n *DashboardsNamespace) WorkflowUnpin(ctx context.Context, params DashboardsWorkflowUnpinParams, opts ...RequestOption) (*OK, error)

WorkflowUnpin: Unpin a workflow from a dashboard

POST /api/org/{orgId}/dashboards/workflow-unpin

Raises on 404: Not found

type DashboardsPinCreateParams

type DashboardsPinCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body PinRequest
}

DashboardsPinCreateParams holds the parameters for `client.dashboards.pin.create`.

type DashboardsPinGetParams

type DashboardsPinGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	PinID string
}

DashboardsPinGetParams holds the parameters for `client.dashboards.pin.get`.

type DashboardsPinNamespace

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

DashboardsPinNamespace is `client.dashboards.pin`.

func (*DashboardsPinNamespace) Create

Create: Pin a resource to a dashboard

_Requires permission: `dashboards:write`._

POST /api/org/{orgId}/dashboards/pin

Raises on 404: Not found

func (*DashboardsPinNamespace) Get

Get: Full enriched pin data + cached probe status

_Requires permission: `dashboards:read`._

GET /api/org/{orgId}/dashboards/pin/{pinId}

Raises on 404: Not found

func (*DashboardsPinNamespace) Range

Range: Historical metric series for a pinned resource

Returns per-series metric points between fromMs and toMs. The backend auto-routes between raw, 1-minute, and 1-hour rollups based on span: ≤2h raw, ≤7d 1m, >7d 1h.

GET /api/org/{orgId}/dashboards/pin/{pinId}/range

Raises on 400: Bad request

Raises on 404: Not found

type DashboardsPinRangeParams

type DashboardsPinRangeParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID  *string
	PinID  string
	FromMs *int64
	ToMs   *int64
}

DashboardsPinRangeParams holds the parameters for `client.dashboards.pin.range`.

type DashboardsProbeParams

type DashboardsProbeParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ProbeRequest
}

DashboardsProbeParams holds the parameters for `client.dashboards.probe`.

type DashboardsRenameParams

type DashboardsRenameParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body DashboardsRenameRequest
}

DashboardsRenameParams holds the parameters for `client.dashboards.rename`.

type DashboardsRenameRequest

type DashboardsRenameRequest struct {
	Name string `json:"name"`
}

DashboardsRenameRequest is an object the spec declares inline.

type DashboardsReorderParams

type DashboardsReorderParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body ReorderRequest
}

DashboardsReorderParams holds the parameters for `client.dashboards.reorder`.

type DashboardsUnpinParams

type DashboardsUnpinParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body UnpinRequest
}

DashboardsUnpinParams holds the parameters for `client.dashboards.unpin`.

type DashboardsValidateTabsParams

type DashboardsValidateTabsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ValidateTabsRequest
}

DashboardsValidateTabsParams holds the parameters for `client.dashboards.validateTabs`.

type DashboardsWidgetsCreateParams

type DashboardsWidgetsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreateWidgetRequest
}

DashboardsWidgetsCreateParams holds the parameters for `client.dashboards.widgets.create`.

type DashboardsWidgetsDeleteParams

type DashboardsWidgetsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	WidgetID string
}

DashboardsWidgetsDeleteParams holds the parameters for `client.dashboards.widgets.delete`.

type DashboardsWidgetsNamespace

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

DashboardsWidgetsNamespace is `client.dashboards.widgets`.

func (*DashboardsWidgetsNamespace) Create

Create: Add a cost-graph or budget widget to a dashboard

POST /api/org/{orgId}/dashboards/widgets

Raises on 400: Bad request

Raises on 404: Not found

func (*DashboardsWidgetsNamespace) Delete

Delete: Remove a widget from a dashboard

DELETE /api/org/{orgId}/dashboards/widgets/{widgetId}

Raises on 404: Not found

func (*DashboardsWidgetsNamespace) Update

Update: Update a widget's title, config, or layout

PATCH /api/org/{orgId}/dashboards/widgets/{widgetId}

Raises on 400: Bad request

Raises on 404: Not found

type DashboardsWidgetsUpdateParams

type DashboardsWidgetsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	WidgetID string
	// Body: the JSON request body.
	Body UpdateWidgetRequest
}

DashboardsWidgetsUpdateParams holds the parameters for `client.dashboards.widgets.update`.

type DashboardsWorkflowPinParams

type DashboardsWorkflowPinParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body WorkflowPinRequest
}

DashboardsWorkflowPinParams holds the parameters for `client.dashboards.workflowPin`.

type DashboardsWorkflowUnpinParams

type DashboardsWorkflowUnpinParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body WorkflowPinRequest
}

DashboardsWorkflowUnpinParams holds the parameters for `client.dashboards.workflowUnpin`.

type DependencyGraphEdge added in v0.25.0

type DependencyGraphEdge struct {
	ConsumerResourceID ResourceID `json:"consumerResourceId"`
	// ConsumerFieldKey: The consumer field the reference fills. "parent" for
	// containment edges, where the link is the resource hierarchy itself rather
	// than a field.
	ConsumerFieldKey   string     `json:"consumerFieldKey"`
	ProviderResourceID ResourceID `json:"providerResourceId"`
	// ProviderOutputKey: The provider output or identity the reference reads —
	// an output key for output references, the matched identity ("externalId",
	// "name", "endpoint"…) for inferred edges.
	ProviderOutputKey string `json:"providerOutputKey"`
	// Kind: Where the edge came from: `output-ref` is wired by hand, `declared`
	// from the plugin's own `dependsOn` rule for the resource type,
	// `containment` from the synced parent/child link, `field-match` from a
	// field value that exactly matches another resource's identity. Absent means
	// `output-ref`.
	//
	// One of "output-ref", "declared", "containment", "field-match".
	Kind *string `json:"kind,omitempty"`
	// Label: How the plugin words the relationship ("in VPC", "guarded by"),
	// when it declared one.
	Label *string `json:"label,omitempty"`
}

DependencyGraphEdge is the `DependencyGraphEdge` schema.

type DependencyGraphGetParams added in v0.25.0

type DependencyGraphGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ResourceID *ResourceID
}

DependencyGraphGetParams holds the parameters for `client.dependencyGraph.get`.

Every field is optional; pass nil to take the defaults.

type DependencyGraphNamespace added in v0.25.0

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

DependencyGraphNamespace is `client.dependencyGraph`.

func (*DependencyGraphNamespace) Get added in v0.25.0

Get: The org's resource dependency graph, from synced cloud data and output references

_Requires permission: `resources:read`._

GET /api/org/{orgId}/dependency-graph

type DependencyGraphNode added in v0.25.0

type DependencyGraphNode struct {
	ID                ResourceID `json:"id"`
	DisplayName       string     `json:"displayName"`
	PluginID          string     `json:"pluginId"`
	PluginDisplayName string     `json:"pluginDisplayName"`
	// PluginLogoSvg: Inline SVG markup; may be empty.
	PluginLogoSvg     string `json:"pluginLogoSvg"`
	ResourceTypeID    string `json:"resourceTypeId"`
	ResourceTypeLabel string `json:"resourceTypeLabel"`
	AccountID         string `json:"accountId"`
	AccountName       string `json:"accountName"`
}

DependencyGraphNode is the `DependencyGraphNode` schema.

type DependencyGraphResponse added in v0.25.0

type DependencyGraphResponse struct {
	// Nodes: Org resources that participate in at least one edge.
	Nodes []DependencyGraphNode `json:"nodes"`
	// Edges: Directed depends-on edges (consumer → provider), deduped per
	// consumer field and provider.
	Edges []DependencyGraphEdge `json:"edges"`
	// Truncated: True when inference hit its edge cap and the returned graph is
	// a partial view of the org.
	Truncated bool `json:"truncated"`
}

DependencyGraphResponse is the `DependencyGraphResponse` schema.

type DeployCreatedResource added in v0.15.0

type DeployCreatedResource struct {
	PluginID       string                        `json:"pluginId"`
	AccountID      string                        `json:"accountId"`
	ResourceTypeID string                        `json:"resourceTypeId"`
	ResourceID     string                        `json:"resourceId"`
	ExternalID     *string                       `json:"externalId,omitempty"`
	DisplayName    string                        `json:"displayName"`
	Sidecar        *DeployCreatedResourceSidecar `json:"sidecar,omitempty"`
}

DeployCreatedResource is the `DeployCreatedResource` schema.

type DeployCreatedResourceSidecar added in v0.15.0

type DeployCreatedResourceSidecar struct {
	PluginID         string `json:"pluginId"`
	ParentResourceID string `json:"parentResourceId"`
}

DeployCreatedResourceSidecar is an object the spec declares inline.

type DeployEnvs added in v0.11.0

type DeployEnvs struct {
	Envs   []string `json:"envs"`
	Sha    string   `json:"sha"`
	Repo   string   `json:"repo"`
	Branch string   `json:"branch"`
}

DeployEnvs is the `DeployEnvs` schema.

type DeployEnvsInput added in v0.11.0

type DeployEnvsInput struct {
	Repo   string  `json:"repo"`
	Branch *string `json:"branch,omitempty"`
}

DeployEnvsInput is the `DeployEnvsInput` schema.

type DeployPlanInput added in v0.11.0

type DeployPlanInput struct {
	Repo    string            `json:"repo"`
	Branch  *string           `json:"branch,omitempty"`
	Env     *string           `json:"env,omitempty"`
	Answers map[string]string `json:"answers,omitempty"`
}

DeployPlanInput is the `DeployPlanInput` schema.

type DeployPlanResult added in v0.11.0

type DeployPlanResult struct {
	RunID  string                 `json:"runId"`
	Result DeployPlanResultResult `json:"result"`
}

DeployPlanResult is the `DeployPlanResult` schema.

type DeployPlanResultResult added in v0.11.0

type DeployPlanResultResult struct {
	Status           DeployStatus                 `json:"status"`
	Env              string                       `json:"env"`
	Plan             any                          `json:"plan,omitempty"`
	Dockerfile       *string                      `json:"dockerfile,omitempty"`
	Image            *string                      `json:"image,omitempty"`
	Notes            []string                     `json:"notes"`
	CreatedResources []DeployCreatedResource      `json:"createdResources"`
	PlannedChanges   []DeployPlannedChange        `json:"plannedChanges"`
	Logs             []DeployRunLog               `json:"logs"`
	ReachedStage     *DeployStage                 `json:"reachedStage,omitempty"`
	Error            *DeployPlanResultResultError `json:"error,omitempty"`
	DurationMs       int64                        `json:"durationMs"`
}

DeployPlanResultResult is an object the spec declares inline.

type DeployPlanResultResultError added in v0.11.0

type DeployPlanResultResultError struct {
	Message string  `json:"message"`
	Stack   *string `json:"stack,omitempty"`
}

DeployPlanResultResultError is an object the spec declares inline.

type DeployPlannedChange added in v0.15.0

type DeployPlannedChange struct {
	// Action: One of "create", "update", "delete".
	Action         string                      `json:"action"`
	AccountID      string                      `json:"accountId"`
	ResourceTypeID string                      `json:"resourceTypeId"`
	ResourceID     *string                     `json:"resourceId,omitempty"`
	DisplayName    string                      `json:"displayName"`
	Fields         map[string]string           `json:"fields,omitempty"`
	Sidecar        *DeployPlannedChangeSidecar `json:"sidecar,omitempty"`
}

DeployPlannedChange is the `DeployPlannedChange` schema.

type DeployPlannedChangeSidecar added in v0.15.0

type DeployPlannedChangeSidecar struct {
	PluginID         string `json:"pluginId"`
	ParentResourceID string `json:"parentResourceId"`
}

DeployPlannedChangeSidecar is an object the spec declares inline.

type DeployRepo added in v0.11.0

type DeployRepo struct {
	FullName      string `json:"fullName"`
	DefaultBranch string `json:"defaultBranch"`
}

DeployRepo is the `DeployRepo` schema.

type DeployRollbackInput added in v0.15.0

type DeployRollbackInput struct {
	DeleteCreated *bool `json:"deleteCreated,omitempty"`
}

DeployRollbackInput is the `DeployRollbackInput` schema.

type DeployRunLog added in v0.11.0

type DeployRunLog struct {
	At int64 `json:"at"`
	// Level: One of "debug", "info", "warn", "error".
	Level   string `json:"level"`
	Message string `json:"message"`
}

DeployRunLog is the `DeployRunLog` schema.

type DeployStage added in v0.11.0

type DeployStage = string

DeployStage is the `DeployStage` schema.

const (
	DeployStagePlan       DeployStage = "plan"
	DeployStageDockerfile DeployStage = "dockerfile"
	DeployStageBuild      DeployStage = "build"
	DeployStageDeploy     DeployStage = "deploy"
	DeployStageDestroy    DeployStage = "destroy"
)

The values DeployStage takes.

type DeployStatus added in v0.11.0

type DeployStatus = string

DeployStatus is the `DeployStatus` schema.

const (
	DeployStatusPending  DeployStatus = "pending"
	DeployStatusRunning  DeployStatus = "running"
	DeployStatusSuccess  DeployStatus = "success"
	DeployStatusFailure  DeployStatus = "failure"
	DeployStatusCanceled DeployStatus = "canceled"
)

The values DeployStatus takes.

type DeployTrigger added in v0.11.0

type DeployTrigger struct {
	ID        string  `json:"id"`
	Repo      string  `json:"repo"`
	Branch    string  `json:"branch"`
	Env       string  `json:"env"`
	Enabled   bool    `json:"enabled"`
	LastSha   *string `json:"lastSha"`
	LastRunAt *string `json:"lastRunAt"`
}

DeployTrigger is the `DeployTrigger` schema.

type DeployTriggerInput added in v0.11.0

type DeployTriggerInput struct {
	Repo    string            `json:"repo"`
	Branch  string            `json:"branch"`
	Env     string            `json:"env"`
	Answers map[string]string `json:"answers,omitempty"`
}

DeployTriggerInput is the `DeployTriggerInput` schema.

type DeploymentCostImpact added in v1.18.0

type DeploymentCostImpact struct {
	RunID      string          `json:"runId"`
	CostBasis  ChangeCostBasis `json:"costBasis"`
	WindowDays int64           `json:"windowDays"`
	// EventDay: The run's start day, UTC — what both windows hang off.
	EventDay string `json:"eventDay"`
	// Resources: One row per resource the run provisioned through
	// `infra.accounts.*.create(...)`. That is the only set attributable to a run
	// with certainty: a deploy that merely re-shipped an image links to nothing
	// and honestly reports an empty breakdown.
	Resources []DeploymentCostImpactResource `json:"resources"`
	// Total: Summed `deltaPerDay` per currency across the **measured** rows
	// only, so the breakdown always adds up to it. An unmeasurable resource
	// contributes nothing rather than zero.
	Total []DeploymentCostImpactTotal `json:"total"`
	// UnknownResources: Rows excluded from `total` because their impact could
	// not be measured.
	UnknownResources int64                      `json:"unknownResources"`
	Confidence       ChangeCostImpactConfidence `json:"confidence"`
}

DeploymentCostImpact is the `DeploymentCostImpact` schema.

type DeploymentCostImpactResource added in v1.18.0

type DeploymentCostImpactResource struct {
	ResourceID     ResourceID       `json:"resourceId"`
	DisplayName    string           `json:"displayName"`
	PluginID       string           `json:"pluginId"`
	ResourceTypeID string           `json:"resourceTypeId"`
	Impact         ChangeCostImpact `json:"impact"`
}

DeploymentCostImpactResource is the `DeploymentCostImpactResource` schema.

type DeploymentCostImpactTotal added in v1.18.0

type DeploymentCostImpactTotal struct {
	Currency    string  `json:"currency"`
	DeltaPerDay float64 `json:"deltaPerDay"`
}

DeploymentCostImpactTotal is an object the spec declares inline.

type DeploymentRun added in v0.11.0

type DeploymentRun struct {
	ID     string       `json:"id"`
	Env    string       `json:"env"`
	Repo   *string      `json:"repo"`
	Branch *string      `json:"branch"`
	GitSha *string      `json:"gitSha"`
	Image  *string      `json:"image"`
	Status DeployStatus `json:"status"`
	// Origin: One of "web", "cli", "trigger".
	Origin       string       `json:"origin"`
	Stage        *DeployStage `json:"stage"`
	DurationMs   *int64       `json:"durationMs"`
	BuildSeconds *int64       `json:"buildSeconds"`
	// BuildRunner: One of "cloud-build", "ssh".
	BuildRunner *string `json:"buildRunner"`
	StartedAt   string  `json:"startedAt"`
}

DeploymentRun is the `DeploymentRun` schema.

type DeploymentRunInput added in v0.11.0

type DeploymentRunInput struct {
	Env              string                   `json:"env"`
	Status           DeployStatus             `json:"status"`
	Repo             *string                  `json:"repo,omitempty"`
	Branch           *string                  `json:"branch,omitempty"`
	GitSha           *string                  `json:"gitSha,omitempty"`
	Image            *string                  `json:"image,omitempty"`
	Stage            *DeployStage             `json:"stage,omitempty"`
	Notes            []string                 `json:"notes,omitempty"`
	Output           any                      `json:"output,omitempty"`
	Plan             any                      `json:"plan,omitempty"`
	CreatedResources []DeployCreatedResource  `json:"createdResources,omitempty"`
	DurationMs       *int64                   `json:"durationMs,omitempty"`
	Error            *DeploymentRunInputError `json:"error,omitempty"`
}

DeploymentRunInput is the `DeploymentRunInput` schema.

type DeploymentRunInputError added in v0.11.0

type DeploymentRunInputError struct {
	Message string `json:"message"`
}

DeploymentRunInputError is an object the spec declares inline.

type DeploymentsEnvsParams added in v0.11.0

type DeploymentsEnvsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *DeployEnvsInput
}

DeploymentsEnvsParams holds the parameters for `client.deployments.envs`.

Every field is optional; pass nil to take the defaults.

type DeploymentsNamespace added in v0.11.0

type DeploymentsNamespace struct {

	// Runs: `client.deployments.runs`.
	Runs *DeploymentsRunsNamespace
	// Triggers: `client.deployments.triggers`.
	Triggers *DeploymentsTriggersNamespace
	// contains filtered or unexported fields
}

DeploymentsNamespace is `client.deployments`.

func (*DeploymentsNamespace) Envs added in v0.11.0

Envs: List the environments a repository's Infrafile declares

Reads `Infrafile` at the branch head and returns its declared environments. The file is parsed, not executed.

_Requires permission: `deployments:read`._

POST /api/org/{orgId}/deployments/envs

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 403: Forbidden

Raises on 404: Not found

func (*DeploymentsNamespace) Plan added in v0.11.0

Plan: Preview a deploy without building

Runs the Infrafile's `plan()` and renders its Dockerfile, then stops. Nothing is built or deployed.

_Requires permission: `deployments:plan`._

POST /api/org/{orgId}/deployments/plan

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 403: Forbidden

Raises on 404: Not found

func (*DeploymentsNamespace) Repos added in v0.11.0

Repos: List repositories this organization can deploy from

Repositories visible to the organization's GitHub App installations. Empty when the app is not configured.

_Requires permission: `deployments:read`._

GET /api/org/{orgId}/deployments/repos

Raises on 401: Unauthenticated

Raises on 403: Forbidden

type DeploymentsPlanParams added in v0.11.0

type DeploymentsPlanParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *DeployPlanInput
}

DeploymentsPlanParams holds the parameters for `client.deployments.plan`.

Every field is optional; pass nil to take the defaults.

type DeploymentsReposParams added in v0.11.0

type DeploymentsReposParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

DeploymentsReposParams holds the parameters for `client.deployments.repos`.

Every field is optional; pass nil to take the defaults.

type DeploymentsRunsCostImpactParams added in v1.18.0

type DeploymentsRunsCostImpactParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ID         string
	WindowDays *int64
	// CostBasis: Which charge-type basis both windows are read on. `cash` (the
	// default) is what the provider charged on the day it charged it;
	// `amortized` spreads a commitment's up-front fee across the term it buys.
	// It is echoed on every response because a delta whose basis is unstated is
	// unreadable — an amortized 'after' against a cash 'before' looks exactly
	// like a saving.
	CostBasis *ChangeCostBasis
}

DeploymentsRunsCostImpactParams holds the parameters for `client.deployments.runs.costImpact`.

type DeploymentsRunsCreateParams added in v0.11.0

type DeploymentsRunsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *DeploymentRunInput
}

DeploymentsRunsCreateParams holds the parameters for `client.deployments.runs.create`.

Every field is optional; pass nil to take the defaults.

type DeploymentsRunsCreateResponse added in v0.11.0

type DeploymentsRunsCreateResponse struct {
	ID string `json:"id"`
}

DeploymentsRunsCreateResponse is an object the spec declares inline.

type DeploymentsRunsGetParams added in v0.11.0

type DeploymentsRunsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

DeploymentsRunsGetParams holds the parameters for `client.deployments.runs.get`.

type DeploymentsRunsListParams added in v0.11.0

type DeploymentsRunsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	Env   *string
	Limit *int64
}

DeploymentsRunsListParams holds the parameters for `client.deployments.runs.list`.

Every field is optional; pass nil to take the defaults.

type DeploymentsRunsNamespace added in v0.11.0

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

DeploymentsRunsNamespace is `client.deployments.runs`.

func (*DeploymentsRunsNamespace) CostImpact added in v1.18.0

CostImpact: Cost impact of a deployment run

The same comparison as `POST /changes/cost-impacts`, run over the resources this deploy provisioned, with a per-resource breakdown that sums to the total.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/deployments/runs/{id}/cost-impact

Raises on 400: Bad request

Raises on 404: Not found

func (*DeploymentsRunsNamespace) Create added in v0.11.0

Create: Record a deployment that ran elsewhere

The CLI builds on the operator's own machine, so the server never sees that run. Reporting it here keeps one history across both origins.

_Requires permission: `deployments:write`._

POST /api/org/{orgId}/deployments/runs

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 403: Forbidden

func (*DeploymentsRunsNamespace) Get added in v0.11.0

Get: Get one deployment run, with its logs and rendered Dockerfile

_Requires permission: `deployments:read`._

GET /api/org/{orgId}/deployments/runs/{id}

Raises on 401: Unauthenticated

Raises on 403: Forbidden

Raises on 404: Not found

func (*DeploymentsRunsNamespace) List added in v0.11.0

List: List deployment runs

_Requires permission: `deployments:read`._

GET /api/org/{orgId}/deployments/runs

Raises on 401: Unauthenticated

Raises on 403: Forbidden

func (*DeploymentsRunsNamespace) Rollback added in v0.11.0

Rollback: Roll back to a previous deployment

Re-runs that run's `deploy()` with the image and plan it recorded, building nothing — the exact artifact that was known good ships again. The Infrafile is read at the commit that run deployed, not at the branch head. Only a successful run that produced an image can be rolled back to. With `deleteCreated`, resources that runs after the target created through `infra.accounts` are deleted once the rollback has succeeded — undoing the provisioning, not just the shipping. Deletions are best-effort and reported in the result's notes.

_Requires permission: `deployments:write`._

POST /api/org/{orgId}/deployments/runs/{id}/rollback

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 402: Payment required — the organization's plan does not include this

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

type DeploymentsRunsRollbackParams added in v0.11.0

type DeploymentsRunsRollbackParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body *DeployRollbackInput
}

DeploymentsRunsRollbackParams holds the parameters for `client.deployments.runs.rollback`.

type DeploymentsTriggersCreateParams added in v0.11.0

type DeploymentsTriggersCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *DeployTriggerInput
}

DeploymentsTriggersCreateParams holds the parameters for `client.deployments.triggers.create`.

Every field is optional; pass nil to take the defaults.

type DeploymentsTriggersDeleteParams added in v0.11.0

type DeploymentsTriggersDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

DeploymentsTriggersDeleteParams holds the parameters for `client.deployments.triggers.delete`.

type DeploymentsTriggersListParams added in v0.11.0

type DeploymentsTriggersListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

DeploymentsTriggersListParams holds the parameters for `client.deployments.triggers.list`.

Every field is optional; pass nil to take the defaults.

type DeploymentsTriggersNamespace added in v0.11.0

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

DeploymentsTriggersNamespace is `client.deployments.triggers`.

func (*DeploymentsTriggersNamespace) Create added in v0.11.0

Create: Deploy an environment whenever a branch moves

Arming a trigger records the branch's current commit WITHOUT deploying it — the trigger fires on the next push, not on the state at the moment it was created. The environment is validated against the Infrafile at that branch head, so a typo fails here rather than silently never firing.

_Requires permission: `deployments:write`._

POST /api/org/{orgId}/deployments/triggers

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 403: Forbidden

Raises on 404: Not found

func (*DeploymentsTriggersNamespace) Delete added in v0.11.0

Delete: Delete a deploy trigger

_Requires permission: `deployments:write`._

DELETE /api/org/{orgId}/deployments/triggers/{id}

Raises on 401: Unauthenticated

Raises on 403: Forbidden

func (*DeploymentsTriggersNamespace) List added in v0.11.0

List: List deploy-on-push triggers

_Requires permission: `deployments:read`._

GET /api/org/{orgId}/deployments/triggers

Raises on 401: Unauthenticated

Raises on 403: Forbidden

func (*DeploymentsTriggersNamespace) Update added in v0.11.0

Update: Enable or disable a deploy trigger

_Requires permission: `deployments:write`._

PATCH /api/org/{orgId}/deployments/triggers/{id}

Raises on 401: Unauthenticated

Raises on 403: Forbidden

Raises on 404: Not found

type DeploymentsTriggersUpdateParams added in v0.11.0

type DeploymentsTriggersUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body *DeploymentsTriggersUpdateRequest
}

DeploymentsTriggersUpdateParams holds the parameters for `client.deployments.triggers.update`.

type DeploymentsTriggersUpdateRequest added in v0.11.0

type DeploymentsTriggersUpdateRequest struct {
	Enabled bool `json:"enabled"`
}

DeploymentsTriggersUpdateRequest is an object the spec declares inline.

type DescribeRequest

type DescribeRequest struct {
	AccountID        string      `json:"accountId"`
	ResourceID       ResourceID  `json:"resourceId"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

DescribeRequest is the `DescribeRequest` schema.

type DescribeResponse

type DescribeResponse struct {
	Text string `json:"text"`
}

DescribeResponse is the `DescribeResponse` schema.

type DigestEmailRecipient added in v0.27.0

type DigestEmailRecipient struct {
	ID    string `json:"id"`
	Email string `json:"email"`
}

DigestEmailRecipient is the `DigestEmailRecipient` schema.

type DigestEmailRecipientCreate added in v0.27.0

type DigestEmailRecipientCreate struct {
	Email string `json:"email"`
}

DigestEmailRecipientCreate is the `DigestEmailRecipientCreate` schema.

type DigestEmailRecipientList added in v0.27.0

type DigestEmailRecipientList struct {
	Recipients []DigestEmailRecipient `json:"recipients"`
}

DigestEmailRecipientList is the `DigestEmailRecipientList` schema.

type DigestGetParams added in v0.20.0

type DigestGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

DigestGetParams holds the parameters for `client.digest.get`.

Every field is optional; pass nil to take the defaults.

type DigestNamespace added in v0.20.0

type DigestNamespace struct {

	// Recipients: `client.digest.recipients`.
	Recipients *DigestRecipientsNamespace
	// contains filtered or unexported fields
}

DigestNamespace is `client.digest`.

func (*DigestNamespace) Get added in v0.20.0

Get: Get the organization's weekly digest settings

The weekly digest is a summary of the last complete Monday-to-Sunday week's spend (with week-over-week movers), sync incidents, and resource churn, delivered to the Slack channels and Teams webhooks opted into the weeklyDigest trigger and to the organization's digest email recipients. The response also carries the outcome of the most recent delivery attempt so a silently failing digest is visible.

GET /api/org/{orgId}/digest

func (*DigestNamespace) Send added in v0.20.0

Send: Compose and send last week's digest now

Ignores the schedule and the enabled flag — composes the digest for the last complete week and sends it to every opted-in channel and email recipient. This is also the manual recovery for a partial delivery, which is never retried automatically. Fails when nothing is routed to receive the digest, or when every destination rejected it.

POST /api/org/{orgId}/digest/send

Raises on 400: Bad request

func (*DigestNamespace) Update added in v0.20.0

Update: Update the weekly digest settings

Every field is optional. Enabling schedules the first digest for the next configured send time rather than sending immediately — use POST /digest/send for an immediate one. The week boundary follows `timezone`, so the reported window is always the organization's own local Monday-to-Sunday week. Changing the schedule clears any parked failure state but never replays a week that already went out.

PUT /api/org/{orgId}/digest

Raises on 400: Bad request

type DigestRecipientsCreateParams added in v0.27.0

type DigestRecipientsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *DigestEmailRecipientCreate
}

DigestRecipientsCreateParams holds the parameters for `client.digest.recipients.create`.

Every field is optional; pass nil to take the defaults.

type DigestRecipientsDeleteParams added in v0.27.0

type DigestRecipientsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// RecipientID: Recipient id
	RecipientID string
}

DigestRecipientsDeleteParams holds the parameters for `client.digest.recipients.delete`.

type DigestRecipientsDeleteResponse added in v0.27.0

type DigestRecipientsDeleteResponse struct {
	OK bool `json:"ok"`
}

DigestRecipientsDeleteResponse is an object the spec declares inline.

type DigestRecipientsGetParams added in v0.27.0

type DigestRecipientsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

DigestRecipientsGetParams holds the parameters for `client.digest.recipients.get`.

Every field is optional; pass nil to take the defaults.

type DigestRecipientsNamespace added in v0.27.0

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

DigestRecipientsNamespace is `client.digest.recipients`.

func (*DigestRecipientsNamespace) Create added in v0.27.0

Create: Add a digest email recipient

Adding an address the organization already has is a no-op that returns the existing entry, so a double submit cannot double-deliver.

POST /api/org/{orgId}/digest/recipients

Raises on 400: Bad request

func (*DigestRecipientsNamespace) Delete added in v0.27.0

Delete: Remove a digest email recipient

DELETE /api/org/{orgId}/digest/recipients/{recipientId}

Raises on 404: Not found

func (*DigestRecipientsNamespace) Get added in v0.27.0

Get: List the organization's digest email recipients

Email is a digest-only transport, so its destinations are an organization-level address list rather than a per-channel trigger. Addresses need not belong to Infrawrench users — a finance alias is a valid recipient.

GET /api/org/{orgId}/digest/recipients

type DigestSendParams added in v0.20.0

type DigestSendParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

DigestSendParams holds the parameters for `client.digest.send`.

Every field is optional; pass nil to take the defaults.

type DigestSendResult added in v0.20.0

type DigestSendResult struct {
	OK bool `json:"ok"`
	// Attempted: Deliveries attempted across Slack channels, Teams webhooks and
	// email recipients.
	Attempted int64                 `json:"attempted"`
	Succeeded int64                 `json:"succeeded"`
	Slack     DigestTransportResult `json:"slack"`
	Teams     DigestTransportResult `json:"teams"`
	Email     DigestTransportResult `json:"email"`
}

DigestSendResult is the `DigestSendResult` schema.

type DigestSettings added in v0.20.0

type DigestSettings struct {
	// Enabled: Whether the weekly digest is enabled for this organization.
	// Delivery targets are the Slack channels and Teams webhooks whose
	// weeklyDigest trigger is on, plus the organization's digest email
	// recipients.
	Enabled bool `json:"enabled"`
	// LastSentWeekStart: Monday (ISO date, in the organization's timezone) of
	// the last week a digest covered, or null when none has been sent.
	LastSentWeekStart *string `json:"lastSentWeekStart"`
	// LastSentAt: When a digest last actually reached a destination, or null if
	// none ever has.
	LastSentAt *string `json:"lastSentAt"`
	// Timezone: IANA time zone the schedule and the Monday-to-Sunday week
	// boundary are expressed in. Defaults to UTC.
	Timezone string `json:"timezone"`
	// SendDay: ISO day of week the digest is sent on: 1 = Monday … 7 = Sunday.
	SendDay int64 `json:"sendDay"`
	// SendHour: Local hour (0–23) in `timezone` the digest is sent at.
	SendHour int64 `json:"sendHour"`
	// NarrativeEnabled: Whether an AI-written summary paragraph is placed above
	// the deterministic content. Opt-in, default off. Failures are non-fatal:
	// the digest still sends without the paragraph.
	NarrativeEnabled bool `json:"narrativeEnabled"`
	// NarrativeAvailable: Whether this deployment has an LLM API key configured.
	// False means enabling the narrative has no effect.
	NarrativeAvailable bool `json:"narrativeAvailable"`
	// EmailAvailable: Whether this deployment has a mail provider configured.
	// False means email recipients are never delivered to.
	EmailAvailable bool `json:"emailAvailable"`
	// AttemptCount: Delivery attempts made for lastSentWeekStart's window,
	// including the first.
	AttemptCount  int64   `json:"attemptCount"`
	LastAttemptAt *string `json:"lastAttemptAt"`
	// LastStatus: Outcome of the most recent delivery attempt. `partial` (some
	// destinations took it, some failed) is deliberately never retried
	// automatically — a retry would post the digest twice where it already
	// landed. `failed` (nothing landed) is retried a bounded number of times
	// with backoff, then parked until the next week.
	//
	// One of "pending", "succeeded", "partial", "failed", "no_targets".
	LastStatus *string `json:"lastStatus"`
	// LastError: Why the last attempt was not a clean success, for display in
	// the settings UI.
	LastError *string `json:"lastError"`
	// NextAttemptAt: When the next automatic retry is due, or null when none is
	// scheduled.
	NextAttemptAt *string `json:"nextAttemptAt"`
}

DigestSettings is the `DigestSettings` schema.

type DigestSettingsUpdate added in v0.20.0

type DigestSettingsUpdate struct {
	Enabled *bool `json:"enabled,omitempty"`
	// Timezone: IANA time zone name. Rejected with 400 if the server does not
	// know the zone.
	Timezone         *string `json:"timezone,omitempty"`
	SendDay          *int64  `json:"sendDay,omitempty"`
	SendHour         *int64  `json:"sendHour,omitempty"`
	NarrativeEnabled *bool   `json:"narrativeEnabled,omitempty"`
}

DigestSettingsUpdate is the `DigestSettingsUpdate` schema.

type DigestTransportResult added in v0.27.0

type DigestTransportResult struct {
	Attempted int64 `json:"attempted"`
	Succeeded int64 `json:"succeeded"`
}

DigestTransportResult is the `DigestTransportResult` schema.

type DigestUpdateParams added in v0.20.0

type DigestUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *DigestSettingsUpdate
}

DigestUpdateParams holds the parameters for `client.digest.update`.

Every field is optional; pass nil to take the defaults.

type DismissedAccessFinding added in v1.16.0

type DismissedAccessFinding struct {
	// ResourceID: Infrawrench resource id the finding is on.
	ResourceID string `json:"resourceId"`
	// RuleID: Which rule was raised. Half of a dismissal's key, alongside the
	// resource id. The `access-review:` prefix is reserved so these can share
	// the posture dismissal store without colliding with plugin-declared posture
	// rule ids.
	//
	// One of "access-review:stale-principal", "access-review:admin-principal",
	// "access-review:key-past-rotation", "access-review:no-recorded-owner",
	// "access-review:no-mfa".
	RuleID string `json:"ruleId"`
	Title  string `json:"title"`
	// Severity: How bad the finding is. `critical` and `high` findings ride the
	// posture alert window; `medium` and `low` are review work surfaced on the
	// access review screen and in the weekly digest only.
	//
	// One of "critical", "high", "medium", "low".
	Severity string `json:"severity"`
	// Reason: Why this principal is flagged, in a sentence.
	Reason    string                `json:"reason"`
	Principal AccessPrincipal       `json:"principal"`
	Dismissal AccessReviewDismissal `json:"dismissal"`
}

DismissedAccessFinding is the `DismissedAccessFinding` schema.

type DismissedPostureFinding added in v0.43.0

type DismissedPostureFinding struct {
	// ResourceID: Infrawrench resource id.
	ResourceID       string   `json:"resourceId"`
	PluginID         PluginID `json:"pluginId"`
	PluginName       string   `json:"pluginName"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
	AccountName      string   `json:"accountName"`
	DisplayName      string   `json:"displayName"`
	// ExternalID: Provider-native id, when known.
	ExternalID *string `json:"externalId"`
	// RuleID: The matched rule's stable id, unique within the plugin.
	RuleID string `json:"ruleId"`
	// Title: Short rule title.
	Title string `json:"title"`
	// Severity: How bad the finding is. `critical` and `high` findings feed the
	// posture alerts; `medium` and `low` are hygiene work surfaced on the
	// posture screen only.
	//
	// One of "critical", "high", "medium", "low".
	Severity string `json:"severity"`
	// Category: Grouping bucket for what kind of exposure the finding describes.
	//
	// One of "public-exposure", "encryption", "credential-age",
	// "data-protection", "other".
	Category string `json:"category"`
	// Reason: Plugin-authored explanation of why this is a finding.
	Reason    string           `json:"reason"`
	Dismissal PostureDismissal `json:"dismissal"`
}

DismissedPostureFinding is the `DismissedPostureFinding` schema.

type DockerCommandParams

type DockerCommandParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body DockerCommandRequest
}

DockerCommandParams holds the parameters for `client.docker.command`.

type DockerCommandRequest

type DockerCommandRequest struct {
	AccountID string     `json:"accountId"`
	Op        string     `json:"op"`
	Params    JSONObject `json:"params,omitempty"`
}

DockerCommandRequest is the `DockerCommandRequest` schema.

type DockerCommandResponse

type DockerCommandResponse struct {
	Result any `json:"result,omitempty"`
}

DockerCommandResponse is the `DockerCommandResponse` schema.

type DockerNamespace

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

DockerNamespace is `client.docker`.

func (*DockerNamespace) Command

Command: Run a Docker daemon operation

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/docker/command

Raises on 400: Bad request

Raises on 404: Not found

type DriftAlertSettings added in v0.27.0

type DriftAlertSettings struct {
	// NotifyCreated: Alert on resources that appeared.
	NotifyCreated bool `json:"notifyCreated"`
	// NotifyUpdated: Alert on field-level updates. Defaults to false — updates
	// are the bulk of the volume and are usually a provider restating a value.
	NotifyUpdated bool `json:"notifyUpdated"`
	// NotifyDeleted: Alert on resources that disappeared.
	NotifyDeleted bool `json:"notifyDeleted"`
	// CooldownMinutes: Least time between drift notifications for this
	// organization. One notification per window, no matter how many changes or
	// accounts it covers.
	CooldownMinutes int64 `json:"cooldownMinutes"`
	// MinChanges: Fewest matching changes in a window worth notifying about.
	MinChanges int64 `json:"minChanges"`
	// AccountIDs: Accounts to alert on. An empty array means every account.
	AccountIDs []string `json:"accountIds"`
	// LastNotifiedAt: When this organization last had a drift digest delivered.
	LastNotifiedAt *string `json:"lastNotifiedAt"`
}

DriftAlertSettings is the `DriftAlertSettings` schema.

type DriftAlertSettingsUpdate added in v0.27.0

type DriftAlertSettingsUpdate struct {
	NotifyCreated   *bool    `json:"notifyCreated,omitempty"`
	NotifyUpdated   *bool    `json:"notifyUpdated,omitempty"`
	NotifyDeleted   *bool    `json:"notifyDeleted,omitempty"`
	CooldownMinutes *int64   `json:"cooldownMinutes,omitempty"`
	MinChanges      *int64   `json:"minChanges,omitempty"`
	AccountIDs      []string `json:"accountIds,omitempty"`
}

DriftAlertSettingsUpdate is the `DriftAlertSettingsUpdate` schema.

type DrillCoverageResponse added in v1.36.0

type DrillCoverageResponse struct {
	Rows      []DrillCoverageRow `json:"rows"`
	Summary   DrillSummary       `json:"summary"`
	ValidDays int64              `json:"validDays"`
	// OrphanedDrills: Drills against a resource no longer in the inventory.
	// Reported rather than dropped: 'we tested this and then removed it' is a
	// fact an auditor asks about.
	OrphanedDrills []RestoreDrill `json:"orphanedDrills"`
	GeneratedAt    string         `json:"generatedAt"`
}

DrillCoverageResponse is the `DrillCoverageResponse` schema.

type DrillCoverageRow added in v1.36.0

type DrillCoverageRow struct {
	ResourceID     string  `json:"resourceId"`
	ResourceName   *string `json:"resourceName"`
	AccountID      *string `json:"accountId"`
	AccountName    *string `json:"accountName"`
	ResourceTypeID *string `json:"resourceTypeId"`
	// Standing: `never` and `stale` are kept apart because they call for
	// different conversations: one is 'nobody has ever tried', the other is 'it
	// worked in March'.
	//
	// One of "verified", "stale", "failed", "never".
	Standing    string  `json:"standing"`
	LastDrillAt *string `json:"lastDrillAt"`
	// LastOutcome: How the drill ended. Only `verified` counts as evidence the
	// backup works: a restore that produced a running system nobody looked
	// inside is exactly how a team discovers, mid-incident, that the dump had
	// been empty for months. `restored-unverified` is recorded because doing the
	// restore is worth recording, but it does not reset the clock.
	//
	// One of "verified", "restored-unverified", "failed", "blocked".
	LastOutcome        *string `json:"lastOutcome"`
	LastVerifiedAt     *string `json:"lastVerifiedAt"`
	VerifiedRtoMinutes *int64  `json:"verifiedRtoMinutes"`
	DaysUntilStale     *int64  `json:"daysUntilStale"`
}

DrillCoverageRow is the `DrillCoverageRow` schema.

type DrillSummary added in v1.36.0

type DrillSummary struct {
	// EligibleCount: Resources with something to restore from. A resource with
	// no backup cannot be drilled, and listing it here would duplicate the
	// coverage page's own unprotected finding.
	EligibleCount int64 `json:"eligibleCount"`
	VerifiedCount int64 `json:"verifiedCount"`
	StaleCount    int64 `json:"staleCount"`
	FailedCount   int64 `json:"failedCount"`
	NeverCount    int64 `json:"neverCount"`
	// WorstRtoMinutes: Over currently-verified rows only; null when nothing is
	// verified, never zero.
	WorstRtoMinutes  *int64 `json:"worstRtoMinutes"`
	MedianRtoMinutes *int64 `json:"medianRtoMinutes"`
}

DrillSummary is the `DrillSummary` schema.

type EditableField

type EditableField struct {
	Key   string `json:"key"`
	Label string `json:"label"`
	// Kind: One of "string", "number", "boolean", "enum", "secret",
	// "association", "password".
	Kind        string   `json:"kind"`
	Required    bool     `json:"required"`
	Description *string  `json:"description,omitempty"`
	EnumValues  []string `json:"enumValues,omitempty"`
}

EditableField is the `EditableField` schema.

type EfficiencyAlertEvent added in v1.9.0

type EfficiencyAlertEvent struct {
	ID string `json:"id"`
	// Kind: Which detector produced it.
	//
	// One of "commitment_expiry", "commitment_idle", "unit_cost_regression".
	Kind string `json:"kind"`
	// Subject: The commitment's description, or the business metric's name.
	Subject string `json:"subject"`
	// AccountID: The account, for commitment kinds; null otherwise.
	AccountID   *string `json:"accountId"`
	AccountName *string `json:"accountName"`
	// Currency: ISO 4217 of `amount`, or null when it carries none.
	Currency *string `json:"currency"`
	// Amount: The money at stake, in **units of `currency`** rather than cents —
	// commitment amounts are provider-reported in currency units. Per kind: the
	// monthly on-demand exposure for an expiry, the wasted amount for an idle
	// commitment, the current window's spend for a regression.
	Amount *float64 `json:"amount"`
	// Detail: Per-kind display facts. Free-form; nothing branches on it.
	Detail  map[string]any `json:"detail"`
	FiredAt string         `json:"firedAt"`
	// NotifiedAt: When the alert reached its routed destinations, or null when
	// nothing was routed (or the routing rule held it for quiet hours and the
	// follow-up pass has not run yet).
	NotifiedAt *string `json:"notifiedAt"`
}

EfficiencyAlertEvent is the `EfficiencyAlertEvent` schema.

type EnvironmentCaptureDraft added in v1.21.0

type EnvironmentCaptureDraft struct {
	Members             []EnvironmentCaptureDraftMember  `json:"members"`
	SuggestedParameters []EnvironmentParameter           `json:"suggestedParameters"`
	Skipped             []EnvironmentCaptureDraftSkipped `json:"skipped"`
}

EnvironmentCaptureDraft is the `EnvironmentCaptureDraft` schema.

type EnvironmentCaptureDraftMember added in v1.21.0

type EnvironmentCaptureDraftMember struct {
	// Key: Unique within the template; the id references are written against.
	Key              string   `json:"key"`
	PluginID         PluginID `json:"pluginId"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	AccountID        string   `json:"accountId"`
	SourceName       string   `json:"sourceName"`
	SourceResourceID *string  `json:"sourceResourceId,omitempty"`
	// NameFieldKey: The create-form field carrying the resource's name, detected
	// at capture by matching the captured value against the source's display
	// name. The instance name prefix is applied to this field and no other.
	NameFieldKey *string                                                `json:"nameFieldKey,omitempty"`
	ParentMember *string                                                `json:"parentMember,omitempty"`
	Fields       map[string]EnvironmentTemplateFieldValue               `json:"fields"`
	FieldMeta    map[string]EnvironmentCaptureDraftMemberFieldMetaValue `json:"fieldMeta"`
}

EnvironmentCaptureDraftMember is the `EnvironmentCaptureDraftMember` schema.

type EnvironmentCaptureDraftMemberFieldMetaValue added in v1.21.0

type EnvironmentCaptureDraftMemberFieldMetaValue struct {
	Label           string                                               `json:"label"`
	Kind            string                                               `json:"kind"`
	Required        bool                                                 `json:"required"`
	Options         []EnvironmentCaptureDraftMemberFieldMetaValueOptions `json:"options,omitempty"`
	Parameterisable bool                                                 `json:"parameterisable"`
}

EnvironmentCaptureDraftMemberFieldMetaValue is an object the spec declares inline.

type EnvironmentCaptureDraftMemberFieldMetaValueOptions added in v1.21.0

type EnvironmentCaptureDraftMemberFieldMetaValueOptions struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

EnvironmentCaptureDraftMemberFieldMetaValueOptions is an object the spec declares inline.

type EnvironmentCaptureDraftSkipped added in v1.21.0

type EnvironmentCaptureDraftSkipped struct {
	ResourceID  string `json:"resourceId"`
	DisplayName string `json:"displayName"`
	Reason      string `json:"reason"`
}

EnvironmentCaptureDraftSkipped is an object the spec declares inline.

type EnvironmentCaptureRequest added in v1.21.0

type EnvironmentCaptureRequest struct {
	ResourceIDs []string `json:"resourceIds,omitempty"`
	AccountID   *string  `json:"accountId,omitempty"`
	TagKey      *string  `json:"tagKey,omitempty"`
	TagValue    *string  `json:"tagValue,omitempty"`
}

EnvironmentCaptureRequest is the `EnvironmentCaptureRequest` schema.

type EnvironmentCostEstimate added in v1.21.0

type EnvironmentCostEstimate struct {
	// MonthlyAmount: Null means 'could not be priced', which is not the same as
	// zero.
	MonthlyAmount *float64 `json:"monthlyAmount"`
	Currency      *string  `json:"currency"`
	// Partial: True when at least one member is unpriced — read as 'at least'.
	Partial       bool                             `json:"partial"`
	UnpricedCount int64                            `json:"unpricedCount"`
	Members       []EnvironmentCostEstimateMembers `json:"members"`
}

EnvironmentCostEstimate is the `EnvironmentCostEstimate` schema.

type EnvironmentCostEstimateMembers added in v1.21.0

type EnvironmentCostEstimateMembers struct {
	MemberKey     string   `json:"memberKey"`
	DisplayName   string   `json:"displayName"`
	MonthlyAmount *float64 `json:"monthlyAmount"`
	Currency      *string  `json:"currency"`
}

EnvironmentCostEstimateMembers is an object the spec declares inline.

type EnvironmentDiffEntry added in v1.1.0

type EnvironmentDiffEntry struct {
	// Key: The pairing key both sides matched on — the resource type plus the
	// resource name with environment words removed. Stable across runs.
	Key              string `json:"key"`
	ResourceTypeID   string `json:"resourceTypeId"`
	ResourceTypeName string `json:"resourceTypeName"`
	// Status: Whether the slot exists on side A only, side B only, or on both
	// with a field divergence. Matched pairs that agree are counted in the type
	// summary rather than listed.
	//
	// One of "only-in-a", "only-in-b", "changed".
	Status string                      `json:"status"`
	A      *EnvironmentDiffResourceRef `json:"a"`
	B      *EnvironmentDiffResourceRef `json:"b"`
	// Changes: Field divergences. Empty unless `status` is `changed`.
	Changes []EnvironmentDiffFieldChange `json:"changes"`
	// SuppressedCount: Divergences hidden by the identity filter (ids, links,
	// addresses, timestamps). Always 0 when `includeIdentityFields` was
	// requested.
	SuppressedCount int64 `json:"suppressedCount"`
}

EnvironmentDiffEntry is the `EnvironmentDiffEntry` schema.

type EnvironmentDiffFieldChange added in v1.1.0

type EnvironmentDiffFieldChange struct {
	// Field: Field key; resolved-output keys are prefixed `outputs.`.
	Field string `json:"field"`
	// A: Value on side A; null when the key is absent there.
	A any `json:"a,omitempty"`
	// B: Value on side B.
	B any `json:"b,omitempty"`
}

EnvironmentDiffFieldChange is the `EnvironmentDiffFieldChange` schema.

type EnvironmentDiffGetParams added in v1.1.0

type EnvironmentDiffGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// A: Baseline account id — by convention the environment that works.
	A string
	// B: Compared account id. Must differ from `a` and use the same provider.
	B string
	// ResourceTypeID: Compare one resource type only.
	ResourceTypeID *string
	// IncludeIdentityFields: Compare identity and timestamp fields too, instead
	// of filtering them out.
	//
	// One of "true", "false".
	IncludeIdentityFields *string
}

EnvironmentDiffGetParams holds the parameters for `client.environmentDiff.get`.

type EnvironmentDiffNamespace added in v1.1.0

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

EnvironmentDiffNamespace is `client.environmentDiff`.

func (*EnvironmentDiffNamespace) Get added in v1.1.0

Get: Compare two accounts' resource inventories

Compares two accounts of the same provider — typically staging against production — over already-synced state: which resource types exist in one and not the other, the per-type count deltas, and the fields on which two corresponding resources disagree (instance class, engine version, feature flags).

Resources are paired by resource type plus name with environment words removed, so `api-staging` lines up with `api-prod` without any naming convention to configure. By default the comparison hides divergences that are artefacts of being two different resources — ids, links, network addresses and timestamps — because every resource has different ones; pass `includeIdentityFields=true` to see them.

Read-only and cheap: no provider API calls are made, so results reflect the last sync.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/environment-diff

Raises on 400: Bad request

Raises on 404: Not found

type EnvironmentDiffResourceRef added in v1.1.0

type EnvironmentDiffResourceRef struct {
	// ResourceID: Infrawrench resource id.
	ResourceID  string `json:"resourceId"`
	AccountID   string `json:"accountId"`
	DisplayName string `json:"displayName"`
	// ExternalID: Provider-native id, when known.
	ExternalID *string `json:"externalId"`
}

EnvironmentDiffResourceRef: Null when the resource exists only on B.

The API may send null in its place.

type EnvironmentDiffResponse added in v1.1.0

type EnvironmentDiffResponse struct {
	A          EnvironmentDiffSideSummary `json:"a"`
	B          EnvironmentDiffSideSummary `json:"b"`
	PluginID   PluginID                   `json:"pluginId"`
	PluginName string                     `json:"pluginName"`
	// Types: Every resource type present on either side, most-divergent first.
	Types []EnvironmentDiffTypeSummary `json:"types"`
	// Entries: Only the slots that differ; identical pairs are counted, not
	// listed.
	Entries []EnvironmentDiffEntry `json:"entries"`
	Totals  EnvironmentDiffTotals  `json:"totals"`
	// UnavailableTypes: Resource types excluded because they could not be
	// listed. Always empty over this API — it reads already-synced rows, which
	// cannot half-fail — and populated only by the desktop and CLI local modes,
	// which list live.
	UnavailableTypes      []EnvironmentDiffUnavailableType `json:"unavailableTypes"`
	IncludeIdentityFields bool                             `json:"includeIdentityFields"`
	GeneratedAt           string                           `json:"generatedAt"`
}

EnvironmentDiffResponse is the `EnvironmentDiffResponse` schema.

type EnvironmentDiffSideSummary added in v1.1.0

type EnvironmentDiffSideSummary struct {
	AccountID   string `json:"accountId"`
	AccountName string `json:"accountName"`
	// ResourceCount: Resources compared on this side.
	ResourceCount int64 `json:"resourceCount"`
}

EnvironmentDiffSideSummary is the `EnvironmentDiffSideSummary` schema.

type EnvironmentDiffTotals added in v1.1.0

type EnvironmentDiffTotals struct {
	OnlyInA      int64 `json:"onlyInA"`
	OnlyInB      int64 `json:"onlyInB"`
	Changed      int64 `json:"changed"`
	Identical    int64 `json:"identical"`
	TypesOnlyInA int64 `json:"typesOnlyInA"`
	TypesOnlyInB int64 `json:"typesOnlyInB"`
	// SuppressedFieldChanges: Field divergences the identity filter hid across
	// every pair.
	SuppressedFieldChanges int64 `json:"suppressedFieldChanges"`
}

EnvironmentDiffTotals is the `EnvironmentDiffTotals` schema.

type EnvironmentDiffTypeSummary added in v1.1.0

type EnvironmentDiffTypeSummary struct {
	ResourceTypeID   string `json:"resourceTypeId"`
	ResourceTypeName string `json:"resourceTypeName"`
	CountA           int64  `json:"countA"`
	CountB           int64  `json:"countB"`
	// Delta: `countB - countA`.
	Delta   int64 `json:"delta"`
	OnlyInA int64 `json:"onlyInA"`
	OnlyInB int64 `json:"onlyInB"`
	// Changed: Matched pairs that disagree on at least one field.
	Changed int64 `json:"changed"`
	// Identical: Matched pairs with no visible divergence.
	Identical int64 `json:"identical"`
	// MissingFrom: Set when the resource type is absent from that side entirely.
	//
	// One of "a", "b".
	MissingFrom *string `json:"missingFrom"`
}

EnvironmentDiffTypeSummary is the `EnvironmentDiffTypeSummary` schema.

type EnvironmentDiffUnavailableType added in v1.1.0

type EnvironmentDiffUnavailableType struct {
	ResourceTypeID   string `json:"resourceTypeId"`
	ResourceTypeName string `json:"resourceTypeName"`
	// Message: The provider's complaint, as the lister reported it.
	Message string `json:"message"`
}

EnvironmentDiffUnavailableType is the `EnvironmentDiffUnavailableType` schema.

type EnvironmentEstimateRequest added in v1.21.0

type EnvironmentEstimateRequest struct {
	Parameters       map[string]string `json:"parameters,omitempty"`
	AccountOverrides map[string]string `json:"accountOverrides,omitempty"`
}

EnvironmentEstimateRequest is the `EnvironmentEstimateRequest` schema.

type EnvironmentInstance added in v1.21.0

type EnvironmentInstance struct {
	ID           string            `json:"id"`
	TemplateID   *string           `json:"templateId"`
	TemplateName string            `json:"templateName"`
	Name         string            `json:"name"`
	NamePrefix   string            `json:"namePrefix"`
	Parameters   map[string]string `json:"parameters"`
	// Status: `partial` means a create failed part-way: the members that were
	// created are recorded and can still be torn down, which is what stops a
	// half-finished run leaving cloud resources with no row pointing at them.
	//
	// One of "creating", "active", "partial", "tearing-down", "deleted",
	// "failed".
	Status      string                      `json:"status"`
	ExpiresAt   string                      `json:"expiresAt"`
	Error       *string                     `json:"error"`
	Members     []EnvironmentInstanceMember `json:"members"`
	CreatedAt   string                      `json:"createdAt"`
	UpdatedAt   string                      `json:"updatedAt"`
	CompletedAt *string                     `json:"completedAt"`
}

EnvironmentInstance is the `EnvironmentInstance` schema.

type EnvironmentInstanceConflict added in v1.21.0

type EnvironmentInstanceConflict struct {
	Error string `json:"error"`
}

EnvironmentInstanceConflict is the `EnvironmentInstanceConflict` schema.

type EnvironmentInstanceList added in v1.21.0

type EnvironmentInstanceList struct {
	Instances []EnvironmentInstance `json:"instances"`
}

EnvironmentInstanceList is the `EnvironmentInstanceList` schema.

type EnvironmentInstanceMember added in v1.21.0

type EnvironmentInstanceMember struct {
	ID             string   `json:"id"`
	MemberKey      string   `json:"memberKey"`
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	AccountID      string   `json:"accountId"`
	ResourceID     *string  `json:"resourceId"`
	ExternalID     *string  `json:"externalId"`
	DisplayName    string   `json:"displayName"`
	// Status: One of "pending", "created", "failed", "deleted".
	Status string  `json:"status"`
	Error  *string `json:"error"`
	// LeaseID: The lease that auto-deletes this member at the TTL.
	LeaseID  *string `json:"leaseId"`
	Position int64   `json:"position"`
}

EnvironmentInstanceMember is the `EnvironmentInstanceMember` schema.

type EnvironmentInstantiateRequest added in v1.21.0

type EnvironmentInstantiateRequest struct {
	Name       string            `json:"name"`
	Parameters map[string]string `json:"parameters,omitempty"`
	// TTLHours: Required. Capped by the org's `maxTtlHours` setting and by a
	// 720-hour ceiling.
	TTLHours         float64           `json:"ttlHours"`
	AccountOverrides map[string]string `json:"accountOverrides,omitempty"`
	Note             *string           `json:"note,omitempty"`
}

EnvironmentInstantiateRequest is the `EnvironmentInstantiateRequest` schema.

type EnvironmentParameter added in v1.21.0

type EnvironmentParameter struct {
	Key   string `json:"key"`
	Label string `json:"label"`
	// Type: One of "string", "number", "select".
	Type         string                        `json:"type"`
	Required     bool                          `json:"required"`
	DefaultValue *string                       `json:"defaultValue,omitempty"`
	Options      []EnvironmentParameterOptions `json:"options,omitempty"`
	Description  *string                       `json:"description,omitempty"`
}

EnvironmentParameter is the `EnvironmentParameter` schema.

type EnvironmentParameterOptions added in v1.21.0

type EnvironmentParameterOptions struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

EnvironmentParameterOptions is an object the spec declares inline.

type EnvironmentSettings added in v1.21.0

type EnvironmentSettings struct {
	MaxTTLHours     int64 `json:"maxTtlHours"`
	DefaultTTLHours int64 `json:"defaultTtlHours"`
}

EnvironmentSettings is the `EnvironmentSettings` schema.

type EnvironmentStillLive added in v1.21.0

type EnvironmentStillLive struct {
	Error string `json:"error"`
}

EnvironmentStillLive is the `EnvironmentStillLive` schema.

type EnvironmentTemplate added in v1.21.0

type EnvironmentTemplate struct {
	ID                  string                      `json:"id"`
	Name                string                      `json:"name"`
	Description         *string                     `json:"description"`
	Parameters          []EnvironmentParameter      `json:"parameters"`
	Members             []EnvironmentTemplateMember `json:"members"`
	CreatedAt           string                      `json:"createdAt"`
	UpdatedAt           string                      `json:"updatedAt"`
	ActiveInstanceCount *int64                      `json:"activeInstanceCount,omitempty"`
}

EnvironmentTemplate is the `EnvironmentTemplate` schema.

type EnvironmentTemplateConflict added in v1.21.0

type EnvironmentTemplateConflict struct {
	Error string `json:"error"`
}

EnvironmentTemplateConflict is the `EnvironmentTemplateConflict` schema.

type EnvironmentTemplateFieldValue added in v1.21.0

type EnvironmentTemplateFieldValue = any

EnvironmentTemplateFieldValue: What a captured create-form field is filled with at instantiation. `literal` is the captured value; `parameter` is a field the user chose to vary; `output` is another member's resolved output (a connection string, an IP — the captured half of an output reference); `member-id` is another member's provider-side id.

type EnvironmentTemplateInput added in v1.21.0

type EnvironmentTemplateInput struct {
	Name        string                      `json:"name"`
	Description *string                     `json:"description,omitempty"`
	Parameters  []EnvironmentParameter      `json:"parameters"`
	Members     []EnvironmentTemplateMember `json:"members"`
}

EnvironmentTemplateInput is the `EnvironmentTemplateInput` schema.

type EnvironmentTemplateList added in v1.21.0

type EnvironmentTemplateList struct {
	Templates []EnvironmentTemplate `json:"templates"`
}

EnvironmentTemplateList is the `EnvironmentTemplateList` schema.

type EnvironmentTemplateMember added in v1.21.0

type EnvironmentTemplateMember struct {
	// Key: Unique within the template; the id references are written against.
	Key              string   `json:"key"`
	PluginID         PluginID `json:"pluginId"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	AccountID        string   `json:"accountId"`
	SourceName       string   `json:"sourceName"`
	SourceResourceID *string  `json:"sourceResourceId,omitempty"`
	// NameFieldKey: The create-form field carrying the resource's name, detected
	// at capture by matching the captured value against the source's display
	// name. The instance name prefix is applied to this field and no other.
	NameFieldKey *string                                  `json:"nameFieldKey,omitempty"`
	ParentMember *string                                  `json:"parentMember,omitempty"`
	Fields       map[string]EnvironmentTemplateFieldValue `json:"fields"`
}

EnvironmentTemplateMember is the `EnvironmentTemplateMember` schema.

type EnvironmentsCaptureParams added in v1.21.0

type EnvironmentsCaptureParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *EnvironmentCaptureRequest
}

EnvironmentsCaptureParams holds the parameters for `client.environments.capture`.

Every field is optional; pass nil to take the defaults.

type EnvironmentsInstancesDeleteParams added in v1.21.0

type EnvironmentsInstancesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	InstanceID string
}

EnvironmentsInstancesDeleteParams holds the parameters for `client.environments.instances.delete`.

type EnvironmentsInstancesGetOrgOrgIDEnvironmentsInstancesInstanceIDParams added in v1.21.0

type EnvironmentsInstancesGetOrgOrgIDEnvironmentsInstancesInstanceIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	InstanceID string
}

EnvironmentsInstancesGetOrgOrgIDEnvironmentsInstancesInstanceIDParams holds the parameters for `client.environments.instances.getOrgOrgIdEnvironmentsInstancesInstanceId`.

type EnvironmentsInstancesGetParams added in v1.21.0

type EnvironmentsInstancesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

EnvironmentsInstancesGetParams holds the parameters for `client.environments.instances.get`.

Every field is optional; pass nil to take the defaults.

type EnvironmentsInstancesNamespace added in v1.21.0

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

EnvironmentsInstancesNamespace is `client.environments.instances`.

func (*EnvironmentsInstancesNamespace) Delete added in v1.21.0

Delete: Forget a torn-down environment

Removes the record. Refuses while the instance still owns resources — the row is the only thing that knows they exist. Audit-logged.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/environments/instances/{instanceId}

Raises on 404: Not found

Raises on 409: The environment is still live — tear it down first

func (*EnvironmentsInstancesNamespace) Get added in v1.21.0

Get: List environment instances

Newest first. Reading this also reconciles instances past their deadline against what the lease pass already deleted, so an environment whose resources are all gone stops reporting itself as running.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/environments/instances

func (*EnvironmentsInstancesNamespace) GetOrgOrgIDEnvironmentsInstancesInstanceID added in v1.21.0

GetOrgOrgIDEnvironmentsInstancesInstanceID: Get an environment instance

_Requires permission: `resources:read`._

GET /api/org/{orgId}/environments/instances/{instanceId}

Raises on 404: Not found

func (*EnvironmentsInstancesNamespace) Teardown added in v1.21.0

Teardown: Tear an environment down now

Deletes every created member through the ordinary `deleteResource` path, in reverse creation order. Idempotent: a member already gone, a resource the provider answers 404 for, and an instance already torn down all succeed quietly, so this is safe to retry. Blocked by an active change freeze. Audit-logged.

_Requires permission: `resources:delete`._

POST /api/org/{orgId}/environments/instances/{instanceId}/teardown

Raises on 404: Not found

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

type EnvironmentsInstancesTeardownParams added in v1.21.0

type EnvironmentsInstancesTeardownParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	InstanceID string
}

EnvironmentsInstancesTeardownParams holds the parameters for `client.environments.instances.teardown`.

type EnvironmentsNamespace added in v1.21.0

type EnvironmentsNamespace struct {

	// Instances: `client.environments.instances`.
	Instances *EnvironmentsInstancesNamespace
	// Settings: `client.environments.settings`.
	Settings *EnvironmentsSettingsNamespace
	// Templates: `client.environments.templates`.
	Templates *EnvironmentsTemplatesNamespace
	// contains filtered or unexported fields
}

EnvironmentsNamespace is `client.environments`.

func (*EnvironmentsNamespace) Capture added in v1.21.0

Capture: Preview a template capture

Turn a selection of live resources into a draft template. **Persists nothing** — the editor shows the draft so the user can choose which fields to vary before saving. The shape of every member comes from the plugin's own `getCreateConfig`: a captured value with no matching create field is dropped, and a resource type the plugin cannot create is reported in `skipped` with a reason rather than silently omitted. Recorded output references whose target is also in the selection are preserved as `output` field values; a value that is exactly another selected resource's external id becomes a `member-id`.

_Requires permission: `resources:read`._

POST /api/org/{orgId}/environments/capture

Raises on 400: Bad request

Raises on 404: Not found

type EnvironmentsSettingsGetParams added in v1.21.0

type EnvironmentsSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

EnvironmentsSettingsGetParams holds the parameters for `client.environments.settings.get`.

Every field is optional; pass nil to take the defaults.

type EnvironmentsSettingsNamespace added in v1.21.0

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

EnvironmentsSettingsNamespace is `client.environments.settings`.

func (*EnvironmentsSettingsNamespace) Get added in v1.21.0

Get: Get the organization's environment TTL rails

The longest TTL an instantiation may ask for and the TTL the form pre-fills. Absent settings normalize into the shipped defaults (168h / 24h).

_Requires permission: `resources:read`._

GET /api/org/{orgId}/environments/settings

func (*EnvironmentsSettingsNamespace) Update added in v1.21.0

Update: Set the organization's environment TTL rails

`org:settings:write`, not `resources:write` — this is a governance decision about how long the organization is willing to pay for a throwaway environment. Clamped to a 720-hour ceiling; the default is clamped to the maximum. Audit-logged.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/environments/settings

type EnvironmentsSettingsUpdateParams added in v1.21.0

type EnvironmentsSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *EnvironmentSettings
}

EnvironmentsSettingsUpdateParams holds the parameters for `client.environments.settings.update`.

Every field is optional; pass nil to take the defaults.

type EnvironmentsTemplatesCreateParams added in v1.21.0

type EnvironmentsTemplatesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *EnvironmentTemplateInput
}

EnvironmentsTemplatesCreateParams holds the parameters for `client.environments.templates.create`.

Every field is optional; pass nil to take the defaults.

type EnvironmentsTemplatesDeleteParams added in v1.21.0

type EnvironmentsTemplatesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	TemplateID string
}

EnvironmentsTemplatesDeleteParams holds the parameters for `client.environments.templates.delete`.

type EnvironmentsTemplatesEstimateParams added in v1.21.0

type EnvironmentsTemplatesEstimateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	TemplateID string
	// Body: the JSON request body.
	Body *EnvironmentEstimateRequest
}

EnvironmentsTemplatesEstimateParams holds the parameters for `client.environments.templates.estimate`.

type EnvironmentsTemplatesGetOrgOrgIDEnvironmentsTemplatesTemplateIDParams added in v1.21.0

type EnvironmentsTemplatesGetOrgOrgIDEnvironmentsTemplatesTemplateIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	TemplateID string
}

EnvironmentsTemplatesGetOrgOrgIDEnvironmentsTemplatesTemplateIDParams holds the parameters for `client.environments.templates.getOrgOrgIdEnvironmentsTemplatesTemplateId`.

type EnvironmentsTemplatesGetParams added in v1.21.0

type EnvironmentsTemplatesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

EnvironmentsTemplatesGetParams holds the parameters for `client.environments.templates.get`.

Every field is optional; pass nil to take the defaults.

type EnvironmentsTemplatesInstantiateParams added in v1.21.0

type EnvironmentsTemplatesInstantiateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	TemplateID string
	// Body: the JSON request body.
	Body *EnvironmentInstantiateRequest
}

EnvironmentsTemplatesInstantiateParams holds the parameters for `client.environments.templates.instantiate`.

type EnvironmentsTemplatesNamespace added in v1.21.0

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

EnvironmentsTemplatesNamespace is `client.environments.templates`.

func (*EnvironmentsTemplatesNamespace) Create added in v1.21.0

Create: Create an environment template

Save a capture draft as a template. Member keys must be unique, every parameter and member reference must resolve, and the members must be orderable — a dependency cycle is rejected here rather than half-way through an apply. Audit-logged.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/environments/templates

Raises on 400: Bad request

Raises on 409: A template with that name already exists

func (*EnvironmentsTemplatesNamespace) Delete added in v1.21.0

Delete: Delete an environment template

Live instances keep running and keep their TTL — they own real resources, and the template is only where they came from. Their `templateId` becomes null; the denormalized `templateName` is what the surface reads. Audit-logged.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/environments/templates/{templateId}

Raises on 404: Not found

func (*EnvironmentsTemplatesNamespace) Estimate added in v1.21.0

Estimate: Price an instantiation before it runs

Runs each member's create fields through the plugin's own `estimateCost`. A member the plugin cannot price is counted in `unpricedCount` and makes the total `partial` — `null` is never rounded to zero.

_Requires permission: `resources:read`._

POST /api/org/{orgId}/environments/templates/{templateId}/estimate

Raises on 400: Bad request

Raises on 404: Not found

func (*EnvironmentsTemplatesNamespace) Get added in v1.21.0

Get: List environment templates

_Requires permission: `resources:read`._

GET /api/org/{orgId}/environments/templates

func (*EnvironmentsTemplatesNamespace) GetOrgOrgIDEnvironmentsTemplatesTemplateID added in v1.21.0

GetOrgOrgIDEnvironmentsTemplatesTemplateID: Get an environment template

_Requires permission: `resources:read`._

GET /api/org/{orgId}/environments/templates/{templateId}

Raises on 404: Not found

func (*EnvironmentsTemplatesNamespace) Instantiate added in v1.21.0

Instantiate: Stamp out an environment

Creates the template's resources in dependency order through the ordinary `createResource` path, name-prefixed per instance, and attaches an auto-delete lease to each so expiry runs through the existing lease pass. `ttlHours` is **required**. Requires `resources:write` **and** `resources:delete` (the lease is a standing deletion, the same rule `POST /leases` applies), and is blocked by an active change freeze. A create that fails part-way returns a `partial` instance whose created members are recorded and tearable-down, never an error with orphaned resources behind it. Audit-logged.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/environments/templates/{templateId}/instantiate

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: The organization is at its live-environment limit

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

func (*EnvironmentsTemplatesNamespace) Update added in v1.21.0

Update: Replace an environment template

The whole document is replaced. Live instances are unaffected. Audit-logged.

_Requires permission: `resources:write`._

PUT /api/org/{orgId}/environments/templates/{templateId}

Raises on 400: Bad request

Raises on 404: Not found

type EnvironmentsTemplatesUpdateParams added in v1.21.0

type EnvironmentsTemplatesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	TemplateID string
	// Body: the JSON request body.
	Body *EnvironmentTemplateInput
}

EnvironmentsTemplatesUpdateParams holds the parameters for `client.environments.templates.update`.

type Error

type Error struct {
	// Error: Human-readable error message
	Error string `json:"error"`
}

Error is the `Error` schema.

type EscalationPolicy added in v1.0.0

type EscalationPolicy struct {
	AfterMinutes int64              `json:"afterMinutes"`
	Destinations []AlertDestination `json:"destinations"`
}

EscalationPolicy: Notify these destinations too if nobody acknowledges within afterMinutes. Acknowledgement comes from the button on the Slack message, so an alert routed only to Teams or push will always escalate.

The API may send null in its place.

type ExchangeRate added in v1.6.0

type ExchangeRate struct {
	ID string `json:"id"`
	// FromCurrency: ISO 4217 code, upper-case.
	FromCurrency string `json:"fromCurrency"`
	// ToCurrency: ISO 4217 code, upper-case.
	ToCurrency string `json:"toCurrency"`
	// Rate: Multiply an amount in `fromCurrency` by this to get `toCurrency`. A
	// decimal **string**, not a number: it is stored in a `numeric(20, 10)`
	// column so the digits your finance system used survive the round trip
	// exactly, and a JSON number could not promise that.
	Rate string `json:"rate"`
	// EffectiveFrom: Inclusive day this rate starts applying. A given day
	// converts at the rate with the greatest `effectiveFrom` on or before it, so
	// historical periods keep the rate that applied then. A day earlier than
	// every stated rate has no rate.
	EffectiveFrom string  `json:"effectiveFrom"`
	CreatedBy     *string `json:"createdBy"`
	CreatedAt     string  `json:"createdAt"`
	UpdatedAt     string  `json:"updatedAt"`
}

ExchangeRate is the `ExchangeRate` schema.

type ExchangeRateInput added in v1.6.0

type ExchangeRateInput struct {
	// FromCurrency: ISO 4217 code, upper-case.
	FromCurrency string `json:"fromCurrency"`
	// ToCurrency: ISO 4217 code, upper-case.
	ToCurrency string `json:"toCurrency"`
	// Rate: Multiply an amount in `fromCurrency` by this to get `toCurrency`. A
	// decimal **string**, not a number: it is stored in a `numeric(20, 10)`
	// column so the digits your finance system used survive the round trip
	// exactly, and a JSON number could not promise that.
	Rate          string `json:"rate"`
	EffectiveFrom string `json:"effectiveFrom"`
}

ExchangeRateInput is the `ExchangeRateInput` schema.

type ExpiringGetParams added in v0.29.0

type ExpiringGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

ExpiringGetParams holds the parameters for `client.expiring.get`.

Every field is optional; pass nil to take the defaults.

type ExpiringNamespace added in v0.29.0

type ExpiringNamespace struct {

	// Settings: `client.expiring.settings`.
	Settings *ExpiringSettingsNamespace
	// contains filtered or unexported fields
}

ExpiringNamespace is `client.expiring`.

func (*ExpiringNamespace) Get added in v0.29.0

Get: List approaching deadlines on synced resources

One cross-provider countdown of everything with a clock on it: TLS certificate expiries, domain registrations, API token expirations, access keys past their rotation budget, Kubernetes/SSH credential ages. Plugins declare which synced fields carry deadlines; the feed is computed over already-stored state, so no provider API calls are made and results reflect the last sync. Items are sorted soonest first and bucketed by severity against the organization's lead time.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/expiring

type ExpiringSettingsGetParams added in v0.29.0

type ExpiringSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

ExpiringSettingsGetParams holds the parameters for `client.expiring.settings.get`.

Every field is optional; pass nil to take the defaults.

type ExpiringSettingsNamespace added in v0.29.0

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

ExpiringSettingsNamespace is `client.expiring.settings`.

func (*ExpiringSettingsNamespace) Get added in v0.29.0

Get: Get the organization's expiry alert settings

The lead time feeds both the feed's `upcoming` bucket and the poller's daily alert scan. An organization that never saved reads the shipped defaults (enabled, 60 days).

_Requires permission: `org:settings:write`._

GET /api/org/{orgId}/expiring/settings

func (*ExpiringSettingsNamespace) Update added in v0.29.0

Update: Update the expiry alert settings

Every field is optional so a single toggle can be saved on its own. `leadDays` must be a whole number from 1 to 365. Saving never resets the alert cooldown.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/expiring/settings

Raises on 400: Bad request

type ExpiringSettingsUpdateParams added in v0.29.0

type ExpiringSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *ExpiryAlertSettingsUpdate
}

ExpiringSettingsUpdateParams holds the parameters for `client.expiring.settings.update`.

Every field is optional; pass nil to take the defaults.

type ExpiryAlertSettings added in v0.29.0

type ExpiryAlertSettings struct {
	// Enabled: Whether the poller sends expiry alerts for this organization at
	// all.
	Enabled bool `json:"enabled"`
	// LeadDays: Days of lead time before a deadline counts as `upcoming` and
	// alertable. Default 60.
	LeadDays int64 `json:"leadDays"`
	// LastNotifiedAt: When the organization's expiry alert scan last completed,
	// or null before the first. Owned by the poller's cooldown claim; not
	// writable through this API.
	LastNotifiedAt *string `json:"lastNotifiedAt"`
}

ExpiryAlertSettings is the `ExpiryAlertSettings` schema.

type ExpiryAlertSettingsUpdate added in v0.29.0

type ExpiryAlertSettingsUpdate struct {
	Enabled  *bool  `json:"enabled,omitempty"`
	LeadDays *int64 `json:"leadDays,omitempty"`
}

ExpiryAlertSettingsUpdate is the `ExpiryAlertSettingsUpdate` schema.

type ExpiryItem added in v0.29.0

type ExpiryItem struct {
	// ResourceID: Infrawrench resource id.
	ResourceID       string   `json:"resourceId"`
	PluginID         PluginID `json:"pluginId"`
	PluginName       string   `json:"pluginName"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
	AccountName      string   `json:"accountName"`
	DisplayName      string   `json:"displayName"`
	// ExternalID: Provider-native id, when known.
	ExternalID *string `json:"externalId"`
	// FieldKey: The declared field the deadline came from.
	FieldKey string `json:"fieldKey"`
	// Kind: Grouping bucket for the kind of deadline.
	//
	// One of "tls-cert", "domain", "api-token", "access-key", "k8s-cert",
	// "ssh-key", "secret-version", "other".
	Kind string `json:"kind"`
	// Label: Plugin-authored caption for the deadline.
	Label string `json:"label"`
	// Basis: `expiry` — the field held the deadline itself; `age` — the deadline
	// was derived from a creation/rotation date plus an age budget.
	//
	// One of "expiry", "age".
	Basis string `json:"basis"`
	// DueAt: The deadline.
	DueAt string `json:"dueAt"`
	// DaysRemaining: Whole days until dueAt (floor); negative once expired.
	DaysRemaining int64 `json:"daysRemaining"`
	// Severity: How close the deadline is: `expired` (in the past), `critical`
	// (due within 7 days), `warning` (within 30 days), `upcoming` (within the
	// organization's lead time), or `ok` (tracked, but further out than the lead
	// time).
	//
	// One of "expired", "critical", "warning", "upcoming", "ok".
	Severity string `json:"severity"`
}

ExpiryItem is the `ExpiryItem` schema.

type ExpiryListResponse added in v0.29.0

type ExpiryListResponse struct {
	// Items: All tracked deadlines, soonest first (`ok` items included).
	Items      []ExpiryItem         `json:"items"`
	TotalCount int64                `json:"totalCount"`
	Counts     ExpirySeverityCounts `json:"counts"`
	// LeadDays: The lead time the `upcoming` bucket was computed against.
	LeadDays    int64  `json:"leadDays"`
	GeneratedAt string `json:"generatedAt"`
}

ExpiryListResponse is the `ExpiryListResponse` schema.

type ExpirySeverityCounts added in v0.29.0

type ExpirySeverityCounts struct {
	Expired  int64 `json:"expired"`
	Critical int64 `json:"critical"`
	Warning  int64 `json:"warning"`
	Upcoming int64 `json:"upcoming"`
	OK       int64 `json:"ok"`
}

ExpirySeverityCounts: Item count per severity; every bucket present, zeros included.

type ExportCredentialRequest

type ExportCredentialRequest struct {
	ResourceID       ResourceID  `json:"resourceId"`
	AccountID        string      `json:"accountId"`
	FormatID         string      `json:"formatId"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

ExportCredentialRequest is the `ExportCredentialRequest` schema.

type ExportTerraformRequest added in v1.3.0

type ExportTerraformRequest struct {
	ResourceID ResourceID `json:"resourceId"`
	AccountID  string     `json:"accountId"`
}

ExportTerraformRequest is the `ExportTerraformRequest` schema.

type FieldActionRequest

type FieldActionRequest struct {
	AccountID        string            `json:"accountId"`
	ResourceTypeID   string            `json:"resourceTypeId"`
	FieldKey         string            `json:"fieldKey"`
	ActionID         string            `json:"actionId"`
	Fields           map[string]string `json:"fields"`
	ActionFields     map[string]string `json:"actionFields,omitempty"`
	PluginID         *string           `json:"pluginId,omitempty"`
	ParentResourceID *ResourceID       `json:"parentResourceId,omitempty"`
}

FieldActionRequest is the `FieldActionRequest` schema.

type FieldActionResponse

type FieldActionResponse struct {
	Value  string                     `json:"value"`
	Option *FieldActionResponseOption `json:"option,omitempty"`
}

FieldActionResponse is the `FieldActionResponse` schema.

type FieldActionResponseOption

type FieldActionResponseOption struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

FieldActionResponseOption is an object the spec declares inline.

type GenerateSSHKeyRequest

type GenerateSSHKeyRequest struct {
	Name string `json:"name"`
}

GenerateSSHKeyRequest is the `GenerateSshKeyRequest` schema.

Spec schema: `GenerateSshKeyRequest`.

type GeneratedSSHKey

type GeneratedSSHKey struct {
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	KeyType     SSHKeyType `json:"keyType"`
	Fingerprint string     `json:"fingerprint"`
	PublicKey   string     `json:"publicKey"`
	// PrivateKey: Returned once. Not persisted in plaintext.
	PrivateKey string `json:"privateKey"`
}

GeneratedSSHKey is the `GeneratedSshKey` schema.

Spec schema: `GeneratedSshKey`.

type HygieneFinding added in v0.43.0

type HygieneFinding struct {
	// ID: Stable across runs, so a client can remember what has been reviewed.
	ID string `json:"id"`
	// Kind: One of "api_key_never_used", "api_key_idle",
	// "api_key_expired_not_revoked", "api_key_wildcard_scope",
	// "api_key_unused_scopes", "ssh_key_never_used", "ssh_key_idle",
	// "member_unused_permissions".
	Kind string `json:"kind"`
	// Severity: One of "high", "medium", "low".
	Severity string `json:"severity"`
	Title    string `json:"title"`
	// Detail: The evidence behind the finding.
	Detail         string `json:"detail"`
	Recommendation string `json:"recommendation"`
	// EntityType: One of "api-key", "ssh-key", "member".
	EntityType string `json:"entityType"`
	EntityID   string `json:"entityId"`
	EntityName string `json:"entityName"`
	// Facts: Structured detail for table columns and reports.
	Facts map[string]any `json:"facts"`
}

HygieneFinding is the `HygieneFinding` schema.

type HygieneReport added in v0.43.0

type HygieneReport struct {
	GeneratedAt string `json:"generatedAt"`
	WindowDays  int64  `json:"windowDays"`
	// AuditHistoryDays: How much audit history the organization actually has;
	// null when it has none.
	AuditHistoryDays *int64 `json:"auditHistoryDays"`
	// PermissionFindingsWithheld: True when there was not enough audit history
	// for the unused-permission finding to mean anything, so it was withheld
	// rather than guessed at.
	PermissionFindingsWithheld bool                `json:"permissionFindingsWithheld"`
	Findings                   []HygieneFinding    `json:"findings"`
	Counts                     HygieneReportCounts `json:"counts"`
}

HygieneReport is the `HygieneReport` schema.

type HygieneReportCounts added in v0.43.0

type HygieneReportCounts struct {
	High   int64 `json:"high"`
	Medium int64 `json:"medium"`
	Low    int64 `json:"low"`
	Total  int64 `json:"total"`
}

HygieneReportCounts is an object the spec declares inline.

type IacFieldChange added in v1.20.0

type IacFieldChange struct {
	Field string `json:"field"`
	// From: The value Terraform state carries.
	From any `json:"from,omitempty"`
	// To: The value actually running.
	To any `json:"to,omitempty"`
}

IacFieldChange is the `IacFieldChange` schema.

type IacImportPlanParams added in v1.20.0

type IacImportPlanParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *IacImportPlanRequest
}

IacImportPlanParams holds the parameters for `client.iac.importPlan`.

Every field is optional; pass nil to take the defaults.

type IacImportPlanRequest added in v1.20.0

type IacImportPlanRequest struct {
	ResourceIDs []string `json:"resourceIds"`
}

IacImportPlanRequest is the `IacImportPlanRequest` schema.

type IacImportPlanResponse added in v1.20.0

type IacImportPlanResponse struct {
	// Hcl: `import` blocks followed by the generated resource stanzas.
	Hcl         string                             `json:"hcl"`
	Exported    []IacImportPlanResponseExported    `json:"exported"`
	Unsupported []IacImportPlanResponseUnsupported `json:"unsupported"`
}

IacImportPlanResponse is the `IacImportPlanResponse` schema.

type IacImportPlanResponseExported added in v1.20.0

type IacImportPlanResponseExported struct {
	ResourceID string  `json:"resourceId"`
	Address    string  `json:"address"`
	ImportID   *string `json:"importId"`
}

IacImportPlanResponseExported is an object the spec declares inline.

type IacImportPlanResponseUnsupported added in v1.20.0

type IacImportPlanResponseUnsupported struct {
	ResourceID  string `json:"resourceId"`
	DisplayName string `json:"displayName"`
	Reason      string `json:"reason"`
}

IacImportPlanResponseUnsupported is an object the spec declares inline.

type IacNamespace added in v1.20.0

type IacNamespace struct {

	// States: `client.iac.states`.
	States *IacStatesNamespace
	// contains filtered or unexported fields
}

IacNamespace is `client.iac`.

func (*IacNamespace) ImportPlan added in v1.20.0

func (n *IacNamespace) ImportPlan(ctx context.Context, params *IacImportPlanParams, opts ...RequestOption) (*IacImportPlanResponse, error)

ImportPlan: Generate Terraform import blocks for unmanaged resources

Terraform 1.5+ `import` blocks plus the matching resource stanzas, generated by the same plugin export mappers and HCL serializer that back "Export to Terraform…". Resources no plugin can express are returned in `unsupported` with a reason, never dropped.

POST /api/org/{orgId}/iac/import-plan

Raises on 400: Bad request

Raises on 404: Not found

func (*IacNamespace) Reconciliation added in v1.20.0

Reconciliation: Classify inventory against a state document

Every synced resource classified as managed, drifted or unmanaged against one uploaded state, plus state entries with no inventory match. Unmanaged resources carry the ownership and first-seen join that answers "who made this by hand, and when".

GET /api/org/{orgId}/iac/reconciliation

Raises on 400: Bad request

Raises on 404: Not found

func (*IacNamespace) Resource added in v1.20.0

Resource: IaC status for one resource

The managed/unmanaged badge for a resource detail page, computed against the newest state document. `status` is null when the organization has uploaded none — absence of a state is not evidence of ClickOps. A query parameter rather than a path segment because composite resource ids contain slashes.

GET /api/org/{orgId}/iac/resource

Raises on 400: Bad request

type IacReconciledResource added in v1.20.0

type IacReconciledResource struct {
	ResourceID     string   `json:"resourceId"`
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	AccountID      string   `json:"accountId"`
	DisplayName    string   `json:"displayName"`
	ExternalID     *string  `json:"externalId"`
	// Status: `managed`: matched a state entry and agrees with it. `drifted`:
	// matched, but live fields differ. `unmanaged`: in inventory, absent from
	// state — somebody made it by hand.
	//
	// One of "managed", "drifted", "unmanaged".
	Status           string  `json:"status"`
	TerraformType    *string `json:"terraformType"`
	TerraformAddress *string `json:"terraformAddress"`
	// MatchedBy: How the match was made, so it can be argued with.
	//
	// One of "import-id", "external-id", "identifier".
	MatchedBy *string          `json:"matchedBy"`
	Drift     []IacFieldChange `json:"drift"`
	// UnmappableReason: Set when no Terraform block could be produced for this
	// resource, which makes its drift unknowable. Never reported as "no drift".
	UnmappableReason *string `json:"unmappableReason"`
	// Owner: Resource owner annotation, populated for unmanaged resources.
	Owner map[string]any `json:"owner"`
	// FirstSeenAt: When the change timeline first recorded this resource
	// appearing.
	FirstSeenAt *string `json:"firstSeenAt"`
}

IacReconciledResource is the `IacReconciledResource` schema.

type IacReconciliationParams added in v1.20.0

type IacReconciliationParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	StateID string
}

IacReconciliationParams holds the parameters for `client.iac.reconciliation`.

type IacReconciliationResponse added in v1.20.0

type IacReconciliationResponse struct {
	State     IacState                `json:"state"`
	Resources []IacReconciledResource `json:"resources"`
	// StateOnly: State entries with no inventory match — their own category.
	StateOnly []IacStateOnlyResource           `json:"stateOnly"`
	Summary   IacReconciliationResponseSummary `json:"summary"`
	// Underivable: Plugin resource types whose Terraform type could not be
	// derived from the plugin's own export mapper. Reported rather than guessed.
	Underivable []IacReconciliationResponseUnderivable `json:"underivable"`
}

IacReconciliationResponse is the `IacReconciliationResponse` schema.

type IacReconciliationResponseSummary added in v1.20.0

type IacReconciliationResponseSummary struct {
	InventoryTotal     int64 `json:"inventoryTotal"`
	Managed            int64 `json:"managed"`
	Drifted            int64 `json:"drifted"`
	Unmanaged          int64 `json:"unmanaged"`
	StateOnly          int64 `json:"stateOnly"`
	Undiffable         int64 `json:"undiffable"`
	StateResources     int64 `json:"stateResources"`
	DataSourcesIgnored int64 `json:"dataSourcesIgnored"`
}

IacReconciliationResponseSummary is an object the spec declares inline.

type IacReconciliationResponseUnderivable added in v1.20.0

type IacReconciliationResponseUnderivable struct {
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	Reason         string   `json:"reason"`
}

IacReconciliationResponseUnderivable is an object the spec declares inline.

type IacResourceParams added in v1.20.0

type IacResourceParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ResourceID string
}

IacResourceParams holds the parameters for `client.iac.resource`.

type IacResourceStatusResponse added in v1.20.0

type IacResourceStatusResponse struct {
	// Status: One of "managed", "drifted", "unmanaged".
	Status           *string `json:"status"`
	StateID          *string `json:"stateId"`
	StateLabel       *string `json:"stateLabel"`
	TerraformAddress *string `json:"terraformAddress"`
	DriftFieldCount  int64   `json:"driftFieldCount"`
}

IacResourceStatusResponse is the `IacResourceStatusResponse` schema.

type IacState added in v1.20.0

type IacState struct {
	ID string `json:"id"`
	// Label: User-supplied name for this state, e.g. "prod / us-east-1".
	Label string `json:"label"`
	// AccountID: The account this state covers, or null when it covers the whole
	// organization.
	AccountID   *string `json:"accountId"`
	AccountName *string `json:"accountName"`
	// Format: Which document shape was uploaded: a raw state file, or `terraform
	// show -json`.
	//
	// One of "tfstate", "show-json".
	Format string `json:"format"`
	// FormatVersion: The document's own version — "4" for a state file,
	// "1.0"-style otherwise.
	FormatVersion    string  `json:"formatVersion"`
	TerraformVersion *string `json:"terraformVersion"`
	// Serial: State file serial; null for show output.
	Serial *int64 `json:"serial"`
	// Lineage: State file lineage; null for show output.
	Lineage *string `json:"lineage"`
	// ResourceCount: Managed resource instances recorded.
	ResourceCount int64 `json:"resourceCount"`
	// DataSourceCount: Data-source entries, recorded but never matched against
	// inventory.
	DataSourceCount int64 `json:"dataSourceCount"`
	// RedactedAttributeCount: Attribute values dropped because the state marked
	// them sensitive. Redaction happens at parse time — no sensitive value is
	// ever stored.
	RedactedAttributeCount int64    `json:"redactedAttributeCount"`
	ParseWarnings          []string `json:"parseWarnings"`
	UploadedByUserID       *string  `json:"uploadedByUserId"`
	UploadedByName         *string  `json:"uploadedByName"`
	CreatedAt              string   `json:"createdAt"`
}

IacState is the `IacState` schema.

type IacStateListResponse added in v1.20.0

type IacStateListResponse struct {
	States []IacState `json:"states"`
}

IacStateListResponse is the `IacStateListResponse` schema.

type IacStateOnlyResource added in v1.20.0

type IacStateOnlyResource struct {
	Address       string                           `json:"address"`
	TerraformType string                           `json:"terraformType"`
	Identifiers   []string                         `json:"identifiers"`
	Candidates    []IacStateOnlyResourceCandidates `json:"candidates"`
	// Reason: One of "no-inventory-match", "unknown-terraform-type".
	Reason string `json:"reason"`
}

IacStateOnlyResource is the `IacStateOnlyResource` schema.

type IacStateOnlyResourceCandidates added in v1.20.0

type IacStateOnlyResourceCandidates struct {
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
}

IacStateOnlyResourceCandidates is an object the spec declares inline.

type IacStateUploadRequest added in v1.20.0

type IacStateUploadRequest struct {
	Label     string  `json:"label"`
	AccountID *string `json:"accountId,omitempty"`
	// Document: The state document, as text: a raw `.tfstate` (format version 4)
	// or the output of `terraform show -json` (format_version 1.x). Limited to 8
	// MiB.
	Document string `json:"document"`
}

IacStateUploadRequest is the `IacStateUploadRequest` schema.

type IacStatesCreateParams added in v1.20.0

type IacStatesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *IacStateUploadRequest
}

IacStatesCreateParams holds the parameters for `client.iac.states.create`.

Every field is optional; pass nil to take the defaults.

type IacStatesCreateResponse added in v1.20.0

type IacStatesCreateResponse struct {
	State IacState `json:"state"`
}

IacStatesCreateResponse is an object the spec declares inline.

type IacStatesDeleteParams added in v1.20.0

type IacStatesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	StateID string
}

IacStatesDeleteParams holds the parameters for `client.iac.states.delete`.

type IacStatesGetParams added in v1.20.0

type IacStatesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

IacStatesGetParams holds the parameters for `client.iac.states.get`.

Every field is optional; pass nil to take the defaults.

type IacStatesNamespace added in v1.20.0

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

IacStatesNamespace is `client.iac.states`.

func (*IacStatesNamespace) Create added in v1.20.0

Create: Upload a Terraform state document

Parses a `.tfstate` (format version 4) or `terraform show -json` output (format_version 1.x) and records the resource instances it contains. Attributes the state marks sensitive are dropped before anything is written. The format version is checked, not assumed: an unsupported version is a 400 rather than a partial read.

POST /api/org/{orgId}/iac/states

Raises on 400: Bad request

Raises on 404: Not found

func (*IacStatesNamespace) Delete added in v1.20.0

Delete: Delete an uploaded state document

DELETE /api/org/{orgId}/iac/states/{stateId}

Raises on 404: Not found

func (*IacStatesNamespace) Get added in v1.20.0

Get: List uploaded Terraform state documents

Every state document the organization has uploaded, newest first. The documents themselves are never stored — only the parsed, redacted projection.

GET /api/org/{orgId}/iac/states

type ImportSSHKeyRequest

type ImportSSHKeyRequest struct {
	Name      string `json:"name"`
	PublicKey string `json:"publicKey"`
}

ImportSSHKeyRequest is the `ImportSshKeyRequest` schema.

Spec schema: `ImportSshKeyRequest`.

type ImportYAMLRequest

type ImportYAMLRequest struct {
	AccountID        string      `json:"accountId"`
	YAML             string      `json:"yaml"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

ImportYAMLRequest is the `ImportYamlRequest` schema.

Spec schema: `ImportYamlRequest`.

type ImportedSSHKey

type ImportedSSHKey struct {
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	KeyType     SSHKeyType `json:"keyType"`
	Fingerprint string     `json:"fingerprint"`
	PublicKey   string     `json:"publicKey"`
	IsImported  bool       `json:"isImported"`
}

ImportedSSHKey is the `ImportedSshKey` schema.

Spec schema: `ImportedSshKey`.

type Incident added in v1.15.0

type Incident struct {
	ID    string `json:"id"`
	Title string `json:"title"`
	// Severity: Severity in the ordinary sev1..sev4 register. `sev1` is a
	// complete outage; `sev4` is cosmetic and tracked rather than paged.
	//
	// One of "sev1", "sev2", "sev3", "sev4".
	Severity string `json:"severity"`
	// Status: `mitigated` is a real state, not a synonym for resolved: impact
	// has stopped but the incident is still open for follow-up. Keeping it
	// separate is what makes time-to-mitigate a measurement rather than a guess.
	// Resolving runs the resolve path — the change freeze this incident opened
	// is lifted, and the status-page update it posted is closed.
	//
	// One of "open", "mitigated", "resolved".
	Status  string  `json:"status"`
	Summary *string `json:"summary"`
	// StartedAt: Backdatable — people declare after they start firefighting.
	StartedAt        string  `json:"startedAt"`
	MitigatedAt      *string `json:"mitigatedAt"`
	ResolvedAt       *string `json:"resolvedAt"`
	DeclaredByUserID *string `json:"declaredByUserId"`
	DeclaredByName   *string `json:"declaredByName"`
	ResolvedByUserID *string `json:"resolvedByUserId"`
	// AffectedResourceIDs: Advisory. Not foreign keys — the claim must survive
	// the resource being deleted.
	AffectedResourceIDs []string `json:"affectedResourceIds"`
	AffectedAccountIDs  []string `json:"affectedAccountIds"`
	// IssueURL: Where the write-up was filed, once anyone filed it.
	IssueURL  *string            `json:"issueUrl"`
	CreatedAt string             `json:"createdAt"`
	UpdatedAt string             `json:"updatedAt"`
	Artifacts []IncidentArtifact `json:"artifacts"`
	NoteCount int64              `json:"noteCount"`
}

Incident is the `Incident` schema.

type IncidentActions added in v1.15.0

type IncidentActions struct {
	// OpenFreeze: Open an org change freeze for the duration, lifted when the
	// incident resolves. Defaults to false — freezing has blast radius beyond
	// the incident. Needs `freezes:write`; without it the freeze is recorded as
	// a failed artefact naming the permission, and the incident still stands.
	OpenFreeze *bool `json:"openFreeze,omitempty"`
	// PinMoment: Pin the moment (a timestamp and a window) so `GET /moment` is
	// one click away. Defaults to true — it cannot fail, and the investigation
	// always wants it.
	PinMoment *bool `json:"pinMoment,omitempty"`
	// PostSlack: Announce through the org's alert routing rules under the
	// `incidentAlerts` trigger, so channels, quiet hours, escalation and the
	// acknowledge button all apply unchanged. Defaults to true. If no rule
	// matches, the artefact fails and says so.
	PostSlack *bool `json:"postSlack,omitempty"`
	// StatusPageID: Post a public update on this status page. Omitted means no
	// public update.
	StatusPageID *string `json:"statusPageId,omitempty"`
	// StatusPageComponentIDs: Components on that page to mark affected. Empty
	// means the page as a whole.
	StatusPageComponentIDs []string `json:"statusPageComponentIds,omitempty"`
}

IncidentActions is the `IncidentActions` schema.

type IncidentArtifact added in v1.15.0

type IncidentArtifact struct {
	ID string `json:"id"`
	// Kind: Which side effect of declaring this artefact records.
	//
	// One of "freeze", "moment", "slack", "status-page".
	Kind string `json:"kind"`
	// Status: `failed` is a stored state, not an error: declaring writes the
	// incident first and attempts each opted-in side effect afterwards, so a
	// Slack outage costs the announcement and never the incident. A failed
	// artefact carries its error and can be retried.
	//
	// `close_failed` is the other half and is deliberately distinct: the
	// artefact **was** created and resolving could not put it away, so the
	// change freeze is still in force or the public notice still reports an
	// outage. Retrying a `failed` artefact re-creates it; retrying a
	// `close_failed` one re-closes it. Collapsing the two would either strand
	// the incident with a live freeze nothing can lift, or open a second freeze.
	//
	// One of "created", "failed", "closed", "close_failed".
	Status string `json:"status"`
	// Label: Human label — the freeze name, the destination count.
	Label *string `json:"label"`
	// RefID: Freeze id, notice id, Slack channel id…
	RefID *string `json:"refId"`
	// RefSecondary: Second half of a compound reference — a Slack message ts, a
	// window width.
	RefSecondary *string `json:"refSecondary"`
	// Error: Why it failed. Null unless `status` is `failed` or `close_failed`.
	Error     *string                  `json:"error"`
	Request   *IncidentArtifactRequest `json:"request"`
	CreatedAt string                   `json:"createdAt"`
	UpdatedAt string                   `json:"updatedAt"`
}

IncidentArtifact is the `IncidentArtifact` schema.

type IncidentArtifactRequest added in v1.15.0

type IncidentArtifactRequest struct {
	StatusPageID *string  `json:"statusPageId,omitempty"`
	ComponentIDs []string `json:"componentIds,omitempty"`
}

IncidentArtifactRequest: What the declaration asked for, recorded so a retry asks for the same thing. Present on the status-page artefact, where a retry that forgot the operator's chosen components would publish the outage against the whole page.

The API may send null in its place.

type IncidentDeclare added in v1.15.0

type IncidentDeclare struct {
	Title string `json:"title"`
	// Severity: Severity in the ordinary sev1..sev4 register. `sev1` is a
	// complete outage; `sev4` is cosmetic and tracked rather than paged.
	//
	// One of "sev1", "sev2", "sev3", "sev4".
	Severity *string `json:"severity,omitempty"`
	Summary  *string `json:"summary,omitempty"`
	// StartedAt: Defaults to now.
	StartedAt           *string          `json:"startedAt,omitempty"`
	AffectedResourceIDs []string         `json:"affectedResourceIds,omitempty"`
	AffectedAccountIDs  []string         `json:"affectedAccountIds,omitempty"`
	Actions             *IncidentActions `json:"actions,omitempty"`
}

IncidentDeclare is the `IncidentDeclare` schema.

type IncidentDetail added in v1.15.0

type IncidentDetail struct {
	Incident Incident       `json:"incident"`
	Notes    []IncidentNote `json:"notes"`
}

IncidentDetail is the `IncidentDetail` schema.

type IncidentList added in v1.15.0

type IncidentList struct {
	Incidents []Incident `json:"incidents"`
}

IncidentList is the `IncidentList` schema.

type IncidentNote added in v1.15.0

type IncidentNote struct {
	ID           string  `json:"id"`
	Body         string  `json:"body"`
	AuthorUserID *string `json:"authorUserId"`
	AuthorName   *string `json:"authorName"`
	// OccurredAt: When the note is *about*, which may precede when it was
	// written — a note typed at 04:00 can be dated to 03:14 and lands there on
	// the timeline.
	OccurredAt string `json:"occurredAt"`
	CreatedAt  string `json:"createdAt"`
}

IncidentNote is the `IncidentNote` schema.

type IncidentNoteCreate added in v1.15.0

type IncidentNoteCreate struct {
	Body string `json:"body"`
	// OccurredAt: Defaults to now; backdate to place the note.
	OccurredAt *string `json:"occurredAt,omitempty"`
}

IncidentNoteCreate is the `IncidentNoteCreate` schema.

type IncidentPatch added in v1.15.0

type IncidentPatch struct {
	Title *string `json:"title,omitempty"`
	// Severity: Severity in the ordinary sev1..sev4 register. `sev1` is a
	// complete outage; `sev4` is cosmetic and tracked rather than paged.
	//
	// One of "sev1", "sev2", "sev3", "sev4".
	Severity *string `json:"severity,omitempty"`
	// Status: `mitigated` is a real state, not a synonym for resolved: impact
	// has stopped but the incident is still open for follow-up. Keeping it
	// separate is what makes time-to-mitigate a measurement rather than a guess.
	// Resolving runs the resolve path — the change freeze this incident opened
	// is lifted, and the status-page update it posted is closed.
	//
	// One of "open", "mitigated", "resolved".
	Status              *string  `json:"status,omitempty"`
	Summary             *string  `json:"summary,omitempty"`
	AffectedResourceIDs []string `json:"affectedResourceIds,omitempty"`
	AffectedAccountIDs  []string `json:"affectedAccountIds,omitempty"`
	IssueURL            *string  `json:"issueUrl,omitempty"`
}

IncidentPatch is the `IncidentPatch` schema.

type IncidentPostmortem added in v1.15.0

type IncidentPostmortem struct {
	Markdown string `json:"markdown"`
	Filename string `json:"filename"`
}

IncidentPostmortem is the `IncidentPostmortem` schema.

type IncidentTimeline added in v1.15.0

type IncidentTimeline struct {
	IncidentID string `json:"incidentId"`
	From       string `json:"from"`
	// To: `resolvedAt`, or the server's clock while the incident is open.
	To          string                  `json:"to"`
	GeneratedAt string                  `json:"generatedAt"`
	Entries     []IncidentTimelineEntry `json:"entries"`
	// Feeds: Per-feed health, passed through from the moment union: `omitted`
	// means the caller lacks that feed's read permission, `error` means it
	// failed and the rest is still good.
	Feeds     []IncidentTimelineFeeds `json:"feeds"`
	Truncated bool                    `json:"truncated"`
}

IncidentTimeline is the `IncidentTimeline` schema.

type IncidentTimelineEntry added in v1.15.0

type IncidentTimelineEntry struct {
	ID string `json:"id"`
	// Source: `moment` covers everything the moment union already indexes —
	// resource changes, deployments, cost anomalies, provider status incidents,
	// audit entries, change freezes and workflow runs. Nothing is copied into
	// the incident's own tables; the timeline is a join, so re-reading it
	// reflects the record as it stands today.
	//
	// One of "incident", "note", "artifact", "moment", "probe", "metric-alert".
	Source string `json:"source"`
	// Kind: `<noun>.<verb>`. Open set — render unknown kinds generically.
	Kind   string  `json:"kind"`
	At     string  `json:"at"`
	Title  string  `json:"title"`
	Detail *string `json:"detail,omitempty"`
	// Severity: One of "info", "warning", "critical".
	Severity     string                     `json:"severity"`
	AuthorName   *string                    `json:"authorName,omitempty"`
	ResourceID   *string                    `json:"resourceId,omitempty"`
	ResourceName *string                    `json:"resourceName,omitempty"`
	PluginID     *string                    `json:"pluginId,omitempty"`
	AccountID    *string                    `json:"accountId,omitempty"`
	Link         *IncidentTimelineEntryLink `json:"link,omitempty"`
}

IncidentTimelineEntry is the `IncidentTimelineEntry` schema.

type IncidentTimelineEntryLink struct {
	// Kind: One of "resource", "changes", "provider-incident", "costs",
	// "workflow-run", "deployment", "audit", "freeze", "expiring", "probe",
	// "metric-alert", "incident".
	Kind     string  `json:"kind"`
	ID       *string `json:"id,omitempty"`
	ParentID *string `json:"parentId,omitempty"`
	URL      *string `json:"url,omitempty"`
}

IncidentTimelineEntryLink is an object the spec declares inline.

type IncidentTimelineFeeds added in v1.15.0

type IncidentTimelineFeeds struct {
	Feed string `json:"feed"`
	// Status: One of "ok", "omitted", "error".
	Status string  `json:"status"`
	Error  *string `json:"error,omitempty"`
}

IncidentTimelineFeeds is an object the spec declares inline.

type IncidentsCreateParams added in v1.15.0

type IncidentsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *IncidentDeclare
}

IncidentsCreateParams holds the parameters for `client.incidents.create`.

Every field is optional; pass nil to take the defaults.

type IncidentsDeleteParams added in v1.15.0

type IncidentsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	IncidentID string
}

IncidentsDeleteParams holds the parameters for `client.incidents.delete`.

type IncidentsGetGetOrgOrgIDIncidentsIncidentIDParams added in v1.15.0

type IncidentsGetGetOrgOrgIDIncidentsIncidentIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	IncidentID string
}

IncidentsGetGetOrgOrgIDIncidentsIncidentIDParams holds the parameters for `client.incidents.get.getOrgOrgIdIncidentsIncidentId`.

type IncidentsGetGetParams added in v1.15.0

type IncidentsGetGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Status: `open`, `mitigated`, `resolved`, or `all` (the default).
	Status *string
}

IncidentsGetGetParams holds the parameters for `client.incidents.get.get`.

Every field is optional; pass nil to take the defaults.

type IncidentsGetNamespace added in v1.15.0

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

IncidentsGetNamespace is `client.incidents.get`.

func (*IncidentsGetNamespace) Get added in v1.15.0

Get: List declared incidents

Every incident the organization has declared, newest first, each with the artefacts its declaration created — including the ones that failed.

_Requires permission: `incidents:read`._

GET /api/org/{orgId}/incidents

func (*IncidentsGetNamespace) GetOrgOrgIDIncidentsIncidentID added in v1.15.0

GetOrgOrgIDIncidentsIncidentID: Read one incident

The incident with its artefacts and its operator notes.

_Requires permission: `incidents:read`._

GET /api/org/{orgId}/incidents/{incidentId}

Raises on 404: Not found

type IncidentsNamespace added in v1.15.0

type IncidentsNamespace struct {

	// Get: `client.incidents.get`.
	Get *IncidentsGetNamespace
	// Notes: `client.incidents.notes`.
	Notes *IncidentsNotesNamespace
	// contains filtered or unexported fields
}

IncidentsNamespace is `client.incidents`.

func (*IncidentsNamespace) Create added in v1.15.0

Create: Declare an incident

Record the incident and perform the opted-in side effects. The incident row is written first and alone: a 201 means it exists, and the `artifacts` array on the response says what else happened. No side effect can lose the declaration, and none is swallowed. Audit-logged.

_Requires permission: `incidents:write`._

POST /api/org/{orgId}/incidents

Raises on 400: Bad request

Raises on 403: Forbidden

func (*IncidentsNamespace) Delete added in v1.15.0

Delete: Delete an incident

Removes the incident, its notes and its artefact records. It does not lift a freeze or close a status-page update — resolve for that; deleting is for a mis-declaration. Audit-logged.

_Requires permission: `incidents:write`._

DELETE /api/org/{orgId}/incidents/{incidentId}

Raises on 404: Not found

func (*IncidentsNamespace) Postmortem added in v1.15.0

Postmortem: Export a pre-filled postmortem

Markdown with the timeline, the affected resources, the duration, the time to mitigate and the notes already filled in. The analysis headings — impact, root cause, action items — are deliberately left blank: a generated document that guesses at a root cause is worse than one that leaves a heading.

_Requires permission: `incidents:read`._

GET /api/org/{orgId}/incidents/{incidentId}/postmortem

Raises on 404: Not found

func (*IncidentsNamespace) RetryArtifacts added in v1.15.0

func (n *IncidentsNamespace) RetryArtifacts(ctx context.Context, params IncidentsRetryArtifactsParams, opts ...RequestOption) (*Incident, error)

RetryArtifacts: Retry the artefacts that failed

Re-runs only the side effects whose artefact is in a failure state, replacing each failure rather than queueing a second attempt beside it. A `failed` artefact is **re-created**; a `close_failed` one is **re-closed** — re-creating the latter would open a second change freeze or post a duplicate public notice. A status-page retry reuses the components recorded on the artefact's `request`, so the announcement keeps its original scope. Its own endpoint rather than a flag on PATCH, because it writes into three external systems. Audit-logged.

_Requires permission: `incidents:write`._

POST /api/org/{orgId}/incidents/{incidentId}/retry-artifacts

Raises on 404: Not found

func (*IncidentsNamespace) Timeline added in v1.15.0

Timeline: Assemble the incident's timeline

Merged on read from what is already recorded between the incident's start and its resolution: resource changes, deployments, cost anomalies, provider status incidents, audit entries, change freezes and workflow runs (all via the same union the Moment screen uses), plus probe state transitions, metric-alert firings, the incident's own life events, its artefacts and its operator notes. Nothing is copied — a correction upstream shows up here on the next read.

Probe transitions are an approximation: `synthetic_probes` keeps only a single `lastStateChangeAt`, so a probe that flapped twice inside the window contributes its most recent flip and no more.

_Requires permission: `incidents:read`._

GET /api/org/{orgId}/incidents/{incidentId}/timeline

Raises on 404: Not found

func (*IncidentsNamespace) Update added in v1.15.0

Update: Edit or transition an incident

Omitted fields keep their value. Setting `status` stamps the matching timestamp, and resolving undoes exactly what this incident created — the freeze whose id is on its own artefact, not whatever freeze happens to be in effect. Resolving an incident that was never marked mitigated back-fills `mitigatedAt` from `resolvedAt`. Audit-logged.

_Requires permission: `incidents:write`._

PATCH /api/org/{orgId}/incidents/{incidentId}

Raises on 400: Bad request

Raises on 404: Not found

type IncidentsNotesCreateParams added in v1.15.0

type IncidentsNotesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	IncidentID string
	// Body: the JSON request body.
	Body *IncidentNoteCreate
}

IncidentsNotesCreateParams holds the parameters for `client.incidents.notes.create`.

type IncidentsNotesDeleteParams added in v1.15.0

type IncidentsNotesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	IncidentID string
	NoteID     string
}

IncidentsNotesDeleteParams holds the parameters for `client.incidents.notes.delete`.

type IncidentsNotesNamespace added in v1.15.0

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

IncidentsNotesNamespace is `client.incidents.notes`.

func (*IncidentsNotesNamespace) Create added in v1.15.0

Create: Add an operator note

The running commentary no join can reconstruct. `occurredAt` may be backdated so a note typed at 04:00 lands on the timeline where it belongs.

_Requires permission: `incidents:write`._

POST /api/org/{orgId}/incidents/{incidentId}/notes

Raises on 400: Bad request

Raises on 404: Not found

func (*IncidentsNotesNamespace) Delete added in v1.15.0

Delete: Delete an operator note

_Requires permission: `incidents:write`._

DELETE /api/org/{orgId}/incidents/{incidentId}/notes/{noteId}

Raises on 404: Not found

type IncidentsPostmortemParams added in v1.15.0

type IncidentsPostmortemParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	IncidentID string
}

IncidentsPostmortemParams holds the parameters for `client.incidents.postmortem`.

type IncidentsRetryArtifactsParams added in v1.15.0

type IncidentsRetryArtifactsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	IncidentID string
}

IncidentsRetryArtifactsParams holds the parameters for `client.incidents.retryArtifacts`.

type IncidentsTimelineParams added in v1.15.0

type IncidentsTimelineParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	IncidentID string
}

IncidentsTimelineParams holds the parameters for `client.incidents.timeline`.

type IncidentsUpdateParams added in v1.15.0

type IncidentsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	IncidentID string
	// Body: the JSON request body.
	Body *IncidentPatch
}

IncidentsUpdateParams holds the parameters for `client.incidents.update`.

type Invitation

type Invitation struct {
	ID         string           `json:"id"`
	Email      string           `json:"email"`
	Role       OrganizationRole `json:"role"`
	RoleID     *string          `json:"roleId"`
	RoleName   *string          `json:"roleName"`
	AcceptedAt *string          `json:"acceptedAt"`
	ExpiresAt  string           `json:"expiresAt"`
	CreatedAt  string           `json:"createdAt"`
}

Invitation is the `Invitation` schema.

type InvitationDetail

type InvitationDetail struct {
	ID               string           `json:"id"`
	Email            string           `json:"email"`
	Role             OrganizationRole `json:"role"`
	ExpiresAt        string           `json:"expiresAt"`
	AcceptedAt       *string          `json:"acceptedAt"`
	OrganizationID   string           `json:"organizationId"`
	OrganizationName string           `json:"organizationName"`
}

InvitationDetail is the `InvitationDetail` schema.

type InvitationsAcceptParams

type InvitationsAcceptParams struct {
	// Body: the JSON request body.
	Body AcceptInvitationRequest
}

InvitationsAcceptParams holds the parameters for `client.invitations.accept`.

type InvitationsByTokenGetParams

type InvitationsByTokenGetParams struct {
	Token string
}

InvitationsByTokenGetParams holds the parameters for `client.invitations.byToken.get`.

type InvitationsByTokenNamespace

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

InvitationsByTokenNamespace is `client.invitations.byToken`.

func (*InvitationsByTokenNamespace) Get

Get: Get invitation details by token

GET /api/invitations/by-token/{token}

Raises on 404: Not found

type InvitationsNamespace

type InvitationsNamespace struct {

	// ByToken: `client.invitations.byToken`.
	ByToken *InvitationsByTokenNamespace
	// contains filtered or unexported fields
}

InvitationsNamespace is `client.invitations`.

func (*InvitationsNamespace) Accept

Accept: Accept an invitation

POST /api/invitations/accept

Raises on 400: Bad request

Raises on 403: Forbidden

type InviteRequest

type InviteRequest struct {
	Email  string            `json:"email"`
	Role   *OrganizationRole `json:"role,omitempty"`
	RoleID *string           `json:"roleId,omitempty"`
	// AddSeat: When the paid plan is full (409 seat_limit_reached), retry with
	// this set to buy one more monthly seat and send the invitation. Requires
	// billing:write. Only works when the 409 reported `canAddSeat: true` — an
	// org whose capacity is entirely prepaid capacity slots has no monthly seat
	// to add.
	AddSeat *bool `json:"addSeat,omitempty"`
}

InviteRequest is the `InviteRequest` schema.

type InviteResponse

type InviteResponse struct {
	ID    string `json:"id"`
	Token string `json:"token"`
}

InviteResponse is the `InviteResponse` schema.

type Invoice added in v1.9.0

type Invoice struct {
	ID                 string `json:"id"`
	ManagedAccountID   string `json:"managedAccountId"`
	ManagedAccountName string `json:"managedAccountName"`
	// Number: `INV-2026-0001`. Null while draft — numbers are assigned at
	// approval so a deleted draft cannot leave a gap in the sequence.
	Number                *string           `json:"number"`
	Status                InvoiceStatus     `json:"status"`
	PeriodFrom            string            `json:"periodFrom"`
	PeriodTo              string            `json:"periodTo"`
	Currency              string            `json:"currency"`
	Totals                *InvoiceTotals    `json:"totals,omitempty"`
	IssuedAt              *string           `json:"issuedAt"`
	SentAt                *string           `json:"sentAt"`
	Delivery              *InvoiceDelivery  `json:"delivery"`
	VoidedAt              *string           `json:"voidedAt"`
	VoidReason            *string           `json:"voidReason"`
	SupersedesInvoiceID   *string           `json:"supersedesInvoiceId"`
	SupersededByInvoiceID *string           `json:"supersededByInvoiceId"`
	CreatedAt             string            `json:"createdAt"`
	UpdatedAt             string            `json:"updatedAt"`
	Notes                 *string           `json:"notes"`
	Lines                 []InvoiceLine     `json:"lines"`
	Derivation            InvoiceDerivation `json:"derivation"`
	// Live: True when the figures in this response were recomputed for it — true
	// for a draft, false for everything else. Say so: “these numbers will move”
	// and “these numbers are what we sent” are different claims about the same
	// fields.
	Live             bool    `json:"live"`
	ComputedAt       string  `json:"computedAt"`
	ApprovedByUserID *string `json:"approvedByUserId"`
	SentByUserID     *string `json:"sentByUserId"`
	VoidedByUserID   *string `json:"voidedByUserId"`
	CreatedByUserID  *string `json:"createdByUserId"`
}

Invoice is the `Invoice` schema.

type InvoiceDelivery added in v1.9.0

type InvoiceDelivery struct {
	// Status: `pending` means an attempt was claimed and its outcome never
	// recorded — the process died mid-send, so whether the customer received it
	// is unknown. It is not a failure and is never retried automatically.
	//
	// One of "pending", "succeeded", "partial", "failed", "no_targets".
	Status string `json:"status"`
	// Recipients: The addresses this attempt was made to, as the customer record
	// had them then.
	Recipients []string `json:"recipients"`
	// Delivered: How many the mail provider accepted.
	Delivered   int64  `json:"delivered"`
	AttemptedAt string `json:"attemptedAt"`
	// DeliveredAt: The last attempt that reached at least one address, or null
	// when none ever has. Never cleared by a later failure — it is a fact about
	// the past, and it is what decides whether sending again is a retry or a
	// second copy.
	DeliveredAt *string `json:"deliveredAt"`
	Attempts    int64   `json:"attempts"`
	Error       *string `json:"error"`
}

InvoiceDelivery: The last delivery attempt, or null when none has been made — including on an invoice marked sent by a deployment with no mail provider. “A person released this” and “we delivered it” are different claims, and this field is only ever the second.

The API may send null in its place.

type InvoiceDerivation added in v1.9.0

type InvoiceDerivation struct {
	// CostBasis: One of "cash", "amortized".
	CostBasis         string `json:"costBasis"`
	ApplyBillingRules bool   `json:"applyBillingRules"`
	// RateDate: The day the exchange rates were read — always the period's last
	// day. One rate for the period rather than a per-day blend: “January, at the
	// 31 January rate” is a sentence a finance team can reproduce.
	RateDate string                   `json:"rateDate"`
	Rates    []InvoiceDerivationRates `json:"rates"`
	// Unconverted: Currencies the organisation had stated no usable rate for. A
	// non-empty list blocks approval: an invoice that cannot be expressed as one
	// number in the customer's currency must not be frozen.
	Unconverted []string                 `json:"unconverted"`
	Rules       []InvoiceDerivationRules `json:"rules"`
	Scope       InvoiceDerivationScope   `json:"scope"`
	// MissingScope: Scope entries that no longer exist. Recorded rather than
	// silently skipped — an invoice that is quietly short is worse than one that
	// says why.
	MissingScope []string `json:"missingScope"`
}

InvoiceDerivation: Everything needed to re-derive the invoice by hand. Not decoration: an invoice a customer cannot reconcile is an invoice a customer does not pay.

type InvoiceDerivationRates added in v1.9.0

type InvoiceDerivationRates struct {
	Currency      string  `json:"currency"`
	Rate          float64 `json:"rate"`
	EffectiveFrom string  `json:"effectiveFrom"`
}

InvoiceDerivationRates is an object the spec declares inline.

type InvoiceDerivationRules added in v1.9.0

type InvoiceDerivationRules struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// Kind: One of "percentage", "fixed", "reallocation".
	Kind    string `json:"kind"`
	Summary string `json:"summary"`
}

InvoiceDerivationRules is an object the spec declares inline.

type InvoiceDerivationScope added in v1.9.0

type InvoiceDerivationScope struct {
	CostCentres []InvoiceDerivationScopeCostCentres `json:"costCentres"`
	Accounts    []InvoiceDerivationScopeAccounts    `json:"accounts"`
}

InvoiceDerivationScope is an object the spec declares inline.

type InvoiceDerivationScopeAccounts added in v1.9.0

type InvoiceDerivationScopeAccounts struct {
	ID    string `json:"id"`
	Label string `json:"label"`
}

InvoiceDerivationScopeAccounts is an object the spec declares inline.

type InvoiceDerivationScopeCostCentres added in v1.9.0

type InvoiceDerivationScopeCostCentres struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

InvoiceDerivationScopeCostCentres is an object the spec declares inline.

type InvoiceInput added in v1.9.0

type InvoiceInput struct {
	ManagedAccountID string  `json:"managedAccountId"`
	PeriodFrom       string  `json:"periodFrom"`
	PeriodTo         string  `json:"periodTo"`
	Notes            *string `json:"notes,omitempty"`
	// SupersedesInvoiceID: The void invoice this one corrects. The original must
	// already be void — a correction that leaves the original standing means the
	// customer holds two live invoices for one period.
	SupersedesInvoiceID *string `json:"supersedesInvoiceId,omitempty"`
}

InvoiceInput: A new invoice is always a draft. There is no status field and no scope field: generating and issuing are two acts, and the scope comes from the customer.

type InvoiceLine added in v1.9.0

type InvoiceLine struct {
	// Kind: One of "cost_centre", "account", "fixed".
	Kind string `json:"kind"`
	// RefID: Cost-centre id, account id, or null for an org-level fixed charge.
	RefID *string `json:"refId"`
	// Label: The name at issue time, frozen with the numbers — renaming a cost
	// centre in March must not retitle a line on January's invoice.
	Label string `json:"label"`
	// Currency: The currency the providers billed in.
	Currency string `json:"currency"`
	// Collected: What the providers charged for this scope, before any billing
	// rule.
	Collected float64 `json:"collected"`
	// Adjustment: What the organisation's billing rules added or removed.
	Adjustment float64 `json:"adjustment"`
	// Adjusted: `collected + adjustment`.
	Adjusted float64 `json:"adjusted"`
	// Rate: The rate applied to reach `billed`. 1 when the line is already in
	// the invoice currency; null when the organisation has stated no rate for
	// this currency, in which case the amount is carried in its own currency
	// rather than dropped or invented.
	Rate *float64 `json:"rate"`
	// Billed: `adjusted × rate`, in the invoice currency.
	Billed *float64 `json:"billed"`
}

InvoiceLine: One scope entry in one collected currency. Two currencies for one cost centre are two lines, not one blended line, because the conversion is a separately reconcilable step.

type InvoiceSendRequest added in v1.9.0

type InvoiceSendRequest struct {
	// Resend: Send another copy of an invoice that has already reached somebody.
	// Required only in that case: retrying a delivery that reached nobody
	// (`failed`, `no_targets`) needs no flag, because there is no inbox to
	// duplicate into. Refused with 409 without it when the last attempt landed,
	// or when its outcome is unknown (`pending`).
	Resend *bool `json:"resend,omitempty"`
}

InvoiceSendRequest is the `InvoiceSendRequest` schema.

type InvoiceStatus added in v1.9.0

type InvoiceStatus = string

InvoiceStatus: `draft` → `approved` → `sent`, plus `void` from either issued state.

**A draft recomputes its figures from live spend on every read; an approved, sent or void invoice never does.** Approval is the freeze: the lines, the totals, the exchange rates and the day they were read, the billing rules in force and the names of everything in scope are written onto the invoice, and no later restatement of spend, change of rate, edit of a rule or rename can alter what the document says.

An issued invoice is never edited and never deleted. A wrong one is voided with a reason and superseded by a corrective invoice; both survive. The server enforces this, not just the UI.

const (
	InvoiceStatusDraft    InvoiceStatus = "draft"
	InvoiceStatusApproved InvoiceStatus = "approved"
	InvoiceStatusSent     InvoiceStatus = "sent"
	InvoiceStatusVoid     InvoiceStatus = "void"
)

The values InvoiceStatus takes.

type InvoiceSummary added in v1.9.0

type InvoiceSummary struct {
	ID                 string `json:"id"`
	ManagedAccountID   string `json:"managedAccountId"`
	ManagedAccountName string `json:"managedAccountName"`
	// Number: `INV-2026-0001`. Null while draft — numbers are assigned at
	// approval so a deleted draft cannot leave a gap in the sequence.
	Number                *string          `json:"number"`
	Status                InvoiceStatus    `json:"status"`
	PeriodFrom            string           `json:"periodFrom"`
	PeriodTo              string           `json:"periodTo"`
	Currency              string           `json:"currency"`
	Totals                *InvoiceTotals   `json:"totals"`
	IssuedAt              *string          `json:"issuedAt"`
	SentAt                *string          `json:"sentAt"`
	Delivery              *InvoiceDelivery `json:"delivery"`
	VoidedAt              *string          `json:"voidedAt"`
	VoidReason            *string          `json:"voidReason"`
	SupersedesInvoiceID   *string          `json:"supersedesInvoiceId"`
	SupersededByInvoiceID *string          `json:"supersededByInvoiceId"`
	CreatedAt             string           `json:"createdAt"`
	UpdatedAt             string           `json:"updatedAt"`
}

InvoiceSummary is the `InvoiceSummary` schema.

type InvoiceTotals added in v1.9.0

type InvoiceTotals struct {
	// Collected: Currency code → amount in the currency's major unit.
	Collected map[string]float64 `json:"collected"`
	// Adjustment: Currency code → amount in the currency's major unit.
	Adjustment map[string]float64 `json:"adjustment"`
	// Adjusted: Currency code → amount in the currency's major unit.
	Adjusted map[string]float64 `json:"adjusted"`
	// Billed: Keyed by the invoice currency, plus any currency that could not be
	// converted — which keeps its own key so the total is never quietly short.
	Billed map[string]float64 `json:"billed"`
}

InvoiceTotals: **Null for a draft** — null, not zero. A draft's figures are recomputed on read and the list does not recompute; fetch the invoice by id for a draft's current numbers.

The API may send null in its place.

type InvoiceUpdate added in v1.9.0

type InvoiceUpdate struct {
	PeriodFrom string  `json:"periodFrom"`
	PeriodTo   string  `json:"periodTo"`
	Notes      *string `json:"notes,omitempty"`
}

InvoiceUpdate is the `InvoiceUpdate` schema.

type InvoiceVoidRequest added in v1.9.0

type InvoiceVoidRequest struct {
	// Reason: Required. The only record of why a customer was sent an invoice
	// that was then withdrawn.
	Reason string `json:"reason"`
	// Supersede: Raise the corrective draft in the same call, linked both ways
	// to the original. Doing it in one call is what keeps the pair from being
	// left half-made by a failed second request.
	Supersede *bool `json:"supersede,omitempty"`
}

InvoiceVoidRequest is the `InvoiceVoidRequest` schema.

type InvoiceVoidResponse added in v1.9.0

type InvoiceVoidResponse struct {
	Invoice     Invoice                        `json:"invoice"`
	Replacement InvoiceVoidResponseReplacement `json:"replacement"`
}

InvoiceVoidResponse is the `InvoiceVoidResponse` schema.

type InvoiceVoidResponseReplacement added in v1.9.0

type InvoiceVoidResponseReplacement struct {
	ID                 string `json:"id"`
	ManagedAccountID   string `json:"managedAccountId"`
	ManagedAccountName string `json:"managedAccountName"`
	// Number: `INV-2026-0001`. Null while draft — numbers are assigned at
	// approval so a deleted draft cannot leave a gap in the sequence.
	Number                *string           `json:"number"`
	Status                InvoiceStatus     `json:"status"`
	PeriodFrom            string            `json:"periodFrom"`
	PeriodTo              string            `json:"periodTo"`
	Currency              string            `json:"currency"`
	Totals                *InvoiceTotals    `json:"totals,omitempty"`
	IssuedAt              *string           `json:"issuedAt"`
	SentAt                *string           `json:"sentAt"`
	Delivery              *InvoiceDelivery  `json:"delivery"`
	VoidedAt              *string           `json:"voidedAt"`
	VoidReason            *string           `json:"voidReason"`
	SupersedesInvoiceID   *string           `json:"supersedesInvoiceId"`
	SupersededByInvoiceID *string           `json:"supersededByInvoiceId"`
	CreatedAt             string            `json:"createdAt"`
	UpdatedAt             string            `json:"updatedAt"`
	Notes                 *string           `json:"notes"`
	Lines                 []InvoiceLine     `json:"lines"`
	Derivation            InvoiceDerivation `json:"derivation"`
	// Live: True when the figures in this response were recomputed for it — true
	// for a draft, false for everything else. Say so: “these numbers will move”
	// and “these numbers are what we sent” are different claims about the same
	// fields.
	Live             bool    `json:"live"`
	ComputedAt       string  `json:"computedAt"`
	ApprovedByUserID *string `json:"approvedByUserId"`
	SentByUserID     *string `json:"sentByUserId"`
	VoidedByUserID   *string `json:"voidedByUserId"`
	CreatedByUserID  *string `json:"createdByUserId"`
}

InvoiceVoidResponseReplacement is an object the spec declares inline.

type InvoicesApproveParams added in v1.9.0

type InvoicesApproveParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

InvoicesApproveParams holds the parameters for `client.invoices.approve`.

type InvoicesCreateParams added in v1.9.0

type InvoicesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body InvoiceInput
}

InvoicesCreateParams holds the parameters for `client.invoices.create`.

type InvoicesDeleteParams added in v1.9.0

type InvoicesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

InvoicesDeleteParams holds the parameters for `client.invoices.delete`.

type InvoicesExportParams added in v1.9.0

type InvoicesExportParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

InvoicesExportParams holds the parameters for `client.invoices.export`.

type InvoicesGetParams added in v1.9.0

type InvoicesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

InvoicesGetParams holds the parameters for `client.invoices.get`.

type InvoicesListParams added in v1.9.0

type InvoicesListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID            *string
	ManagedAccountID *string
	Status           *InvoiceStatus
}

InvoicesListParams holds the parameters for `client.invoices.list`.

Every field is optional; pass nil to take the defaults.

type InvoicesNamespace added in v1.9.0

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

InvoicesNamespace is `client.invoices`.

func (*InvoicesNamespace) Approve added in v1.9.0

func (n *InvoicesNamespace) Approve(ctx context.Context, params InvoicesApproveParams, opts ...RequestOption) (*Invoice, error)

Approve: Approve an invoice — freeze its figures

Computes the figures one last time and writes them onto the invoice together with the exchange rates, the day they were read, the billing rules in force and the names everything in scope had. From here the invoice is a document, not a query.

A distinct act from generation, on a distinct permission (`invoices:issue`), with its own audit entry recording who approved what.

Refused with 409 when a currency in the invoice has no stated exchange rate: an approved invoice has to be quotable as one number in the customer's currency.

Refused with 409, too, when the draft or its customer changed while the figures were being computed — a different period, scope, currency, cost basis or billing-rules setting. Nothing is approved in that case: freezing figures that describe a different question would be worse than making the caller look again.

_Requires permission: `invoices:issue`._

POST /api/org/{orgId}/invoices/{id}/approve

Raises on 404: Not found

Raises on 409: Conflict

func (*InvoicesNamespace) Create added in v1.9.0

func (n *InvoicesNamespace) Create(ctx context.Context, params InvoicesCreateParams, opts ...RequestOption) (*Invoice, error)

Create: Raise a draft invoice

Always lands in `draft`. Generating and issuing are two acts on two permissions: a mistyped period must not be able to reach a customer without anyone having read the numbers.

_Requires permission: `invoices:write`._

POST /api/org/{orgId}/invoices

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

func (*InvoicesNamespace) Delete added in v1.9.0

func (n *InvoicesNamespace) Delete(ctx context.Context, params InvoicesDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete a draft invoice

Draft only, and refused with 409 otherwise. An issued invoice is voided; deleting one would erase a document a customer holds a copy of.

_Requires permission: `invoices:write`._

DELETE /api/org/{orgId}/invoices/{id}

Raises on 404: Not found

Raises on 409: Conflict

func (*InvoicesNamespace) Export added in v1.9.0

Export: Download an invoice as CSV

The derivation, not a rendered document: what was collected, what the rules added, the rate and the day it was read, and the final figure — every column an accounts-payable clerk needs to check the arithmetic. Same RFC 4180 quoting as the scheduled cost exports.

_Requires permission: `invoices:read`._

GET /api/org/{orgId}/invoices/{id}/export

Raises on 404: Not found

func (*InvoicesNamespace) Get added in v1.9.0

Get: Get an invoice

**A draft recomputes from live spend; an approved, sent or void invoice does not.** `live` says which happened. A frozen invoice returns the figures written at approval and does not read cost data at all.

_Requires permission: `invoices:read`._

GET /api/org/{orgId}/invoices/{id}

Raises on 404: Not found

func (*InvoicesNamespace) List added in v1.9.0

List: List invoices

Summaries, newest period first. A draft's `totals` is null here rather than recomputed — recomputing every draft would make opening the list one cost-data scan per draft, and zero would be a lie the reader cannot detect.

_Requires permission: `invoices:read`._

GET /api/org/{orgId}/invoices

Raises on 400: Bad request

func (*InvoicesNamespace) Send added in v1.9.0

Send: Send an invoice to its customer

Changes no figure — the document was frozen at approval. It records the **release** (this may go to the customer, and this person said so), then emails the invoice to the customer's contact addresses with the CSV attached.

**200 even when delivery failed.** The release happened and is recorded either way; `delivery` says what became of the transport. An error status would leave the caller unable to tell which of the two failed. A failed delivery is visible, and re-sending retries it.

Sending again needs `resend: true` only when the last attempt reached somebody — see `InvoiceSendRequest`. The body may be omitted entirely for a first send.

_Requires permission: `invoices:issue`._

POST /api/org/{orgId}/invoices/{id}/send

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

func (*InvoicesNamespace) Update added in v1.9.0

func (n *InvoicesNamespace) Update(ctx context.Context, params InvoicesUpdateParams, opts ...RequestOption) (*Invoice, error)

Update: Edit a draft invoice

Draft only. An approved, sent or void invoice is refused with 409 by the service, not merely hidden by the UI — an issued invoice that silently changed after the customer received it is the worst outcome this feature could produce.

_Requires permission: `invoices:write`._

PUT /api/org/{orgId}/invoices/{id}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

func (*InvoicesNamespace) Void added in v1.9.0

Void: Void an issued invoice

The only correction there is. The original keeps every figure it was sent with — “we billed you this, it was wrong, here is the corrected one” is a story a customer can follow, and “we changed the invoice” is not.

With `supersede`, the void, the corrective draft and both directions of the link between them are one transaction. Void is irreversible, so a half-applied correction would leave a withdrawn invoice with no way forward; this call either applies whole or not at all.

_Requires permission: `invoices:issue`._

POST /api/org/{orgId}/invoices/{id}/void

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

type InvoicesSendParams added in v1.9.0

type InvoicesSendParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body *InvoiceSendRequest
}

InvoicesSendParams holds the parameters for `client.invoices.send`.

type InvoicesUpdateParams added in v1.9.0

type InvoicesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body InvoiceUpdate
}

InvoicesUpdateParams holds the parameters for `client.invoices.update`.

type InvoicesVoidParams added in v1.9.0

type InvoicesVoidParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body InvoiceVoidRequest
}

InvoicesVoidParams holds the parameters for `client.invoices.void`.

type InvokeActionRequest

type InvokeActionRequest struct {
	PluginID         string      `json:"pluginId"`
	AccountID        string      `json:"accountId"`
	ResourceTypeID   string      `json:"resourceTypeId"`
	ResourceID       ResourceID  `json:"resourceId"`
	ActionID         string      `json:"actionId"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

InvokeActionRequest is the `InvokeActionRequest` schema.

type JSONObject

type JSONObject = map[string]any

JSONObject: Free-form JSON object whose shape depends on the plugin.

Spec schema: `JsonObject`.

type JiraDeleteParams added in v1.6.0

type JiraDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

JiraDeleteParams holds the parameters for `client.jira.delete`.

Every field is optional; pass nil to take the defaults.

type JiraGetParams added in v1.6.0

type JiraGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

JiraGetParams holds the parameters for `client.jira.get`.

Every field is optional; pass nil to take the defaults.

type JiraGetResponse added in v1.6.0

type JiraGetResponse struct {
	Integration *JiraIntegration `json:"integration"`
}

JiraGetResponse is an object the spec declares inline.

type JiraIntegration added in v1.6.0

type JiraIntegration struct {
	SiteURL      string `json:"siteUrl"`
	AccountEmail string `json:"accountEmail"`
	// TokenHint: Redacted marker for the stored API token, e.g. `…a7f2`. The
	// token itself is never returned.
	TokenHint          string  `json:"tokenHint"`
	DefaultProjectKey  *string `json:"defaultProjectKey"`
	DefaultIssueTypeID *string `json:"defaultIssueTypeId"`
	UpdatedAt          string  `json:"updatedAt"`
}

JiraIntegration is the `JiraIntegration` schema.

The API may send null in its place.

type JiraIntegrationInput added in v1.6.0

type JiraIntegrationInput struct {
	// SiteURL: Jira Cloud site address. Must resolve to a .atlassian.net (or
	// legacy .jira.com) host; a bare hostname and a pasted board or issue URL
	// are both accepted and normalized.
	SiteURL string `json:"siteUrl"`
	// AccountEmail: Atlassian account email — the username half of the
	// basic-auth pair.
	AccountEmail string `json:"accountEmail"`
	// APIToken: API token from id.atlassian.com. Omit to keep the stored token;
	// required on first connect.
	APIToken           *string `json:"apiToken,omitempty"`
	DefaultProjectKey  *string `json:"defaultProjectKey,omitempty"`
	DefaultIssueTypeID *string `json:"defaultIssueTypeId,omitempty"`
}

JiraIntegrationInput is the `JiraIntegrationInput` schema.

type JiraIssueLink struct {
	ID              string         `json:"id"`
	SourceKind      JiraSourceKind `json:"sourceKind"`
	SourceID        string         `json:"sourceId"`
	IssueKey        string         `json:"issueKey"`
	IssueURL        string         `json:"issueUrl"`
	CreatedByUserID *string        `json:"createdByUserId"`
	CreatedAt       string         `json:"createdAt"`
}

JiraIssueLink is the `JiraIssueLink` schema.

type JiraIssueType added in v1.6.0

type JiraIssueType struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// Subtask: Always false — subtasks need a parent issue, so they are filtered
	// out.
	Subtask     bool    `json:"subtask"`
	Description *string `json:"description"`
}

JiraIssueType is the `JiraIssueType` schema.

type JiraIssuesParams added in v1.6.0

type JiraIssuesParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreateJiraIssueInput
}

JiraIssuesParams holds the parameters for `client.jira.issues`.

type JiraLinksParams added in v1.6.0

type JiraLinksParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	SourceKind *JiraSourceKind
	// SourceID: Repeat to narrow to specific findings. Omit to return every link
	// of the kind — this is the batch lookup a list view makes once instead of
	// one request per row.
	SourceID []string
}

JiraLinksParams holds the parameters for `client.jira.links`.

Every field is optional; pass nil to take the defaults.

type JiraNamespace added in v1.6.0

type JiraNamespace struct {

	// Projects: `client.jira.projects`.
	Projects *JiraProjectsNamespace
	// contains filtered or unexported fields
}

JiraNamespace is `client.jira`.

func (*JiraNamespace) Delete added in v1.6.0

func (n *JiraNamespace) Delete(ctx context.Context, params *JiraDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Disconnect Jira

Issue links already recorded are kept, so filed findings stay marked as filed.

_Requires permission: `jira:write`._

DELETE /api/org/{orgId}/jira

Raises on 404: Not found

func (*JiraNamespace) Get added in v1.6.0

func (n *JiraNamespace) Get(ctx context.Context, params *JiraGetParams, opts ...RequestOption) (*JiraGetResponse, error)

Get: Get the org's Jira connection

The stored API token is never returned; `tokenHint` stands in for it.

_Requires permission: `jira:read`._

GET /api/org/{orgId}/jira

func (*JiraNamespace) Issues added in v1.6.0

Issues: File a finding as a Jira issue

Creates the issue, then records the link between it and the finding. The link is what lets a list view show "already filed" instead of offering the button again.

_Requires permission: `jira:write`._

POST /api/org/{orgId}/jira/issues

Raises on 400: Bad request

Raises on 502: Jira refused to create the issue, or was unreachable

func (n *JiraNamespace) Links(ctx context.Context, params *JiraLinksParams, opts ...RequestOption) ([]JiraIssueLink, error)

Links: Look up filed issues for a set of findings

_Requires permission: `jira:read`._

GET /api/org/{orgId}/jira/links

Raises on 400: Bad request

func (*JiraNamespace) Update added in v1.6.0

func (n *JiraNamespace) Update(ctx context.Context, params JiraUpdateParams, opts ...RequestOption) (*JiraIntegration, error)

Update: Connect Jira, or update the connection

_Requires permission: `jira:write`._

PUT /api/org/{orgId}/jira

Raises on 400: Bad request

func (*JiraNamespace) Verify added in v1.6.0

func (n *JiraNamespace) Verify(ctx context.Context, params *JiraVerifyParams, opts ...RequestOption) (*JiraVerifyResult, error)

Verify: Check Jira credentials

Calls GET /rest/api/3/myself on the site, so a wrong email or a revoked token is reported on the settings form rather than on the first attempt to file an issue.

_Requires permission: `jira:write`._

POST /api/org/{orgId}/jira/verify

Raises on 400: Bad request

Raises on 502: Jira rejected the credentials or was unreachable

type JiraProject added in v1.6.0

type JiraProject struct {
	ID   string `json:"id"`
	Key  string `json:"key"`
	Name string `json:"name"`
}

JiraProject is the `JiraProject` schema.

type JiraProjectsIssueTypesParams added in v1.6.0

type JiraProjectsIssueTypesParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	Key   string
}

JiraProjectsIssueTypesParams holds the parameters for `client.jira.projects.issueTypes`.

type JiraProjectsListParams added in v1.6.0

type JiraProjectsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

JiraProjectsListParams holds the parameters for `client.jira.projects.list`.

Every field is optional; pass nil to take the defaults.

type JiraProjectsNamespace added in v1.6.0

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

JiraProjectsNamespace is `client.jira.projects`.

func (*JiraProjectsNamespace) IssueTypes added in v1.6.0

IssueTypes: List issue types valid in a project

Reads the project's own create metadata rather than the global issue-type list, so the picker cannot offer a type the project's scheme would reject. Subtasks are excluded.

_Requires permission: `jira:read`._

GET /api/org/{orgId}/jira/projects/{key}/issue-types

Raises on 400: Bad request

func (*JiraProjectsNamespace) List added in v1.6.0

List: List Jira projects

Backs the project picker, so nobody has to know a project key by hand.

_Requires permission: `jira:read`._

GET /api/org/{orgId}/jira/projects

Raises on 400: Bad request

type JiraSourceKind added in v1.6.0

type JiraSourceKind = string

JiraSourceKind: Which detector produced the finding the issue was filed from.

const (
	JiraSourceKindCostAnomaly    JiraSourceKind = "cost_anomaly"
	JiraSourceKindOrphan         JiraSourceKind = "orphan"
	JiraSourceKindOversized      JiraSourceKind = "oversized"
	JiraSourceKindPostureFinding JiraSourceKind = "posture_finding"
	JiraSourceKindExpiring       JiraSourceKind = "expiring"
	JiraSourceKindProbe          JiraSourceKind = "probe"
)

The values JiraSourceKind takes.

type JiraUpdateParams added in v1.6.0

type JiraUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body JiraIntegrationInput
}

JiraUpdateParams holds the parameters for `client.jira.update`.

type JiraVerifyInput added in v1.6.0

type JiraVerifyInput struct {
	SiteURL      *string `json:"siteUrl,omitempty"`
	AccountEmail *string `json:"accountEmail,omitempty"`
	APIToken     *string `json:"apiToken,omitempty"`
}

JiraVerifyInput: Supply all three to test credentials that have not been saved yet; send an empty object to re-test the stored ones.

type JiraVerifyParams added in v1.6.0

type JiraVerifyParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *JiraVerifyInput
}

JiraVerifyParams holds the parameters for `client.jira.verify`.

Every field is optional; pass nil to take the defaults.

type JiraVerifyResult added in v1.6.0

type JiraVerifyResult struct {
	OK           bool    `json:"ok"`
	AccountID    string  `json:"accountId"`
	DisplayName  string  `json:"displayName"`
	EmailAddress *string `json:"emailAddress"`
}

JiraVerifyResult is the `JiraVerifyResult` schema.

type KVCommandParams

type KVCommandParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body KVCommandRequest
}

KVCommandParams holds the parameters for `client.kv.command`.

type KVCommandRequest

type KVCommandRequest struct {
	AccountID        string      `json:"accountId"`
	Command          string      `json:"command"`
	Args             []any       `json:"args"`
	PluginID         *string     `json:"pluginId,omitempty"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

KVCommandRequest is the `KvCommandRequest` schema.

Spec schema: `KvCommandRequest`.

type KVCommandResponse

type KVCommandResponse struct {
	Result any `json:"result,omitempty"`
}

KVCommandResponse is the `KvCommandResponse` schema.

Spec schema: `KvCommandResponse`.

type KVNamespace

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

KVNamespace is `client.kv`.

func (*KVNamespace) Command

func (n *KVNamespace) Command(ctx context.Context, params KVCommandParams, opts ...RequestOption) (*KVCommandResponse, error)

Command: Run a Redis-style KV command

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/kv/command

Raises on 400: Bad request

Raises on 404: Not found

type LeaseConflict added in v0.33.0

type LeaseConflict struct {
	Error string `json:"error"`
}

LeaseConflict is the `LeaseConflict` schema.

type LeasesCancelParams added in v0.33.0

type LeasesCancelParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	LeaseID string
}

LeasesCancelParams holds the parameters for `client.leases.cancel`.

type LeasesCreateParams added in v0.33.0

type LeasesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *ResourceLeaseCreate
}

LeasesCreateParams holds the parameters for `client.leases.create`.

Every field is optional; pass nil to take the defaults.

type LeasesDeleteParams added in v0.33.0

type LeasesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	LeaseID string
}

LeasesDeleteParams holds the parameters for `client.leases.delete`.

type LeasesGetParams added in v0.33.0

type LeasesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

LeasesGetParams holds the parameters for `client.leases.get`.

Every field is optional; pass nil to take the defaults.

type LeasesNamespace added in v0.33.0

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

LeasesNamespace is `client.leases`.

func (*LeasesNamespace) Cancel added in v0.33.0

Cancel: Cancel a lease

Stop the countdown — the resource stays, the lease goes `canceled` and leaves the expiry radar. Audit-logged.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/leases/{leaseId}/cancel

Raises on 400: Bad request

Raises on 404: Not found

func (*LeasesNamespace) Create added in v0.33.0

func (n *LeasesNamespace) Create(ctx context.Context, params *LeasesCreateParams, opts ...RequestOption) (*ResourceLease, error)

Create: Create a resource lease

Attach an expiry to a resource — 'give me a test cluster for 3 days'. One lease per resource (an active lease conflicts; a terminal one is replaced). `autoDelete: true` opts into deletion at expiry — the poller announces it twice first, defers during change freezes, and requires the caller to hold `resources:delete`. Audit-logged.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/leases

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: The resource already has an active lease

func (*LeasesNamespace) Delete added in v0.33.0

func (n *LeasesNamespace) Delete(ctx context.Context, params LeasesDeleteParams, opts ...RequestOption) error

Delete: Delete a lease row

Remove the lease record entirely (including terminal rows). The resource is not touched. Audit-logged.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/leases/{leaseId}

Raises on 404: Not found

func (*LeasesNamespace) Get added in v0.33.0

Get: List resource leases

Every lease in the organization, soonest deadline first. Active leases also appear on the expiry radar (`GET /expiring`) as kind `lease` items, so the owner is nagged through the existing expiry alerts.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/leases

func (*LeasesNamespace) Resource added in v0.33.0

Resource: Get one resource's lease

The (unique) lease on a resource, whatever its status, or null.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/leases/resource

Raises on 400: Bad request

func (*LeasesNamespace) Update added in v0.33.0

Update: Update a lease

Edit the deadline, the auto-delete opt-in and/or the note of an active lease. Changing the deadline or the auto-delete flag re-arms the two-announcement schedule. Audit-logged.

_Requires permission: `resources:write`._

PUT /api/org/{orgId}/leases/{leaseId}

Raises on 400: Bad request

Raises on 404: Not found

type LeasesResourceParams added in v0.33.0

type LeasesResourceParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ResourceID string
}

LeasesResourceParams holds the parameters for `client.leases.resource`.

type LeasesUpdateParams added in v0.33.0

type LeasesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	LeaseID string
	// Body: the JSON request body.
	Body *ResourceLeaseUpdate
}

LeasesUpdateParams holds the parameters for `client.leases.update`.

type LinearDeleteParams added in v1.6.0

type LinearDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

LinearDeleteParams holds the parameters for `client.linear.delete`.

Every field is optional; pass nil to take the defaults.

type LinearGetParams added in v1.6.0

type LinearGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

LinearGetParams holds the parameters for `client.linear.get`.

Every field is optional; pass nil to take the defaults.

type LinearGetResponse added in v1.6.0

type LinearGetResponse struct {
	Integration *LinearIntegration `json:"integration"`
}

LinearGetResponse is an object the spec declares inline.

type LinearIntegration added in v1.6.0

type LinearIntegration struct {
	// KeyHint: Redacted marker for the stored personal API key, e.g. `…a7f2`.
	// The key itself is never returned.
	KeyHint string `json:"keyHint"`
	// DefaultTeamID: Team the file-issue window preselects. A Linear team id,
	// not a team key.
	DefaultTeamID *string `json:"defaultTeamId"`
	UpdatedAt     string  `json:"updatedAt"`
}

LinearIntegration is the `LinearIntegration` schema.

The API may send null in its place.

type LinearIntegrationInput added in v1.6.0

type LinearIntegrationInput struct {
	// APIKey: Personal API key from Linear → Settings → Security & access. Omit
	// to keep the stored key; required on first connect.
	APIKey        *string `json:"apiKey,omitempty"`
	DefaultTeamID *string `json:"defaultTeamId,omitempty"`
}

LinearIntegrationInput is the `LinearIntegrationInput` schema.

type LinearIssueLink struct {
	ID              string           `json:"id"`
	SourceKind      LinearSourceKind `json:"sourceKind"`
	SourceID        string           `json:"sourceId"`
	IssueIdentifier string           `json:"issueIdentifier"`
	IssueURL        string           `json:"issueUrl"`
	CreatedByUserID *string          `json:"createdByUserId"`
	CreatedAt       string           `json:"createdAt"`
}

LinearIssueLink is the `LinearIssueLink` schema.

type LinearIssuesParams added in v1.6.0

type LinearIssuesParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreateLinearIssueInput
}

LinearIssuesParams holds the parameters for `client.linear.issues`.

type LinearLinksParams added in v1.6.0

type LinearLinksParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	SourceKind *LinearSourceKind
	// SourceID: Repeat to narrow to specific findings. Omit to return every link
	// of the kind — this is the batch lookup a list view makes once instead of
	// one request per row.
	SourceID []string
}

LinearLinksParams holds the parameters for `client.linear.links`.

Every field is optional; pass nil to take the defaults.

type LinearNamespace added in v1.6.0

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

LinearNamespace is `client.linear`.

func (*LinearNamespace) Delete added in v1.6.0

func (n *LinearNamespace) Delete(ctx context.Context, params *LinearDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Disconnect Linear

Issue links already recorded are kept, so filed findings stay marked as filed.

_Requires permission: `linear:write`._

DELETE /api/org/{orgId}/linear

Raises on 404: Not found

func (*LinearNamespace) Get added in v1.6.0

Get: Get the org's Linear connection

The stored API key is never returned; `keyHint` stands in for it.

_Requires permission: `linear:read`._

GET /api/org/{orgId}/linear

func (*LinearNamespace) Issues added in v1.6.0

Issues: File a finding as a Linear issue

Creates the issue via the issueCreate mutation, then records the link between it and the finding. The link is what lets a list view show "already filed" instead of offering the button again.

_Requires permission: `linear:write`._

POST /api/org/{orgId}/linear/issues

Raises on 400: Bad request

Raises on 502: Linear refused to create the issue, or was unreachable

Links: Look up filed issues for a set of findings

_Requires permission: `linear:read`._

GET /api/org/{orgId}/linear/links

Raises on 400: Bad request

func (*LinearNamespace) Teams added in v1.6.0

func (n *LinearNamespace) Teams(ctx context.Context, params *LinearTeamsParams, opts ...RequestOption) ([]LinearTeam, error)

Teams: List Linear teams

Backs the team picker, so nobody has to know a team id by hand — issueCreate requires one, and every issue belongs to exactly one team.

_Requires permission: `linear:read`._

GET /api/org/{orgId}/linear/teams

Raises on 400: Bad request

func (*LinearNamespace) Update added in v1.6.0

Update: Connect Linear, or update the connection

_Requires permission: `linear:write`._

PUT /api/org/{orgId}/linear

Raises on 400: Bad request

func (*LinearNamespace) Verify added in v1.6.0

Verify: Check Linear credentials

Runs the `viewer` query against the Linear GraphQL API, so a mistyped or revoked key is reported on the settings form rather than on the first attempt to file an issue.

_Requires permission: `linear:write`._

POST /api/org/{orgId}/linear/verify

Raises on 400: Bad request

Raises on 502: Linear rejected the key or was unreachable

type LinearSourceKind added in v1.6.0

type LinearSourceKind = string

LinearSourceKind: Which detector produced the finding the issue was filed from.

const (
	LinearSourceKindCostAnomaly    LinearSourceKind = "cost_anomaly"
	LinearSourceKindOrphan         LinearSourceKind = "orphan"
	LinearSourceKindOversized      LinearSourceKind = "oversized"
	LinearSourceKindPostureFinding LinearSourceKind = "posture_finding"
	LinearSourceKindExpiring       LinearSourceKind = "expiring"
	LinearSourceKindProbe          LinearSourceKind = "probe"
)

The values LinearSourceKind takes.

type LinearTeam added in v1.6.0

type LinearTeam struct {
	// ID: Team id (UUID) — what issueCreate wants.
	ID string `json:"id"`
	// Key: Short prefix issue identifiers are built from.
	Key  string `json:"key"`
	Name string `json:"name"`
}

LinearTeam is the `LinearTeam` schema.

type LinearTeamsParams added in v1.6.0

type LinearTeamsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

LinearTeamsParams holds the parameters for `client.linear.teams`.

Every field is optional; pass nil to take the defaults.

type LinearUpdateParams added in v1.6.0

type LinearUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body LinearIntegrationInput
}

LinearUpdateParams holds the parameters for `client.linear.update`.

type LinearVerifyInput added in v1.6.0

type LinearVerifyInput struct {
	APIKey *string `json:"apiKey,omitempty"`
}

LinearVerifyInput: Supply a key to test one that has not been saved yet; send an empty object to re-test the stored one.

type LinearVerifyParams added in v1.6.0

type LinearVerifyParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *LinearVerifyInput
}

LinearVerifyParams holds the parameters for `client.linear.verify`.

Every field is optional; pass nil to take the defaults.

type LinearVerifyResult added in v1.6.0

type LinearVerifyResult struct {
	OK    bool    `json:"ok"`
	ID    string  `json:"id"`
	Name  string  `json:"name"`
	Email *string `json:"email"`
}

LinearVerifyResult: The Linear user behind the API key, from the `viewer` query.

type LinuxAppHostCheck added in v1.31.0

type LinuxAppHostCheck struct {
	Preflight LinuxAppHostPreflight `json:"preflight"`
	Plan      *LinuxAppInstallPlan  `json:"plan"`
}

LinuxAppHostCheck is the `LinuxAppHostCheck` schema.

type LinuxAppHostPreflight added in v1.31.0

type LinuxAppHostPreflight struct {
	Arch   string `json:"arch"`
	OsID   string `json:"osId"`
	OsName string `json:"osName"`
	// PackageManager: One of "apt-get", "dnf", "yum", "apk", "pacman", "zypper".
	PackageManager *string `json:"packageManager"`
	// Privilege: One of "root", "sudo", "sudo-password", "none".
	Privilege    string                `json:"privilege"`
	Requirements []LinuxAppRequirement `json:"requirements"`
	// Staging: A writable, exec-capable directory was found to stage the app
	// server in. False means every candidate is missing, unwritable, or mounted
	// noexec — which no package fixes.
	Staging  bool  `json:"staging"`
	AppCount int64 `json:"appCount"`
	Ready    bool  `json:"ready"`
}

LinuxAppHostPreflight is the `LinuxAppHostPreflight` schema.

type LinuxAppHostTarget added in v1.31.0

type LinuxAppHostTarget struct {
	AccountID  string `json:"accountId"`
	ResourceID string `json:"resourceId"`
	SSHKeyID   string `json:"sshKeyId"`
	Host       string `json:"host"`
	Username   string `json:"username"`
	Port       *int64 `json:"port,omitempty"`
}

LinuxAppHostTarget is the `LinuxAppHostTarget` schema.

type LinuxAppInstallOutcome added in v1.31.0

type LinuxAppInstallOutcome struct {
	Log       []string              `json:"log"`
	Failed    []string              `json:"failed"`
	Preflight LinuxAppHostPreflight `json:"preflight"`
}

LinuxAppInstallOutcome is the `LinuxAppInstallOutcome` schema.

type LinuxAppInstallPlan added in v1.31.0

type LinuxAppInstallPlan struct {
	// PackageManager: One of "apt-get", "dnf", "yum", "apk", "pacman", "zypper".
	PackageManager string `json:"packageManager"`
	// Privilege: One of "root", "sudo", "sudo-password", "none".
	Privilege    string                  `json:"privilege"`
	Requirements []LinuxAppRequirementID `json:"requirements"`
	Packages     []string                `json:"packages"`
	// Commands: Exactly what would run on the host, privilege prefix included.
	Commands      []string `json:"commands"`
	CanInstall    bool     `json:"canInstall"`
	BlockedReason *string  `json:"blockedReason,omitempty"`
}

LinuxAppInstallPlan is the `LinuxAppInstallPlan` schema.

The API may send null in its place.

type LinuxAppRequirement added in v1.31.0

type LinuxAppRequirement struct {
	ID LinuxAppRequirementID `json:"id"`
	// Severity: One of "required", "recommended".
	Severity string `json:"severity"`
	Title    string `json:"title"`
	Summary  string `json:"summary"`
	OK       bool   `json:"ok"`
}

LinuxAppRequirement is the `LinuxAppRequirement` schema.

type LinuxAppRequirementID added in v1.31.0

type LinuxAppRequirementID = string

LinuxAppRequirementID: gzip unpacks the uploaded app server; xkb is the keyboard layout data xkbcommon compiles a keymap from; dbus is the session bus GTK applications wait for; fonts, mesa and icons decide what an application then looks like.

Spec schema: `LinuxAppRequirementId`.

const (
	LinuxAppRequirementIDGzip  LinuxAppRequirementID = "gzip"
	LinuxAppRequirementIDXkb   LinuxAppRequirementID = "xkb"
	LinuxAppRequirementIDDbus  LinuxAppRequirementID = "dbus"
	LinuxAppRequirementIDFonts LinuxAppRequirementID = "fonts"
	LinuxAppRequirementIDMesa  LinuxAppRequirementID = "mesa"
	LinuxAppRequirementIDIcons LinuxAppRequirementID = "icons"
)

The values LinuxAppRequirementID takes.

type LinuxAppSetupEvent added in v1.31.0

type LinuxAppSetupEvent struct {
	Line    *string                 `json:"line,omitempty"`
	Outcome *LinuxAppInstallOutcome `json:"outcome,omitempty"`
	Error   *string                 `json:"error,omitempty"`
}

LinuxAppSetupEvent is the `LinuxAppSetupEvent` schema.

type LinuxAppSetupRequest added in v1.31.0

type LinuxAppSetupRequest struct {
	AccountID    string                  `json:"accountId"`
	ResourceID   string                  `json:"resourceId"`
	SSHKeyID     string                  `json:"sshKeyId"`
	Host         string                  `json:"host"`
	Username     string                  `json:"username"`
	Port         *int64                  `json:"port,omitempty"`
	Requirements []LinuxAppRequirementID `json:"requirements,omitempty"`
}

LinuxAppSetupRequest is the `LinuxAppSetupRequest` schema.

type LiteralAssociationRequest

type LiteralAssociationRequest struct {
	ResourceID     ResourceID `json:"resourceId"`
	FieldKey       string     `json:"fieldKey"`
	PlaintextValue string     `json:"plaintextValue"`
}

LiteralAssociationRequest is the `LiteralAssociationRequest` schema.

type LogCapableResource added in v0.30.0

type LogCapableResource struct {
	ResourceID     string   `json:"resourceId"`
	AccountID      string   `json:"accountId"`
	AccountName    string   `json:"accountName"`
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	DisplayName    string   `json:"displayName"`
	// ParentResourceID: Set for sidecar streams: the stored parent resource the
	// peer client is built through.
	ParentResourceID  *string `json:"parentResourceId,omitempty"`
	ParentDisplayName *string `json:"parentDisplayName,omitempty"`
}

LogCapableResource is the `LogCapableResource` schema.

type LogCapableResourceList added in v0.30.0

type LogCapableResourceList struct {
	Resources []LogCapableResource `json:"resources"`
}

LogCapableResourceList is the `LogCapableResourceList` schema.

type LogStreamSelector added in v0.30.0

type LogStreamSelector struct {
	// ResourceID: Infrawrench resource id of the stream to tail — or, for a
	// sidecar stream, the peer plugin's own resource id (not a stored row).
	ResourceID     string   `json:"resourceId"`
	AccountID      string   `json:"accountId"`
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	// ParentResourceID: Set for sidecar streams (e.g. a pod inside a managed
	// cluster): the stored parent resource whose outputs mint the peer plugin's
	// credentials. The logs endpoint routes through the peer client when
	// present.
	ParentResourceID *string `json:"parentResourceId,omitempty"`
	// Container: Container to fetch when the resource has more than one; omit
	// for the default.
	Container *string `json:"container,omitempty"`
}

LogStreamSelector is the `LogStreamSelector` schema.

type LogWorkspaceQuery added in v0.30.0

type LogWorkspaceQuery struct {
	ID        string              `json:"id"`
	Name      string              `json:"name"`
	Resources []LogStreamSelector `json:"resources"`
	// Search: The search expression. Empty matches every line; `/pattern/`
	// (optionally `/pattern/i`) is a regular expression; otherwise
	// whitespace-separated terms that must ALL appear in a line
	// (case-insensitive), with `"quoted phrases"` and `-term` negation.
	Search string `json:"search"`
	// AlertEnabled: When true the poller periodically evaluates the query and
	// alerts on match.
	AlertEnabled bool `json:"alertEnabled"`
	// LastEvalAt: Last time the alert pass evaluated this query; null until it
	// has run.
	LastEvalAt *string `json:"lastEvalAt"`
	// LastMatchAt: Last evaluation that found at least one matching line.
	LastMatchAt *string `json:"lastMatchAt"`
	// LastAlertedAt: Last dispatched notification — the cooldown anchor.
	LastAlertedAt *string `json:"lastAlertedAt"`
	// LastEvalError: Failure detail from the last evaluation.
	LastEvalError *string `json:"lastEvalError"`
	// LastMatchSample: Truncated sample of the most recent matching line.
	LastMatchSample *string `json:"lastMatchSample"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
}

LogWorkspaceQuery is the `LogWorkspaceQuery` schema.

type LogWorkspaceQueryConflict added in v0.30.0

type LogWorkspaceQueryConflict struct {
	Error string `json:"error"`
}

LogWorkspaceQueryConflict is the `LogWorkspaceQueryConflict` schema.

type LogWorkspaceQueryCreate added in v0.30.0

type LogWorkspaceQueryCreate struct {
	Name      string              `json:"name"`
	Resources []LogStreamSelector `json:"resources"`
	// Search: The search expression. Empty matches every line; `/pattern/`
	// (optionally `/pattern/i`) is a regular expression; otherwise
	// whitespace-separated terms that must ALL appear in a line
	// (case-insensitive), with `"quoted phrases"` and `-term` negation.
	Search       string `json:"search"`
	AlertEnabled *bool  `json:"alertEnabled,omitempty"`
}

LogWorkspaceQueryCreate is the `LogWorkspaceQueryCreate` schema.

type LogWorkspaceQueryList added in v0.30.0

type LogWorkspaceQueryList struct {
	Queries []LogWorkspaceQuery `json:"queries"`
}

LogWorkspaceQueryList is the `LogWorkspaceQueryList` schema.

type LogWorkspaceQueryUpdate added in v0.30.0

type LogWorkspaceQueryUpdate struct {
	Name      *string             `json:"name,omitempty"`
	Resources []LogStreamSelector `json:"resources,omitempty"`
	// Search: The search expression. Empty matches every line; `/pattern/`
	// (optionally `/pattern/i`) is a regular expression; otherwise
	// whitespace-separated terms that must ALL appear in a line
	// (case-insensitive), with `"quoted phrases"` and `-term` negation.
	Search       *string `json:"search,omitempty"`
	AlertEnabled *bool   `json:"alertEnabled,omitempty"`
}

LogWorkspaceQueryUpdate is the `LogWorkspaceQueryUpdate` schema.

type LogWorkspaceQueryUpdateConflict added in v0.30.0

type LogWorkspaceQueryUpdateConflict struct {
	Error string `json:"error"`
}

LogWorkspaceQueryUpdateConflict is the `LogWorkspaceQueryUpdateConflict` schema.

type LogWorkspacesCreateParams added in v0.30.0

type LogWorkspacesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body LogWorkspaceQueryCreate
}

LogWorkspacesCreateParams holds the parameters for `client.logWorkspaces.create`.

type LogWorkspacesDeleteParams added in v0.30.0

type LogWorkspacesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	QueryID string
}

LogWorkspacesDeleteParams holds the parameters for `client.logWorkspaces.delete`.

type LogWorkspacesGetParams added in v0.30.0

type LogWorkspacesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

LogWorkspacesGetParams holds the parameters for `client.logWorkspaces.get`.

Every field is optional; pass nil to take the defaults.

type LogWorkspacesNamespace added in v0.30.0

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

LogWorkspacesNamespace is `client.logWorkspaces`.

func (*LogWorkspacesNamespace) Create added in v0.30.0

Create: Save a log workspace query

Save a named multi-resource tail: up to 8 log streams plus a search expression, so the workspace can be reopened. With `alertEnabled` the poller evaluates the query every few minutes over a bounded tail window and notifies (push/Slack/Teams, `logMatchAlerts` trigger) when a line matches, with a cooldown between alerts. Alerting requires a non-empty search expression. Audit-logged.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/log-workspaces

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: A saved query with this name already exists

func (*LogWorkspacesNamespace) Delete added in v0.30.0

Delete: Delete a saved log query

Remove the saved query and stop any alerting it carried. Audit-logged.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/log-workspaces/{queryId}

Raises on 404: Not found

func (*LogWorkspacesNamespace) Get added in v0.30.0

Get: List saved log queries

Every saved log-workspace query in the organization: its name, the set of log streams it tails, the search expression, the alert flag and the alert pass's last evaluation state. Log text itself is fetched per resource via `POST /api/org/{orgId}/resources/{pluginId}/{typeId}/logs`.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/log-workspaces

func (*LogWorkspacesNamespace) Resources added in v0.30.0

Resources: List log-capable resources

Synced resources whose rendered detail declares the logs capability — the candidates a log workspace can tail — plus sidecar streams reached through a peer integration (pods and workloads inside a managed cluster, listed live from the provider and marked with `parentResourceId`). Discovered from the plugin contract (never a hardcoded provider list), capped at 500 results.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/log-workspaces/resources

func (*LogWorkspacesNamespace) Update added in v0.30.0

Update: Update a saved log query

Edit the name, resource set, search expression and/or the alert toggle. Changing the search or the resources resets the alert pass's evaluation state; turning the alert on makes the query due for evaluation immediately. Audit-logged.

_Requires permission: `resources:write`._

PUT /api/org/{orgId}/log-workspaces/{queryId}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: A saved query with this name already exists

type LogWorkspacesResourcesParams added in v0.30.0

type LogWorkspacesResourcesParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

LogWorkspacesResourcesParams holds the parameters for `client.logWorkspaces.resources`.

Every field is optional; pass nil to take the defaults.

type LogWorkspacesUpdateParams added in v0.30.0

type LogWorkspacesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	QueryID string
	// Body: the JSON request body.
	Body LogWorkspaceQueryUpdate
}

LogWorkspacesUpdateParams holds the parameters for `client.logWorkspaces.update`.

type LogsRequest

type LogsRequest struct {
	AccountID        string      `json:"accountId"`
	ResourceID       ResourceID  `json:"resourceId"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
	TailLines        *int64      `json:"tailLines,omitempty"`
	Container        *string     `json:"container,omitempty"`
	Previous         *bool       `json:"previous,omitempty"`
}

LogsRequest is the `LogsRequest` schema.

type LogsResponse

type LogsResponse struct {
	// Text: Raw log text; each entry keeps its trailing newline.
	Text string `json:"text"`
	// Containers: Container names available for this resource — drives the
	// container picker.
	Containers []string `json:"containers"`
	// ActiveContainer: Container `text` was read from.
	ActiveContainer string `json:"activeContainer"`
}

LogsResponse is the `LogsResponse` schema.

type ManagedAccount added in v1.9.0

type ManagedAccount struct {
	ID              string  `json:"id"`
	Name            string  `json:"name"`
	ContactName     *string `json:"contactName"`
	ContactEmail    *string `json:"contactEmail"`
	BillingAddress  *string `json:"billingAddress"`
	BillingCurrency string  `json:"billingCurrency"`
	// CostBasis: One of "cash", "amortized".
	CostBasis         string   `json:"costBasis"`
	ApplyBillingRules bool     `json:"applyBillingRules"`
	Notes             *string  `json:"notes"`
	CostCentreIDs     []string `json:"costCentreIds"`
	AccountIDs        []string `json:"accountIds"`
	InvoiceCount      int64    `json:"invoiceCount"`
	CreatedByUserID   *string  `json:"createdByUserId"`
	CreatedAt         string   `json:"createdAt"`
	UpdatedAt         string   `json:"updatedAt"`
}

ManagedAccount: A customer a managed service provider bills. A cost centre or cloud account belongs to at most one managed account — billing the same money to two customers is refused at write time with a 409 naming the other customer.

type ManagedAccountInput added in v1.9.0

type ManagedAccountInput struct {
	Name           string  `json:"name"`
	ContactName    *string `json:"contactName,omitempty"`
	ContactEmail   *string `json:"contactEmail,omitempty"`
	BillingAddress *string `json:"billingAddress,omitempty"`
	// BillingCurrency: ISO 4217 code the customer is invoiced in. Spend
	// collected in another currency is converted through the organisation's own
	// stated exchange rates, and the rate used is frozen onto every invoice — so
	// restating a rate later cannot restate history.
	BillingCurrency string `json:"billingCurrency"`
	// CostBasis: Defaults to `amortized`. Charging a customer the whole cash
	// value of a three-year commitment in the month it was signed is not a bill
	// anyone can budget against.
	//
	// One of "cash", "amortized".
	CostBasis *string `json:"costBasis,omitempty"`
	// ApplyBillingRules: Defaults to true. False is a pass-through contract: the
	// customer is billed exactly what the providers charged, with no markup,
	// discount or fixed fee applied.
	ApplyBillingRules *bool   `json:"applyBillingRules,omitempty"`
	Notes             *string `json:"notes,omitempty"`
	// CostCentreIDs: Cost centres whose spend belongs to this customer.
	// **Subtrees are included** — naming a parent bills every descendant, and
	// naming both a parent and its child bills the child once, not twice.
	//
	// This is deliberately a list of existing cost centres rather than a rule of
	// its own. Which spend lands in which centre is already decided by the
	// organisation's allocation rules, and a second vocabulary over the same
	// data would eventually disagree with the first — at which point an invoice
	// would stop matching the showback report the customer was shown.
	CostCentreIDs []string `json:"costCentreIds,omitempty"`
	// AccountIDs: Cloud accounts whose spend belongs to this customer. Evaluated
	// **after** every allocation rule, so an account in scope claims only the
	// spend no cost centre already claimed. Every cost row therefore resolves
	// exactly once: nothing is billed twice and nothing goes missing.
	AccountIDs []string `json:"accountIds,omitempty"`
}

ManagedAccountInput is the `ManagedAccountInput` schema.

type ManagedAccountsCreateParams added in v1.9.0

type ManagedAccountsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ManagedAccountInput
}

ManagedAccountsCreateParams holds the parameters for `client.managedAccounts.create`.

type ManagedAccountsDeleteParams added in v1.9.0

type ManagedAccountsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

ManagedAccountsDeleteParams holds the parameters for `client.managedAccounts.delete`.

type ManagedAccountsGetParams added in v1.9.0

type ManagedAccountsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

ManagedAccountsGetParams holds the parameters for `client.managedAccounts.get`.

type ManagedAccountsListParams added in v1.9.0

type ManagedAccountsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

ManagedAccountsListParams holds the parameters for `client.managedAccounts.list`.

Every field is optional; pass nil to take the defaults.

type ManagedAccountsNamespace added in v1.9.0

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

ManagedAccountsNamespace is `client.managedAccounts`.

func (*ManagedAccountsNamespace) Create added in v1.9.0

Create: Create a managed account

Refused with 409 when a cost centre or account named here is already billed to another customer. The error names the other customer, because “it conflicts” without saying with whom sends the caller hunting.

_Requires permission: `invoices:write`._

POST /api/org/{orgId}/managed-accounts

Raises on 400: Bad request

Raises on 409: Conflict

func (*ManagedAccountsNamespace) Delete added in v1.9.0

Delete: Retire a managed account

A soft delete: an issued invoice names its customer, and an invoice whose customer stopped resolving is exactly the unreconcilable document this feature exists to prevent. Draft invoices are removed with it — a draft was never issued.

_Requires permission: `invoices:write`._

DELETE /api/org/{orgId}/managed-accounts/{id}

Raises on 404: Not found

func (*ManagedAccountsNamespace) Get added in v1.9.0

Get: Get a managed account

_Requires permission: `invoices:read`._

GET /api/org/{orgId}/managed-accounts/{id}

Raises on 404: Not found

func (*ManagedAccountsNamespace) List added in v1.9.0

List: List managed accounts

The customers a managed service provider bills. A managed account references existing cost centres rather than defining its own matching rules, so the spend on an invoice is the same spend the showback report attributes to those centres.

_Requires permission: `invoices:read`._

GET /api/org/{orgId}/managed-accounts

func (*ManagedAccountsNamespace) Update added in v1.9.0

Update: Update a managed account

A full replace. Editing the scope changes what **future** drafts are drawn over and nothing else: every approved invoice holds its own copy of the scope, so moving a cost centre between customers cannot re-bill a period that has already been invoiced.

_Requires permission: `invoices:write`._

PUT /api/org/{orgId}/managed-accounts/{id}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

type ManagedAccountsUpdateParams added in v1.9.0

type ManagedAccountsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body ManagedAccountInput
}

ManagedAccountsUpdateParams holds the parameters for `client.managedAccounts.update`.

type Manifest

type Manifest struct {
	Manifest string `json:"manifest"`
}

Manifest is the `Manifest` schema.

type MeResponse

type MeResponse struct {
	UserID      string       `json:"userId"`
	Email       string       `json:"email"`
	Role        *RoleSummary `json:"role"`
	Permissions []Permission `json:"permissions"`
}

MeResponse is the `MeResponse` schema.

type MetricAlertEvent added in v0.30.0

type MetricAlertEvent struct {
	ID           string `json:"id"`
	RuleID       string `json:"ruleId"`
	RuleName     string `json:"ruleName"`
	ResourceID   string `json:"resourceId"`
	ResourceName string `json:"resourceName"`
	// Status: One of "firing", "resolved".
	Status string `json:"status"`
	// ObservedValue: Worst sample observed in the breaching window, in the
	// metric's unit.
	ObservedValue float64 `json:"observedValue"`
	FiredAt       string  `json:"firedAt"`
	ResolvedAt    *string `json:"resolvedAt"`
}

MetricAlertEvent is the `MetricAlertEvent` schema.

type MetricAlertRule added in v0.30.0

type MetricAlertRule struct {
	Name string `json:"name"`
	// PluginID: Selector: plugin the resource must belong to. Null matches any
	// plugin.
	PluginID *string `json:"pluginId"`
	// ResourceTypeID: Selector: resource type within the plugin. Null matches
	// any type.
	ResourceTypeID *string `json:"resourceTypeId"`
	// TagKey: Selector: tag key the resource must carry (matched
	// case-insensitively). Null applies no tag filter. Resources are always
	// selected by this query, never by id, so rules cover resources created
	// later.
	TagKey *string `json:"tagKey"`
	// TagValue: Selector: exact value tagKey must have. Null matches any value.
	TagValue *string `json:"tagValue"`
	// MetricKey: The metric series label as the resource's charts report it (see
	// /metric-alerts/metric-keys).
	MetricKey string `json:"metricKey"`
	// Comparator: One of ">", ">=", "<", "<=".
	Comparator string  `json:"comparator"`
	Threshold  float64 `json:"threshold"`
	// ForMinutes: Trailing window (minutes) the condition must hold for before
	// firing.
	ForMinutes int64 `json:"forMinutes"`
	// CooldownMinutes: Least minutes between notified firings for one (rule,
	// resource).
	CooldownMinutes int64   `json:"cooldownMinutes"`
	Enabled         bool    `json:"enabled"`
	ID              string  `json:"id"`
	LastEvalAt      *string `json:"lastEvalAt"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
}

MetricAlertRule is the `MetricAlertRule` schema.

type MetricAlertRuleInput added in v0.30.0

type MetricAlertRuleInput struct {
	Name string `json:"name"`
	// PluginID: Selector: plugin the resource must belong to. Null matches any
	// plugin.
	PluginID *string `json:"pluginId"`
	// ResourceTypeID: Selector: resource type within the plugin. Null matches
	// any type.
	ResourceTypeID *string `json:"resourceTypeId"`
	// TagKey: Selector: tag key the resource must carry (matched
	// case-insensitively). Null applies no tag filter. Resources are always
	// selected by this query, never by id, so rules cover resources created
	// later.
	TagKey *string `json:"tagKey"`
	// TagValue: Selector: exact value tagKey must have. Null matches any value.
	TagValue *string `json:"tagValue"`
	// MetricKey: The metric series label as the resource's charts report it (see
	// /metric-alerts/metric-keys).
	MetricKey string `json:"metricKey"`
	// Comparator: One of ">", ">=", "<", "<=".
	Comparator string  `json:"comparator"`
	Threshold  float64 `json:"threshold"`
	// ForMinutes: Trailing window (minutes) the condition must hold for before
	// firing.
	ForMinutes int64 `json:"forMinutes"`
	// CooldownMinutes: Least minutes between notified firings for one (rule,
	// resource).
	CooldownMinutes int64 `json:"cooldownMinutes"`
	Enabled         bool  `json:"enabled"`
}

MetricAlertRuleInput is the `MetricAlertRuleInput` schema.

type MetricAlertRuleWithStatus added in v0.30.0

type MetricAlertRuleWithStatus struct {
	Name string `json:"name"`
	// PluginID: Selector: plugin the resource must belong to. Null matches any
	// plugin.
	PluginID *string `json:"pluginId"`
	// ResourceTypeID: Selector: resource type within the plugin. Null matches
	// any type.
	ResourceTypeID *string `json:"resourceTypeId"`
	// TagKey: Selector: tag key the resource must carry (matched
	// case-insensitively). Null applies no tag filter. Resources are always
	// selected by this query, never by id, so rules cover resources created
	// later.
	TagKey *string `json:"tagKey"`
	// TagValue: Selector: exact value tagKey must have. Null matches any value.
	TagValue *string `json:"tagValue"`
	// MetricKey: The metric series label as the resource's charts report it (see
	// /metric-alerts/metric-keys).
	MetricKey string `json:"metricKey"`
	// Comparator: One of ">", ">=", "<", "<=".
	Comparator string  `json:"comparator"`
	Threshold  float64 `json:"threshold"`
	// ForMinutes: Trailing window (minutes) the condition must hold for before
	// firing.
	ForMinutes int64 `json:"forMinutes"`
	// CooldownMinutes: Least minutes between notified firings for one (rule,
	// resource).
	CooldownMinutes int64   `json:"cooldownMinutes"`
	Enabled         bool    `json:"enabled"`
	ID              string  `json:"id"`
	LastEvalAt      *string `json:"lastEvalAt"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
	// FiringCount: Resources currently in breach of this rule.
	FiringCount int64 `json:"firingCount"`
	// MatchingResourceCount: Resources the selector matches right now.
	MatchingResourceCount int64 `json:"matchingResourceCount"`
}

MetricAlertRuleWithStatus is the `MetricAlertRuleWithStatus` schema.

type MetricAlertSelectorOptions added in v0.30.0

type MetricAlertSelectorOptions struct {
	Plugins []MetricAlertSelectorOptionsPlugins `json:"plugins"`
	TagKeys []string                            `json:"tagKeys"`
}

MetricAlertSelectorOptions is the `MetricAlertSelectorOptions` schema.

type MetricAlertSelectorOptionsPlugins added in v0.30.0

type MetricAlertSelectorOptionsPlugins struct {
	PluginID        string   `json:"pluginId"`
	ResourceTypeIDs []string `json:"resourceTypeIds"`
}

MetricAlertSelectorOptionsPlugins is an object the spec declares inline.

type MetricAlertSelectorPreview added in v0.30.0

type MetricAlertSelectorPreview struct {
	MatchingResourceCount int64 `json:"matchingResourceCount"`
	// SampleResourceNames: Up to 10 matching display names, for a live form
	// preview.
	SampleResourceNames []string `json:"sampleResourceNames"`
}

MetricAlertSelectorPreview is the `MetricAlertSelectorPreview` schema.

type MetricAlertsCreateParams added in v0.30.0

type MetricAlertsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body MetricAlertRuleInput
}

MetricAlertsCreateParams holds the parameters for `client.metricAlerts.create`.

type MetricAlertsDeleteParams added in v0.30.0

type MetricAlertsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

MetricAlertsDeleteParams holds the parameters for `client.metricAlerts.delete`.

type MetricAlertsEventsParams added in v0.30.0

type MetricAlertsEventsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID  *string
	RuleID *string
	Limit  *int64
}

MetricAlertsEventsParams holds the parameters for `client.metricAlerts.events`.

Every field is optional; pass nil to take the defaults.

type MetricAlertsGetParams added in v0.30.0

type MetricAlertsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

MetricAlertsGetParams holds the parameters for `client.metricAlerts.get`.

type MetricAlertsListParams added in v0.30.0

type MetricAlertsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

MetricAlertsListParams holds the parameters for `client.metricAlerts.list`.

Every field is optional; pass nil to take the defaults.

type MetricAlertsMetricKeysParams added in v0.30.0

type MetricAlertsMetricKeysParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID          *string
	PluginID       *string
	ResourceTypeID *string
}

MetricAlertsMetricKeysParams holds the parameters for `client.metricAlerts.metricKeys`.

Every field is optional; pass nil to take the defaults.

type MetricAlertsNamespace added in v0.30.0

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

MetricAlertsNamespace is `client.metricAlerts`.

func (*MetricAlertsNamespace) Create added in v0.30.0

Create: Create a metric alert rule

Rules select resources by query (plugin + resource type + tag), never by id list, so a rule automatically covers resources created after it was written. The poller evaluates enabled rules about once a minute and alerts when the condition held for the whole trailing window.

POST /api/org/{orgId}/metric-alerts

Raises on 400: Bad request

func (*MetricAlertsNamespace) Delete added in v0.30.0

Delete: Delete a metric alert rule

Soft delete. The rule's firing history stays readable via /metric-alerts/events.

DELETE /api/org/{orgId}/metric-alerts/{id}

Raises on 404: Not found

func (*MetricAlertsNamespace) Events added in v0.30.0

Events: Recent metric alert firings

GET /api/org/{orgId}/metric-alerts/events

func (*MetricAlertsNamespace) Get added in v0.30.0

Get: Get a metric alert rule

GET /api/org/{orgId}/metric-alerts/{id}

Raises on 404: Not found

func (*MetricAlertsNamespace) List added in v0.30.0

List: List metric alert rules with live firing status

GET /api/org/{orgId}/metric-alerts

func (*MetricAlertsNamespace) MetricKeys added in v0.30.0

MetricKeys: List metric series that actually exist

The series labels resources reported in the last 7 days, optionally narrowed to one plugin and resource type — what the rule builder's metric picker is fed from.

GET /api/org/{orgId}/metric-alerts/metric-keys

func (*MetricAlertsNamespace) SelectorOptions added in v0.30.0

SelectorOptions: List what the organization's resources offer to select on

GET /api/org/{orgId}/metric-alerts/selector-options

func (*MetricAlertsNamespace) SelectorPreview added in v0.30.0

SelectorPreview: Preview which resources a selector matches right now

GET /api/org/{orgId}/metric-alerts/selector-preview

Raises on 400: Bad request

func (*MetricAlertsNamespace) Update added in v0.30.0

Update: Update a metric alert rule

PUT /api/org/{orgId}/metric-alerts/{id}

Raises on 400: Bad request

Raises on 404: Not found

type MetricAlertsSelectorOptionsParams added in v0.30.0

type MetricAlertsSelectorOptionsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

MetricAlertsSelectorOptionsParams holds the parameters for `client.metricAlerts.selectorOptions`.

Every field is optional; pass nil to take the defaults.

type MetricAlertsSelectorPreviewParams added in v0.30.0

type MetricAlertsSelectorPreviewParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID          *string
	PluginID       *string
	ResourceTypeID *string
	TagKey         *string
	TagValue       *string
}

MetricAlertsSelectorPreviewParams holds the parameters for `client.metricAlerts.selectorPreview`.

Every field is optional; pass nil to take the defaults.

type MetricAlertsUpdateParams added in v0.30.0

type MetricAlertsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body MetricAlertRuleInput
}

MetricAlertsUpdateParams holds the parameters for `client.metricAlerts.update`.

type MetricSeries

type MetricSeries struct {
	Label  string               `json:"label"`
	Unit   *string              `json:"unit,omitempty"`
	Points []MetricSeriesPoints `json:"points"`
}

MetricSeries is the `MetricSeries` schema.

type MetricSeriesKey added in v0.30.0

type MetricSeriesKey struct {
	Label string `json:"label"`
	Unit  string `json:"unit"`
	// ResourceCount: Distinct resources that reported this series in the last 7
	// days.
	ResourceCount int64 `json:"resourceCount"`
}

MetricSeriesKey is the `MetricSeriesKey` schema.

type MetricSeriesPoints

type MetricSeriesPoints struct {
	// Timestamp: Unix epoch milliseconds.
	Timestamp float64 `json:"timestamp"`
	Value     float64 `json:"value"`
}

MetricSeriesPoints is an object the spec declares inline.

type MetricsRequest

type MetricsRequest struct {
	AccountID        string      `json:"accountId"`
	ResourceID       ResourceID  `json:"resourceId"`
	StartMs          *int64      `json:"startMs,omitempty"`
	EndMs            *int64      `json:"endMs,omitempty"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

MetricsRequest is the `MetricsRequest` schema.

type MetricsResponse

type MetricsResponse struct {
	Series []MetricSeries `json:"series"`
}

MetricsResponse is the `MetricsResponse` schema.

type MomentEvent added in v0.29.0

type MomentEvent struct {
	// ID: Stable synthetic id, unique within a response (`feed:rowId[:phase]`).
	ID   string       `json:"id"`
	Feed MomentFeedID `json:"feed"`
	// Kind: Fine-grained `<noun>.<verb>` kind, e.g. `change.created`,
	// `incident.started`, `workflow-run.failed`, `deployment.finished`,
	// `freeze.started`, `drift-alert.sent`. Open set — render unknown kinds
	// generically.
	Kind      string `json:"kind"`
	Timestamp string `json:"timestamp"`
	// Title: One-line headline.
	Title string `json:"title"`
	// Detail: Optional second line — diff summary, actor, error text.
	Detail         *string          `json:"detail,omitempty"`
	Severity       MomentSeverity   `json:"severity"`
	PluginID       *string          `json:"pluginId,omitempty"`
	AccountID      *string          `json:"accountId,omitempty"`
	AccountName    *string          `json:"accountName,omitempty"`
	ResourceID     *string          `json:"resourceId,omitempty"`
	ResourceTypeID *string          `json:"resourceTypeId,omitempty"`
	ResourceName   *string          `json:"resourceName,omitempty"`
	Link           *MomentEventLink `json:"link,omitempty"`
}

MomentEvent is the `MomentEvent` schema.

type MomentEventLink struct {
	// Kind: Which native screen the event deep-links to.
	//
	// One of "resource", "changes", "incident", "costs", "workflow-run",
	// "deployment", "audit", "freeze", "expiring".
	Kind string `json:"kind"`
	// ID: Target id where the kind needs one (resource id, run id, freeze id…).
	ID *string `json:"id,omitempty"`
	// ParentID: Parent id where the target needs one (workflow id for a run).
	ParentID *string `json:"parentId,omitempty"`
	// URL: Absolute external URL — a provider's incident page. Wins when
	// present.
	URL *string `json:"url,omitempty"`
}

MomentEventLink is the `MomentEventLink` schema.

The API may send null in its place.

type MomentFeedID added in v0.29.0

type MomentFeedID = string

MomentFeedID: One of the indexed feeds the moment union draws from.

Spec schema: `MomentFeedId`.

const (
	MomentFeedIDChanges         MomentFeedID = "changes"
	MomentFeedIDStatusIncidents MomentFeedID = "statusIncidents"
	MomentFeedIDCostAnomalies   MomentFeedID = "costAnomalies"
	MomentFeedIDWorkflowRuns    MomentFeedID = "workflowRuns"
	MomentFeedIDDeployments     MomentFeedID = "deployments"
	MomentFeedIDAudit           MomentFeedID = "audit"
	MomentFeedIDFreezes         MomentFeedID = "freezes"
	MomentFeedIDDriftAlerts     MomentFeedID = "driftAlerts"
	MomentFeedIDExpiryAlerts    MomentFeedID = "expiryAlerts"
)

The values MomentFeedID takes.

type MomentFeedStatus added in v0.29.0

type MomentFeedStatus struct {
	Feed MomentFeedID `json:"feed"`
	// Status: `omitted` = the caller lacks the feed's read permission; `error` =
	// the feed's query failed but the rest of the response is still valid
	// (partial-failure tolerance).
	//
	// One of "ok", "omitted", "error".
	Status string `json:"status"`
	// Error: Short failure reason when `status` is `error`.
	Error *string `json:"error,omitempty"`
	// Truncated: True when the feed hit its row cap and events were dropped.
	Truncated *bool `json:"truncated,omitempty"`
}

MomentFeedStatus is the `MomentFeedStatus` schema.

type MomentGetParams added in v0.29.0

type MomentGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// At: Centre of the window. Defaults to now.
	At *string
	// Window: Half-window in minutes (the ± around `at`). Default 60, max 4320
	// (±3 days).
	Window *int64
}

MomentGetParams holds the parameters for `client.moment.get`.

Every field is optional; pass nil to take the defaults.

type MomentIncidentSpan added in v0.29.0

type MomentIncidentSpan struct {
	ID         string `json:"id"`
	PluginID   string `json:"pluginId"`
	PluginName string `json:"pluginName"`
	Title      string `json:"title"`
	// Impact: One of "maintenance", "minor", "major", "critical".
	Impact     string  `json:"impact"`
	StartedAt  string  `json:"startedAt"`
	ResolvedAt *string `json:"resolvedAt,omitempty"`
	URL        *string `json:"url,omitempty"`
}

MomentIncidentSpan: A provider incident whose span overlaps the window — returned alongside the events so clients can badge events that fall inside it ("during DigitalOcean incident").

type MomentNamespace added in v0.29.0

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

MomentNamespace is `client.moment`.

func (*MomentNamespace) Get added in v0.29.0

Get: Everything that happened around a timestamp

"What changed around 03:14?" — one merged, chronological narrative of everything the platform knows happened in a window: resource changes (including sleep/wake schedule attribution), provider status incidents that started/resolved in or overlap the window, cost anomalies, workflow runs, deployments, audit-log entries, change freezes, and the drift/expiry alert deliveries. Each feed is gated on the same permission its own endpoint requires; feeds the caller cannot read are reported as `omitted`, and a feed whose query fails is reported as `error` without blanking the rest of the response.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/moment

Raises on 400: Bad request

type MomentResponse added in v0.29.0

type MomentResponse struct {
	// At: The centre timestamp, normalized to ISO.
	At   string `json:"at"`
	From string `json:"from"`
	To   string `json:"to"`
	// WindowMinutes: The half-window actually applied, after clamping to 1–4320
	// minutes.
	WindowMinutes int64  `json:"windowMinutes"`
	GeneratedAt   string `json:"generatedAt"`
	// Feeds: One entry per feed, in canonical order — including omitted and
	// errored feeds.
	Feeds []MomentFeedStatus `json:"feeds"`
	// Events: Chronological, oldest first.
	Events    []MomentEvent        `json:"events"`
	Incidents []MomentIncidentSpan `json:"incidents"`
}

MomentResponse is the `MomentResponse` schema.

type MomentSeverity added in v0.29.0

type MomentSeverity = string

MomentSeverity is the `MomentSeverity` schema.

const (
	MomentSeverityInfo     MomentSeverity = "info"
	MomentSeverityWarning  MomentSeverity = "warning"
	MomentSeverityCritical MomentSeverity = "critical"
)

The values MomentSeverity takes.

type MsTeamsStatus added in v0.4.0

type MsTeamsStatus struct {
	Webhooks []MsTeamsWebhook `json:"webhooks"`
}

MsTeamsStatus is the `MsTeamsStatus` schema.

type MsTeamsWebhook added in v0.4.0

type MsTeamsWebhook struct {
	ID string `json:"id"`
	// Label: Display name for the channel, e.g. #alerts
	Label string `json:"label"`
	// URLHint: Non-secret hint at the stored webhook URL (host and last four
	// characters). The URL itself is never returned.
	URLHint string `json:"urlHint"`
}

MsTeamsWebhook is the `MsTeamsWebhook` schema.

type MsTeamsWebhookCreate added in v0.4.0

type MsTeamsWebhookCreate struct {
	Label string `json:"label"`
	// URL: The webhook URL from a Teams 'Workflows' automation. Must be https
	// and on a Microsoft-operated host (*.api.powerautomate.com,
	// *.api.powerplatform.com, *.logic.azure.com, *.flow.microsoft.com, or a
	// legacy *.webhook.office.com connector).
	URL string `json:"url"`
}

MsTeamsWebhookCreate is the `MsTeamsWebhookCreate` schema.

type MsTeamsWebhookUpdate added in v0.4.0

type MsTeamsWebhookUpdate struct {
	Label string `json:"label"`
}

MsTeamsWebhookUpdate is the `MsTeamsWebhookUpdate` schema.

type MsteamsNamespace added in v0.4.0

type MsteamsNamespace struct {

	// Webhooks: `client.msteams.webhooks`.
	Webhooks *MsteamsWebhooksNamespace
	// contains filtered or unexported fields
}

MsteamsNamespace is `client.msteams`.

func (*MsteamsNamespace) Status added in v0.4.0

Status: List the organization's Teams channels

Returns the Teams channels alerts can be routed to. Which alerts reach each one is decided by /alert-rules. Webhook URLs are never included.

GET /api/org/{orgId}/msteams/status

func (*MsteamsNamespace) Test added in v0.4.0

Test: Post a test card to every configured Teams channel

Ignores routing rules — every channel gets the test. Fails with the error Microsoft returned when nothing could be delivered (HTTP 404 usually means the Workflow was deleted or turned off).

POST /api/org/{orgId}/msteams/test

Raises on 400: Bad request

type MsteamsStatusParams added in v0.4.0

type MsteamsStatusParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

MsteamsStatusParams holds the parameters for `client.msteams.status`.

Every field is optional; pass nil to take the defaults.

type MsteamsTestParams added in v0.4.0

type MsteamsTestParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

MsteamsTestParams holds the parameters for `client.msteams.test`.

Every field is optional; pass nil to take the defaults.

type MsteamsTestResponse added in v0.4.0

type MsteamsTestResponse struct {
	OK           bool  `json:"ok"`
	WebhookCount int64 `json:"webhookCount"`
	Attempted    int64 `json:"attempted"`
	Succeeded    int64 `json:"succeeded"`
}

MsteamsTestResponse is an object the spec declares inline.

type MsteamsWebhooksCreateParams added in v0.4.0

type MsteamsWebhooksCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *MsTeamsWebhookCreate
}

MsteamsWebhooksCreateParams holds the parameters for `client.msteams.webhooks.create`.

Every field is optional; pass nil to take the defaults.

type MsteamsWebhooksDeleteParams added in v0.4.0

type MsteamsWebhooksDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

MsteamsWebhooksDeleteParams holds the parameters for `client.msteams.webhooks.delete`.

type MsteamsWebhooksNamespace added in v0.4.0

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

MsteamsWebhooksNamespace is `client.msteams.webhooks`.

func (*MsteamsWebhooksNamespace) Create added in v0.4.0

Create: Connect a Teams channel as an alert destination

Adds a channel by webhook URL, or updates the one already holding that URL. Which alerts reach it is decided by /alert-rules — connecting a channel routes nothing to it on its own. Responds 400 when the URL is not https or its host is not Microsoft-operated.

POST /api/org/{orgId}/msteams/webhooks

Raises on 400: Bad request

func (*MsteamsWebhooksNamespace) Delete added in v0.4.0

Delete: Disconnect a Teams channel

DELETE /api/org/{orgId}/msteams/webhooks/{id}

Raises on 404: Not found

func (*MsteamsWebhooksNamespace) Update added in v0.4.0

Update: Rename a Teams channel

The webhook URL is immutable — remove the channel and re-add it to change it.

PATCH /api/org/{orgId}/msteams/webhooks/{id}

Raises on 400: Bad request

Raises on 404: Not found

type MsteamsWebhooksUpdateParams added in v0.4.0

type MsteamsWebhooksUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body *MsTeamsWebhookUpdate
}

MsteamsWebhooksUpdateParams holds the parameters for `client.msteams.webhooks.update`.

type NetworkFlowAccountStatus added in v1.10.0

type NetworkFlowAccountStatus struct {
	AccountID   string `json:"accountId"`
	PluginID    string `json:"pluginId"`
	DisplayName string `json:"displayName"`
	// SupportsFlows: False when the account's provider has no flow source we can
	// read. Such accounts are listed and excluded from the totals rather than
	// contributing zero bytes — zero would be a claim about their network, this
	// is a statement about our coverage.
	SupportsFlows    bool                `json:"supportsFlows"`
	CollectedThrough *string             `json:"collectedThrough"`
	LastPolledAt     *string             `json:"lastPolledAt"`
	FailureCount     int64               `json:"failureCount"`
	LastError        *string             `json:"lastError"`
	LastErrorHelpURL *string             `json:"lastErrorHelpUrl"`
	Sources          []NetworkFlowSource `json:"sources"`
	// LastQueryBytesScanned: Log data the provider billed this account for the
	// last collection's queries.
	LastQueryBytesScanned *float64 `json:"lastQueryBytesScanned"`
}

NetworkFlowAccountStatus is the `NetworkFlowAccountStatus` schema.

type NetworkFlowEndpoint added in v1.10.0

type NetworkFlowEndpoint struct {
	// Ref: Stable endpoint identity — a provider resource id where one could be
	// resolved, otherwise a class token (`internet`, `aws:s3`,
	// `infrawrench:unattributed`). Never a raw IP address: addresses churn, so
	// the same workload would be a different row every day.
	Ref     string `json:"ref"`
	Label   string `json:"label"`
	Zone    string `json:"zone"`
	Region  string `json:"region"`
	Service string `json:"service"`
	// ResourceTypeID: Set when `ref` is a resource this organization syncs, so
	// the row can link out.
	ResourceTypeID string `json:"resourceTypeId"`
}

NetworkFlowEndpoint is the `NetworkFlowEndpoint` schema.

type NetworkFlowFeed added in v1.10.0

type NetworkFlowFeed struct {
	Enabled             bool  `json:"enabled"`
	InitialLookbackDays int64 `json:"initialLookbackDays"`
	// Estimated: Always true. Flow bytes come from logs that sample or drop
	// under load and are priced at published list rates with no free tier, no
	// volume tier and no negotiated discount modelled — the ranking is sound,
	// the absolute figure will not reconcile to the invoice.
	Estimated bool                       `json:"estimated"`
	Range     NetworkFlowFeedRange       `json:"range"`
	Scopes    []NetworkFlowScopeSummary  `json:"scopes"`
	TopFlows  []NetworkFlowPair          `json:"topFlows"`
	Accounts  []NetworkFlowAccountStatus `json:"accounts"`
	RateCards []NetworkFlowRateCard      `json:"rateCards"`
	Totals    NetworkFlowFeedTotals      `json:"totals"`
}

NetworkFlowFeed is the `NetworkFlowFeed` schema.

type NetworkFlowFeedRange added in v1.10.0

type NetworkFlowFeedRange struct {
	From string `json:"from"`
	To   string `json:"to"`
}

NetworkFlowFeedRange is an object the spec declares inline.

type NetworkFlowFeedTotals added in v1.10.0

type NetworkFlowFeedTotals struct {
	Bytes             float64 `json:"bytes"`
	EstimatedCost     float64 `json:"estimatedCost"`
	Currency          string  `json:"currency"`
	UnattributedBytes float64 `json:"unattributedBytes"`
	TruncatedBytes    float64 `json:"truncatedBytes"`
}

NetworkFlowFeedTotals is an object the spec declares inline.

type NetworkFlowPair added in v1.10.0

type NetworkFlowPair struct {
	Source      NetworkFlowEndpoint `json:"source"`
	Destination NetworkFlowEndpoint `json:"destination"`
	// Scope: Which billing boundary the traffic crossed. `unknown` means the
	// provider's record did not determine one — it is priced at zero and
	// labelled rather than folded into a neighbouring boundary.
	//
	// One of "intra_zone", "cross_zone", "cross_region", "internet_egress",
	// "internet_ingress", "provider_service", "nat_gateway",
	// "private_interconnect", "unknown".
	Scope string `json:"scope"`
	// Direction: One of "egress", "ingress".
	Direction string `json:"direction"`
	// Attribution: One of "resolved", "unattributed".
	Attribution   string  `json:"attribution"`
	Bytes         float64 `json:"bytes"`
	Packets       float64 `json:"packets"`
	EstimatedCost float64 `json:"estimatedCost"`
	Currency      string  `json:"currency"`
	AccountID     string  `json:"accountId"`
	PluginID      string  `json:"pluginId"`
	// Days: Days in the range this pair appeared on.
	Days int64 `json:"days"`
}

NetworkFlowPair is the `NetworkFlowPair` schema.

type NetworkFlowRateCard added in v1.10.0

type NetworkFlowRateCard struct {
	PluginID string `json:"pluginId"`
	Currency string `json:"currency"`
	// AsOf: Date the rates were last checked against the provider's pricing
	// page.
	AsOf  string             `json:"asOf"`
	PerGb map[string]float64 `json:"perGb"`
	// QueriesBillable: True when collecting flows runs queries the provider
	// bills to your cloud account.
	QueriesBillable bool `json:"queriesBillable"`
	// Sampled: True when the flow source samples rather than recording all
	// flows.
	Sampled bool `json:"sampled"`
}

NetworkFlowRateCard is the `NetworkFlowRateCard` schema.

type NetworkFlowScopeSummary added in v1.10.0

type NetworkFlowScopeSummary struct {
	// Scope: Which billing boundary the traffic crossed. `unknown` means the
	// provider's record did not determine one — it is priced at zero and
	// labelled rather than folded into a neighbouring boundary.
	//
	// One of "intra_zone", "cross_zone", "cross_region", "internet_egress",
	// "internet_ingress", "provider_service", "nat_gateway",
	// "private_interconnect", "unknown".
	Scope string `json:"scope"`
	// Direction: One of "egress", "ingress".
	Direction     string  `json:"direction"`
	Bytes         float64 `json:"bytes"`
	EstimatedCost float64 `json:"estimatedCost"`
	Currency      string  `json:"currency"`
	CrossedZone   bool    `json:"crossedZone"`
	CrossedRegion bool    `json:"crossedRegion"`
	LeftCloud     bool    `json:"leftCloud"`
	// UnattributedBytes: Bytes inside `bytes` whose endpoints could not be tied
	// to a workload. A subset, not an addition — nothing here has been
	// apportioned across the attributed rows.
	UnattributedBytes float64 `json:"unattributedBytes"`
	// TruncatedBytes: Bytes inside `bytes` that fell below the stored top-N pair
	// cap, computed by subtraction against the provider's exact totals rather
	// than estimated.
	TruncatedBytes float64 `json:"truncatedBytes"`
}

NetworkFlowScopeSummary is the `NetworkFlowScopeSummary` schema.

type NetworkFlowSettings added in v1.10.0

type NetworkFlowSettings struct {
	Enabled             bool  `json:"enabled"`
	InitialLookbackDays int64 `json:"initialLookbackDays"`
}

NetworkFlowSettings is the `NetworkFlowSettings` schema.

type NetworkFlowSource added in v1.10.0

type NetworkFlowSource struct {
	ID string `json:"id"`
	// Target: What the flow log is attached to — a VPC id, a network.
	Target          string  `json:"target"`
	Region          *string `json:"region"`
	DestinationType string  `json:"destinationType"`
	Usable          bool    `json:"usable"`
	// UnusableReason: Why the source cannot be read, in terms that name the fix.
	UnusableReason *string `json:"unusableReason"`
	HelpURL        *string `json:"helpUrl"`
}

NetworkFlowSource is the `NetworkFlowSource` schema.

type NetworkFlowsGetParams added in v1.10.0

type NetworkFlowsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// From: Inclusive start day. Defaults to 13 days ago.
	From *string
	// To: Inclusive end day. Defaults to today.
	To *string
	// Scope: Narrow to one billing boundary.
	//
	// One of "intra_zone", "cross_zone", "cross_region", "internet_egress",
	// "internet_ingress", "provider_service", "nat_gateway",
	// "private_interconnect", "unknown".
	Scope *string
	// AccountID: Narrow to one connected account.
	AccountID *string
	// Limit: Pairs to return in `topFlows`, largest cost first. Defaults to 50.
	Limit *int64
}

NetworkFlowsGetParams holds the parameters for `client.networkFlows.get`.

Every field is optional; pass nil to take the defaults.

type NetworkFlowsNamespace added in v1.10.0

type NetworkFlowsNamespace struct {

	// Settings: `client.networkFlows.settings`.
	Settings *NetworkFlowsSettingsNamespace
	// contains filtered or unexported fields
}

NetworkFlowsNamespace is `client.networkFlows`.

func (*NetworkFlowsNamespace) Get added in v1.10.0

Get: Priced source→destination network flow attribution

Which two things are talking, across which billing boundary, and what that costs. Answers the question the cost dimensions structurally cannot: every cost dimension is about one side of a transfer, and a network charge is about a pair.

All figures are **estimates** and the `estimated` field says so unconditionally. Bytes come from the provider's flow logs (which sample, or drop records under capacity pressure) and are priced at published list rates with no free tier, no volume tier and no negotiated discount applied. Use the ranking; do not reconcile the total against an invoice line.

Accounts whose provider has no readable flow source appear in `accounts` with `supportsFlows: false` and contribute nothing to the totals — never zero bytes.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/network-flows

Raises on 400: Bad request

type NetworkFlowsSettingsGetParams added in v1.10.0

type NetworkFlowsSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

NetworkFlowsSettingsGetParams holds the parameters for `client.networkFlows.settings.get`.

Every field is optional; pass nil to take the defaults.

type NetworkFlowsSettingsNamespace added in v1.10.0

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

NetworkFlowsSettingsNamespace is `client.networkFlows.settings`.

func (*NetworkFlowsSettingsNamespace) Get added in v1.10.0

Get: Read the network flow collection switch

_Requires permission: `costs:read`._

GET /api/org/{orgId}/network-flows/settings

func (*NetworkFlowsSettingsNamespace) Update added in v1.10.0

Update: Turn network flow collection on or off

Collection is **off by default**. Enabling it authorizes Infrawrench to run daily queries against the provider's log store — and on AWS those queries are billed to your own cloud account per GB of log data scanned, every day, until you turn them off. That is why the write is governed by `org:settings:write` rather than `costs:write`, and why it is audit-logged.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/network-flows/settings

Raises on 400: Bad request

Raises on 403: Forbidden

type NetworkFlowsSettingsUpdateParams added in v1.10.0

type NetworkFlowsSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body NetworkFlowSettings
}

NetworkFlowsSettingsUpdateParams holds the parameters for `client.networkFlows.settings.update`.

type NoSQLCommandRequest

type NoSQLCommandRequest struct {
	PluginID         string      `json:"pluginId"`
	AccountID        string      `json:"accountId"`
	ResourceTypeID   string      `json:"resourceTypeId"`
	ResourceID       ResourceID  `json:"resourceId"`
	Command          string      `json:"command"`
	Args             []any       `json:"args"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

NoSQLCommandRequest is the `NoSqlCommandRequest` schema.

Spec schema: `NoSqlCommandRequest`.

type OK

type OK struct {
	OK bool `json:"ok"`
}

OK is the `Ok` schema.

Spec schema: `Ok`.

type OnCallNamespace added in v1.34.0

type OnCallNamespace struct {

	// Overrides: `client.onCall.overrides`.
	Overrides *OnCallOverridesNamespace
	// Schedules: `client.onCall.schedules`.
	Schedules *OnCallSchedulesNamespace
	// contains filtered or unexported fields
}

OnCallNamespace is `client.onCall`.

func (*OnCallNamespace) Now added in v1.34.0

Now: Who is on call right now

One entry per rotation: the shift in effect, and the next person in the rotation. Takes `team:read` — knowing who is on call is something every member needs and nobody should have to ask an admin for.

GET /api/org/{orgId}/on-call/now

type OnCallNowEntry added in v1.34.0

type OnCallNowEntry struct {
	ScheduleID   string             `json:"scheduleId"`
	ScheduleName string             `json:"scheduleName"`
	Enabled      bool               `json:"enabled"`
	Shift        *OnCallShift       `json:"shift"`
	Next         *OnCallParticipant `json:"next"`
}

OnCallNowEntry is the `OnCallNowEntry` schema.

type OnCallNowParams added in v1.34.0

type OnCallNowParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

OnCallNowParams holds the parameters for `client.onCall.now`.

Every field is optional; pass nil to take the defaults.

type OnCallNowResponse added in v1.34.0

type OnCallNowResponse struct {
	OnCall      []OnCallNowEntry `json:"onCall"`
	GeneratedAt string           `json:"generatedAt"`
}

OnCallNowResponse is the `OnCallNowResponse` schema.

type OnCallOverride added in v1.34.0

type OnCallOverride struct {
	ID              string  `json:"id"`
	ScheduleID      string  `json:"scheduleId"`
	UserID          string  `json:"userId"`
	UserName        *string `json:"userName"`
	StartsAt        string  `json:"startsAt"`
	EndsAt          string  `json:"endsAt"`
	Reason          *string `json:"reason"`
	CreatedByUserID *string `json:"createdByUserId"`
	CreatedAt       string  `json:"createdAt"`
}

OnCallOverride is the `OnCallOverride` schema.

type OnCallOverrideCreate added in v1.34.0

type OnCallOverrideCreate struct {
	ScheduleID string  `json:"scheduleId"`
	UserID     string  `json:"userId"`
	StartsAt   string  `json:"startsAt"`
	EndsAt     string  `json:"endsAt"`
	Reason     *string `json:"reason,omitempty"`
}

OnCallOverrideCreate is the `OnCallOverrideCreate` schema.

type OnCallOverridesCreateParams added in v1.34.0

type OnCallOverridesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *OnCallOverrideCreate
}

OnCallOverridesCreateParams holds the parameters for `client.onCall.overrides.create`.

Every field is optional; pass nil to take the defaults.

type OnCallOverridesDeleteParams added in v1.34.0

type OnCallOverridesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	OverrideID string
}

OnCallOverridesDeleteParams holds the parameters for `client.onCall.overrides.delete`.

type OnCallOverridesGetParams added in v1.34.0

type OnCallOverridesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ScheduleID *string
}

OnCallOverridesGetParams holds the parameters for `client.onCall.overrides.get`.

Every field is optional; pass nil to take the defaults.

type OnCallOverridesGetResponse added in v1.34.0

type OnCallOverridesGetResponse struct {
	Overrides []OnCallOverride `json:"overrides"`
}

OnCallOverridesGetResponse is an object the spec declares inline.

type OnCallOverridesNamespace added in v1.34.0

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

OnCallOverridesNamespace is `client.onCall.overrides`.

func (*OnCallOverridesNamespace) Create added in v1.34.0

Create: Arrange cover

A cover beats the rotation for exactly its window. Among several overlapping covers the one that **started most recently** wins, so a later-written cover supersedes an earlier one rather than the answer depending on row order.

Takes `team:read`, not a settings permission: cover is arranged at 17:55 on a Friday and the person handing over is rarely an org admin. Every cover is audit-logged, which is the control that makes the looser permission safe.

POST /api/org/{orgId}/on-call/overrides

Raises on 400: Bad request

Raises on 404: Not found

func (*OnCallOverridesNamespace) Delete added in v1.34.0

Delete: Cancel a cover

DELETE /api/org/{orgId}/on-call/overrides/{overrideId}

Raises on 404: Not found

func (*OnCallOverridesNamespace) Get added in v1.34.0

Get: List covers

GET /api/org/{orgId}/on-call/overrides

type OnCallParticipant added in v1.34.0

type OnCallParticipant struct {
	UserID string  `json:"userId"`
	Name   *string `json:"name"`
	Email  *string `json:"email"`
}

OnCallParticipant: The next person in the rotation — where an escalation goes. Resolved from the rotation and never from a cover: a cover is somebody standing in for one shift.

The API may send null in its place.

type OnCallSchedule added in v1.34.0

type OnCallSchedule struct {
	ID       string `json:"id"`
	Name     string `json:"name"`
	Timezone string `json:"timezone"`
	// RotationDays: Days per shift. 7 is the common case; 1 gives a daily
	// rotation.
	RotationDays int64 `json:"rotationDays"`
	// HandoffTime: Wall-clock time in `timezone` at which the shift changes
	// hands.
	HandoffTime string `json:"handoffTime"`
	// StartDate: The calendar date in `timezone` the first shift begins on.
	// Every later boundary is derived from it, so moving this re-anchors the
	// whole rotation.
	StartDate string `json:"startDate"`
	// Participants: Rotation order. Reordering re-plans the future,
	// deliberately.
	Participants []*OnCallParticipant `json:"participants"`
	// Enabled: Off resolves to nobody. A routing destination pointing at a
	// disabled rotation contributes nobody and the rule's other destinations
	// still deliver.
	Enabled   bool   `json:"enabled"`
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
}

OnCallSchedule is the `OnCallSchedule` schema.

type OnCallScheduleCreate added in v1.34.0

type OnCallScheduleCreate struct {
	Name               string   `json:"name"`
	Timezone           string   `json:"timezone"`
	RotationDays       int64    `json:"rotationDays"`
	HandoffTime        string   `json:"handoffTime"`
	StartDate          string   `json:"startDate"`
	ParticipantUserIDs []string `json:"participantUserIds"`
	Enabled            *bool    `json:"enabled,omitempty"`
}

OnCallScheduleCreate is the `OnCallScheduleCreate` schema.

type OnCallScheduleList added in v1.34.0

type OnCallScheduleList struct {
	Schedules []OnCallSchedule `json:"schedules"`
}

OnCallScheduleList is the `OnCallScheduleList` schema.

type OnCallScheduleUpdate added in v1.34.0

type OnCallScheduleUpdate struct {
	Name               *string  `json:"name,omitempty"`
	Timezone           *string  `json:"timezone,omitempty"`
	RotationDays       *int64   `json:"rotationDays,omitempty"`
	HandoffTime        *string  `json:"handoffTime,omitempty"`
	StartDate          *string  `json:"startDate,omitempty"`
	ParticipantUserIDs []string `json:"participantUserIds,omitempty"`
	Enabled            *bool    `json:"enabled,omitempty"`
}

OnCallScheduleUpdate is the `OnCallScheduleUpdate` schema.

type OnCallSchedulesCreateParams added in v1.34.0

type OnCallSchedulesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *OnCallScheduleCreate
}

OnCallSchedulesCreateParams holds the parameters for `client.onCall.schedules.create`.

Every field is optional; pass nil to take the defaults.

type OnCallSchedulesDeleteParams added in v1.34.0

type OnCallSchedulesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ScheduleID string
}

OnCallSchedulesDeleteParams holds the parameters for `client.onCall.schedules.delete`.

type OnCallSchedulesGetParams added in v1.34.0

type OnCallSchedulesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

OnCallSchedulesGetParams holds the parameters for `client.onCall.schedules.get`.

Every field is optional; pass nil to take the defaults.

type OnCallSchedulesNamespace added in v1.34.0

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

OnCallSchedulesNamespace is `client.onCall.schedules`.

func (*OnCallSchedulesNamespace) Create added in v1.34.0

Create: Create an on-call rotation

Shift boundaries are calendar-day arithmetic in the rotation's own zone, not 24-hour arithmetic: a rotation stepped in fixed milliseconds drifts an hour at each daylight-saving change until the 09:00 Monday handover happens at 08:00 — or until two people each think the other is on call.

Writing takes `org:settings:write`: a rotation decides who gets woken up.

POST /api/org/{orgId}/on-call/schedules

Raises on 400: Bad request

Raises on 409: Conflict

func (*OnCallSchedulesNamespace) Delete added in v1.34.0

Delete: Delete an on-call rotation

Takes its covers with it. Routing rules naming it resolve to nobody afterwards.

DELETE /api/org/{orgId}/on-call/schedules/{scheduleId}

Raises on 404: Not found

func (*OnCallSchedulesNamespace) Get added in v1.34.0

Get: List on-call rotations

GET /api/org/{orgId}/on-call/schedules

func (*OnCallSchedulesNamespace) Shifts added in v1.34.0

Shifts: Preview upcoming shifts

The same computation the alert path resolves with, so a preview can never disagree with who actually gets woken up.

GET /api/org/{orgId}/on-call/schedules/{scheduleId}/shifts

Raises on 400: Bad request

Raises on 404: Not found

func (*OnCallSchedulesNamespace) Update added in v1.34.0

Update: Edit an on-call rotation

Omitted fields are left alone, and the result is validated after merging. Sending `participantUserIds` replaces the list wholesale — position is rotation order, so reordering re-plans the future.

PATCH /api/org/{orgId}/on-call/schedules/{scheduleId}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

type OnCallSchedulesShiftsParams added in v1.34.0

type OnCallSchedulesShiftsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ScheduleID string
	Count      *int64
}

OnCallSchedulesShiftsParams holds the parameters for `client.onCall.schedules.shifts`.

type OnCallSchedulesUpdateParams added in v1.34.0

type OnCallSchedulesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ScheduleID string
	// Body: the JSON request body.
	Body *OnCallScheduleUpdate
}

OnCallSchedulesUpdateParams holds the parameters for `client.onCall.schedules.update`.

type OnCallShift added in v1.34.0

type OnCallShift struct {
	StartsAt string  `json:"startsAt"`
	EndsAt   string  `json:"endsAt"`
	UserID   string  `json:"userId"`
	Name     *string `json:"name"`
	Email    *string `json:"email"`
	// Source: One of "rotation", "override".
	Source        string `json:"source"`
	RotationIndex *int64 `json:"rotationIndex"`
}

OnCallShift is the `OnCallShift` schema.

The API may send null in its place.

type OnCallShiftsResponse added in v1.34.0

type OnCallShiftsResponse struct {
	Shifts []*OnCallShift `json:"shifts"`
	// Overrides: Covers overlapping the previewed window, returned
	// **separately** rather than merged into the shifts: a preview that folded
	// them in would make it impossible to see what the rotation itself does,
	// which is the thing being edited.
	Overrides []OnCallOverride `json:"overrides"`
}

OnCallShiftsResponse is the `OnCallShiftsResponse` schema.

type OrgConfigAlertSettings added in v1.2.0

type OrgConfigAlertSettings struct {
	CostAnomaly *OrgConfigAlertSettingsCostAnomaly `json:"costAnomaly,omitempty"`
	Drift       *OrgConfigAlertSettingsDrift       `json:"drift,omitempty"`
	Expiry      *OrgConfigAlertSettingsExpiry      `json:"expiry,omitempty"`
	Posture     *OrgConfigAlertSettingsPosture     `json:"posture,omitempty"`
	Digest      *OrgConfigAlertSettingsDigest      `json:"digest,omitempty"`
}

OrgConfigAlertSettings: Org-wide notification tuning. Cooldown claims (`lastNotifiedAt`, `lastSentWeekStart`) are deliberately absent: they are poller state, and resetting one from an apply would re-open a quiet period and page people twice.

type OrgConfigAlertSettingsCostAnomaly added in v1.2.0

type OrgConfigAlertSettingsCostAnomaly struct {
	Sigmas            float64 `json:"sigmas"`
	MinDeltaCents     int64   `json:"minDeltaCents"`
	NewSourceMinCents int64   `json:"newSourceMinCents"`
	// SmsAlerts: One of "off", "new_source", "all".
	SmsAlerts string `json:"smsAlerts"`
}

OrgConfigAlertSettingsCostAnomaly is an object the spec declares inline.

type OrgConfigAlertSettingsDigest added in v1.2.0

type OrgConfigAlertSettingsDigest struct {
	Enabled          bool     `json:"enabled"`
	Timezone         string   `json:"timezone"`
	SendDay          int64    `json:"sendDay"`
	SendHour         int64    `json:"sendHour"`
	NarrativeEnabled bool     `json:"narrativeEnabled"`
	Recipients       []string `json:"recipients"`
}

OrgConfigAlertSettingsDigest is an object the spec declares inline.

type OrgConfigAlertSettingsDrift added in v1.2.0

type OrgConfigAlertSettingsDrift struct {
	NotifyCreated   bool  `json:"notifyCreated"`
	NotifyUpdated   bool  `json:"notifyUpdated"`
	NotifyDeleted   bool  `json:"notifyDeleted"`
	CooldownMinutes int64 `json:"cooldownMinutes"`
	MinChanges      int64 `json:"minChanges"`
	// Accounts: Account display names; empty means every account.
	Accounts []string `json:"accounts"`
}

OrgConfigAlertSettingsDrift is an object the spec declares inline.

type OrgConfigAlertSettingsExpiry added in v1.2.0

type OrgConfigAlertSettingsExpiry struct {
	Enabled  bool  `json:"enabled"`
	LeadDays int64 `json:"leadDays"`
}

OrgConfigAlertSettingsExpiry is an object the spec declares inline.

type OrgConfigAlertSettingsPosture added in v1.2.0

type OrgConfigAlertSettingsPosture struct {
	Enabled bool `json:"enabled"`
}

OrgConfigAlertSettingsPosture is an object the spec declares inline.

type OrgConfigApplyResult added in v1.2.0

type OrgConfigApplyResult struct {
	// Mode: One of "merge", "replace".
	Mode       string                     `json:"mode"`
	Changes    []OrgConfigChange          `json:"changes"`
	Unresolved []OrgConfigUnresolved      `json:"unresolved"`
	Counts     OrgConfigApplyResultCounts `json:"counts"`
	Applied    bool                       `json:"applied"`
}

OrgConfigApplyResult is the `OrgConfigApplyResult` schema.

type OrgConfigApplyResultCounts added in v1.2.0

type OrgConfigApplyResultCounts struct {
	Create    int64 `json:"create"`
	Update    int64 `json:"update"`
	Delete    int64 `json:"delete"`
	Unchanged int64 `json:"unchanged"`
}

OrgConfigApplyResultCounts is an object the spec declares inline.

type OrgConfigBudget added in v1.2.0

type OrgConfigBudget struct {
	// Key: Stable slug identifying this entity across organizations. Derived
	// from the name on export; it is what an apply matches on, so renaming an
	// entity while keeping its key is a rename rather than a delete-and-create.
	Key         string                      `json:"key"`
	Name        string                      `json:"name"`
	AmountCents int64                       `json:"amountCents"`
	Currency    *string                     `json:"currency,omitempty"`
	Filters     []OrgConfigCostFilter       `json:"filters,omitempty"`
	Thresholds  []OrgConfigBudgetThresholds `json:"thresholds"`
}

OrgConfigBudget is the `OrgConfigBudget` schema.

type OrgConfigBudgetThresholds added in v1.2.0

type OrgConfigBudgetThresholds struct {
	// Type: One of "actual", "forecast".
	Type    string `json:"type"`
	Percent int64  `json:"percent"`
}

OrgConfigBudgetThresholds is an object the spec declares inline.

type OrgConfigChange added in v1.2.0

type OrgConfigChange struct {
	Section OrgConfigSection `json:"section"`
	Key     string           `json:"key"`
	Name    string           `json:"name"`
	// Action: One of "create", "update", "delete", "unchanged".
	Action string `json:"action"`
	// Fields: Fields that differ, on an update.
	Fields []string `json:"fields,omitempty"`
}

OrgConfigChange is the `OrgConfigChange` schema.

type OrgConfigCostCentre added in v1.2.0

type OrgConfigCostCentre struct {
	// Key: Stable slug identifying this entity across organizations. Derived
	// from the name on export; it is what an apply matches on, so renaming an
	// entity while keeping its key is a rename rather than a delete-and-create.
	Key         string                     `json:"key"`
	Name        string                     `json:"name"`
	Description *string                    `json:"description,omitempty"`
	Rules       []OrgConfigCostCentreRules `json:"rules,omitempty"`
}

OrgConfigCostCentre is the `OrgConfigCostCentre` schema.

type OrgConfigCostCentreRules added in v1.2.0

type OrgConfigCostCentreRules struct {
	Priority int64                          `json:"priority"`
	Match    *OrgConfigCostCentreRulesMatch `json:"match,omitempty"`
}

OrgConfigCostCentreRules is an object the spec declares inline.

type OrgConfigCostCentreRulesMatch added in v1.2.0

type OrgConfigCostCentreRulesMatch struct {
	TagKey   *string `json:"tagKey,omitempty"`
	TagValue *string `json:"tagValue,omitempty"`
	// Account: Account display name.
	Account  *string `json:"account,omitempty"`
	PluginID *string `json:"pluginId,omitempty"`
	Service  *string `json:"service,omitempty"`
}

OrgConfigCostCentreRulesMatch is an object the spec declares inline.

type OrgConfigCostFilter added in v1.2.0

type OrgConfigCostFilter struct {
	Dimension string `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

OrgConfigCostFilter is the `OrgConfigCostFilter` schema.

type OrgConfigCustomGraph added in v1.2.0

type OrgConfigCustomGraph struct {
	// Key: Stable slug identifying this entity across organizations. Derived
	// from the name on export; it is what an apply matches on, so renaming an
	// entity while keeping its key is a rename rather than a delete-and-create.
	Key         string  `json:"key"`
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	// Source: The graph's TypeScript source.
	Source string `json:"source"`
}

OrgConfigCustomGraph is the `OrgConfigCustomGraph` schema.

type OrgConfigDashboard added in v1.2.0

type OrgConfigDashboard struct {
	// Key: Stable slug identifying this entity across organizations. Derived
	// from the name on export; it is what an apply matches on, so renaming an
	// entity while keeping its key is a rename rather than a delete-and-create.
	Key       string                   `json:"key"`
	Name      string                   `json:"name"`
	IsDefault *bool                    `json:"isDefault,omitempty"`
	Cards     []OrgConfigDashboardCard `json:"cards,omitempty"`
}

OrgConfigDashboard is the `OrgConfigDashboard` schema.

type OrgConfigDashboardCard added in v1.2.0

type OrgConfigDashboardCard = any

OrgConfigDashboardCard: One card. Position is the index in the dashboard's `cards` array — the grid order all three card kinds share.

type OrgConfigDocument added in v1.2.0

type OrgConfigDocument struct {
	Version       *int64                         `json:"version,omitempty"`
	ExportedAt    *string                        `json:"exportedAt,omitempty"`
	ExportedFrom  *OrgConfigDocumentExportedFrom `json:"exportedFrom,omitempty"`
	Budgets       []OrgConfigBudget              `json:"budgets,omitempty"`
	CustomGraphs  []OrgConfigCustomGraph         `json:"customGraphs,omitempty"`
	Workflows     []OrgConfigWorkflow            `json:"workflows,omitempty"`
	Dashboards    []OrgConfigDashboard           `json:"dashboards,omitempty"`
	MetricAlerts  []OrgConfigMetricAlert         `json:"metricAlerts,omitempty"`
	Probes        []OrgConfigProbe               `json:"probes,omitempty"`
	CostCentres   []OrgConfigCostCentre          `json:"costCentres,omitempty"`
	TagPolicy     *OrgConfigDocumentTagPolicy    `json:"tagPolicy,omitempty"`
	AlertSettings *OrgConfigAlertSettings        `json:"alertSettings,omitempty"`
}

OrgConfigDocument: An organization's configuration. Every section is optional — a document that omits one leaves it entirely alone, in both apply modes.

type OrgConfigDocumentExportedFrom added in v1.2.0

type OrgConfigDocumentExportedFrom struct {
	OrganizationID   string `json:"organizationId"`
	OrganizationName string `json:"organizationName"`
}

OrgConfigDocumentExportedFrom is an object the spec declares inline.

type OrgConfigDocumentTagPolicy added in v1.2.0

type OrgConfigDocumentTagPolicy struct {
	RequiredTags    []OrgConfigDocumentTagPolicyRequiredTags `json:"requiredTags"`
	EnforceOnCreate bool                                     `json:"enforceOnCreate"`
}

OrgConfigDocumentTagPolicy is an object the spec declares inline.

type OrgConfigDocumentTagPolicyRequiredTags added in v1.2.0

type OrgConfigDocumentTagPolicyRequiredTags struct {
	Key           string   `json:"key"`
	AllowedValues []string `json:"allowedValues,omitempty"`
}

OrgConfigDocumentTagPolicyRequiredTags is an object the spec declares inline.

type OrgConfigMetricAlert added in v1.2.0

type OrgConfigMetricAlert struct {
	// Key: Stable slug identifying this entity across organizations. Derived
	// from the name on export; it is what an apply matches on, so renaming an
	// entity while keeping its key is a rename rather than a delete-and-create.
	Key            string  `json:"key"`
	Name           string  `json:"name"`
	PluginID       *string `json:"pluginId,omitempty"`
	ResourceTypeID *string `json:"resourceTypeId,omitempty"`
	TagKey         *string `json:"tagKey,omitempty"`
	TagValue       *string `json:"tagValue,omitempty"`
	MetricKey      string  `json:"metricKey"`
	// Comparator: One of ">", ">=", "<", "<=".
	Comparator      string  `json:"comparator"`
	Threshold       float64 `json:"threshold"`
	ForMinutes      *int64  `json:"forMinutes,omitempty"`
	CooldownMinutes *int64  `json:"cooldownMinutes,omitempty"`
	Enabled         *bool   `json:"enabled,omitempty"`
}

OrgConfigMetricAlert is the `OrgConfigMetricAlert` schema.

type OrgConfigPlan added in v1.2.0

type OrgConfigPlan struct {
	// Mode: One of "merge", "replace".
	Mode       string                `json:"mode"`
	Changes    []OrgConfigChange     `json:"changes"`
	Unresolved []OrgConfigUnresolved `json:"unresolved"`
	Counts     OrgConfigPlanCounts   `json:"counts"`
}

OrgConfigPlan is the `OrgConfigPlan` schema.

type OrgConfigPlanCounts added in v1.2.0

type OrgConfigPlanCounts struct {
	Create    int64 `json:"create"`
	Update    int64 `json:"update"`
	Delete    int64 `json:"delete"`
	Unchanged int64 `json:"unchanged"`
}

OrgConfigPlanCounts is an object the spec declares inline.

type OrgConfigProbe added in v1.2.0

type OrgConfigProbe struct {
	// Key: Stable slug identifying this entity across organizations. Derived
	// from the name on export; it is what an apply matches on, so renaming an
	// entity while keeping its key is a rename rather than a delete-and-create.
	Key              string  `json:"key"`
	Name             string  `json:"name"`
	URL              string  `json:"url"`
	Method           *string `json:"method,omitempty"`
	IntervalSeconds  *int64  `json:"intervalSeconds,omitempty"`
	TimeoutMs        *int64  `json:"timeoutMs,omitempty"`
	FailureThreshold *int64  `json:"failureThreshold,omitempty"`
	Enabled          *bool   `json:"enabled,omitempty"`
}

OrgConfigProbe is the `OrgConfigProbe` schema.

type OrgConfigRequest added in v1.2.0

type OrgConfigRequest struct {
	Document OrgConfigDocument `json:"document"`
	// Mode: `merge` creates and updates what the document names and leaves
	// everything else alone. `replace` additionally deletes entities the
	// document does not name, within the sections it carries.
	//
	// One of "merge", "replace".
	Mode *string `json:"mode,omitempty"`
}

OrgConfigRequest is the `OrgConfigRequest` schema.

type OrgConfigSection added in v1.2.0

type OrgConfigSection = string

OrgConfigSection is the `OrgConfigSection` schema.

const (
	OrgConfigSectionBudgets       OrgConfigSection = "budgets"
	OrgConfigSectionCustomGraphs  OrgConfigSection = "customGraphs"
	OrgConfigSectionWorkflows     OrgConfigSection = "workflows"
	OrgConfigSectionDashboards    OrgConfigSection = "dashboards"
	OrgConfigSectionMetricAlerts  OrgConfigSection = "metricAlerts"
	OrgConfigSectionProbes        OrgConfigSection = "probes"
	OrgConfigSectionCostCentres   OrgConfigSection = "costCentres"
	OrgConfigSectionTagPolicy     OrgConfigSection = "tagPolicy"
	OrgConfigSectionAlertSettings OrgConfigSection = "alertSettings"
)

The values OrgConfigSection takes.

type OrgConfigUnresolved added in v1.2.0

type OrgConfigUnresolved struct {
	Section OrgConfigSection `json:"section"`
	Key     string           `json:"key"`
	Detail  string           `json:"detail"`
}

OrgConfigUnresolved: Something the document asked for that this organization could not satisfy — a pin for a resource nobody has synced, an account name that does not exist here. Not fatal: the affected card, clause or deletion is dropped and the rest of the document still applies.

type OrgConfigWorkflow added in v1.2.0

type OrgConfigWorkflow struct {
	// Key: Stable slug identifying this entity across organizations. Derived
	// from the name on export; it is what an apply matches on, so renaming an
	// entity while keeping its key is a rename rather than a delete-and-create.
	Key         string  `json:"key"`
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	// Source: The workflow's TypeScript source.
	Source  string                     `json:"source"`
	Trigger OrgConfigWorkflowTrigger   `json:"trigger,omitempty"`
	Metrics []OrgConfigWorkflowMetrics `json:"metrics,omitempty"`
	Enabled *bool                      `json:"enabled,omitempty"`
}

OrgConfigWorkflow: A workflow. The git-webhook signing secret is deliberately absent — it is write-only, so a document can neither leak nor set one.

type OrgConfigWorkflowMetrics added in v1.2.0

type OrgConfigWorkflowMetrics struct {
	Key   string  `json:"key"`
	Label string  `json:"label"`
	Unit  *string `json:"unit,omitempty"`
	Type  *string `json:"type,omitempty"`
}

OrgConfigWorkflowMetrics is an object the spec declares inline.

type OrgConfigWorkflowTrigger added in v1.2.0

type OrgConfigWorkflowTrigger = any

OrgConfigWorkflowTrigger is the `OrgConfigWorkflowTrigger` schema.

type OrgMember

type OrgMember struct {
	ID            string           `json:"id"`
	Email         string           `json:"email"`
	DisplayName   *string          `json:"displayName"`
	Role          OrganizationRole `json:"role"`
	RoleID        *string          `json:"roleId"`
	RoleName      *string          `json:"roleName"`
	RoleSystemKey *string          `json:"roleSystemKey"`
	CreatedAt     string           `json:"createdAt"`
}

OrgMember is the `OrgMember` schema.

type OrgMembership

type OrgMembership struct {
	ID          string           `json:"id"`
	DisplayName string           `json:"displayName"`
	Role        OrganizationRole `json:"role"`
}

OrgMembership is the `OrgMembership` schema.

type OrgStatusIncident added in v0.29.0

type OrgStatusIncident struct {
	// ID: Cached incident row id.
	ID       string `json:"id"`
	PluginID string `json:"pluginId"`
	// PluginName: Provider display name, e.g. "DigitalOcean".
	PluginName string                 `json:"pluginName"`
	Title      string                 `json:"title"`
	State      ProviderIncidentState  `json:"state"`
	Impact     ProviderIncidentImpact `json:"impact"`
	// URL: Deep link to the provider's incident page or status page.
	URL          *string `json:"url"`
	StartedAt    string  `json:"startedAt"`
	ResolvedAt   *string `json:"resolvedAt"`
	LastUpdateAt *string `json:"lastUpdateAt"`
	// LastUpdateText: Plain-text body of the provider's most recent update.
	LastUpdateText *string `json:"lastUpdateText"`
	// Regions: Plugin-native region ids the provider reports as affected.
	Regions []string `json:"regions"`
	// Services: Human-readable affected provider services/products.
	Services []string `json:"services"`
	// ProviderWide: True when the incident affects the provider as a whole.
	ProviderWide bool `json:"providerWide"`
	// AffectedResourceCount: How many of the organization's resources the
	// incident overlaps.
	AffectedResourceCount int64 `json:"affectedResourceCount"`
	// AffectedRegions: The subset of `regions` where the organization actually
	// holds resources.
	AffectedRegions []string `json:"affectedRegions"`
	// SampleResources: Up to five of the overlapped resources, for display.
	SampleResources []ProviderIncidentResourceSample `json:"sampleResources"`
	// OverlappingChangeCount: Change-timeline events recorded on this provider
	// during the incident window — "these N changes happened during an
	// incident".
	OverlappingChangeCount int64 `json:"overlappingChangeCount"`
}

OrgStatusIncident is the `OrgStatusIncident` schema.

type OrgStatusIncidentsResponse added in v0.29.0

type OrgStatusIncidentsResponse struct {
	Incidents []OrgStatusIncident `json:"incidents"`
}

OrgStatusIncidentsResponse is the `OrgStatusIncidentsResponse` schema.

type Organization

type Organization struct {
	ID          string `json:"id"`
	DisplayName string `json:"displayName"`
}

Organization is the `Organization` schema.

type OrganizationRef added in v0.8.0

type OrganizationRef struct {
	ID   string `json:"id"`
	Name string `json:"name"`
}

OrganizationRef is the `OrganizationRef` schema.

type OrganizationRole

type OrganizationRole = string

OrganizationRole is the `OrganizationRole` schema.

const (
	OrganizationRoleOwner  OrganizationRole = "owner"
	OrganizationRoleAdmin  OrganizationRole = "admin"
	OrganizationRoleMember OrganizationRole = "member"
)

The values OrganizationRole takes.

type OrgsCreateParams

type OrgsCreateParams struct {
	// Body: the JSON request body.
	Body CreateOrgRequest
}

OrgsCreateParams holds the parameters for `client.orgs.create`.

type OrgsNamespace

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

OrgsNamespace is `client.orgs`.

func (*OrgsNamespace) Create

func (n *OrgsNamespace) Create(ctx context.Context, params OrgsCreateParams, opts ...RequestOption) (*Organization, error)

Create: Create a new organization

The caller becomes the `owner` of the new organization.

POST /api/orgs

Raises on 400: Bad request

Raises on 401: Unauthenticated

type OrphanAccountGroup added in v0.19.0

type OrphanAccountGroup struct {
	AccountID   string             `json:"accountId"`
	AccountName string             `json:"accountName"`
	PluginID    PluginID           `json:"pluginId"`
	PluginName  string             `json:"pluginName"`
	Resources   []OrphanedResource `json:"resources"`
}

OrphanAccountGroup is the `OrphanAccountGroup` schema.

type OrphanCostAnnotation added in v0.19.0

type OrphanCostAnnotation struct {
	// Amount: Spend over the trailing cost window.
	Amount   float64 `json:"amount"`
	Currency string  `json:"currency"`
}

OrphanCostAnnotation: Best-effort trailing spend matched from collected per-resource cost rows; null when the provider reports no per-resource cost. The flag itself never depends on billing data.

The API may send null in its place.

type OrphanListResponse added in v0.19.0

type OrphanListResponse struct {
	// Accounts: Groups sorted by account name.
	Accounts   []OrphanAccountGroup `json:"accounts"`
	TotalCount int64                `json:"totalCount"`
	// UnownedCount: Flagged resources with no recorded owner — the 'nobody to
	// ask' count.
	UnownedCount int64 `json:"unownedCount"`
	// CostWindowDays: Days of trailing spend the annotations cover.
	CostWindowDays int64  `json:"costWindowDays"`
	GeneratedAt    string `json:"generatedAt"`
}

OrphanListResponse is the `OrphanListResponse` schema.

type OrphanedResource added in v0.19.0

type OrphanedResource struct {
	// ID: Infrawrench resource id.
	ID               string   `json:"id"`
	PluginID         PluginID `json:"pluginId"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	DisplayName      string   `json:"displayName"`
	// ExternalID: Provider-native id, when known.
	ExternalID *string `json:"externalId"`
	// Reason: Plugin-authored explanation of why this resource looks wasted.
	Reason       string                   `json:"reason"`
	Cost         *OrphanCostAnnotation    `json:"cost"`
	Owner        *ResourceOwnerAnnotation `json:"owner"`
	LastSyncedAt *string                  `json:"lastSyncedAt"`
}

OrphanedResource is the `OrphanedResource` schema.

type OrphansGetParams added in v0.19.0

type OrphansGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

OrphansGetParams holds the parameters for `client.orphans.get`.

Every field is optional; pass nil to take the defaults.

type OrphansNamespace added in v0.19.0

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

OrphansNamespace is `client.orphans`.

func (*OrphansNamespace) Get added in v0.19.0

Get: List likely-orphaned and idle resources

Scans the organization's already-synced resources against each plugin's declarative orphan heuristics — unattached volumes, unassigned floating/elastic IPs, reserved-but-unused static IPs — and returns the matches grouped by account, each with the plugin's reason. Purely a read over stored state: no provider API calls are made, so results reflect the last sync. Where the org's collected cost data has per-resource rows, matches are annotated with trailing spend.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/orphans

type OversizedAccountGroup added in v0.29.0

type OversizedAccountGroup struct {
	AccountID   string              `json:"accountId"`
	AccountName string              `json:"accountName"`
	PluginID    PluginID            `json:"pluginId"`
	PluginName  string              `json:"pluginName"`
	Resources   []OversizedResource `json:"resources"`
}

OversizedAccountGroup is the `OversizedAccountGroup` schema.

type OversizedResource added in v0.29.0

type OversizedResource struct {
	// ID: Infrawrench resource id.
	ID               string   `json:"id"`
	PluginID         PluginID `json:"pluginId"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	DisplayName      string   `json:"displayName"`
	// ExternalID: Provider-native id, when known.
	ExternalID *string `json:"externalId"`
	// SizeFieldKey: Field to submit through the resource-update endpoint to
	// apply the recommended size.
	SizeFieldKey string `json:"sizeFieldKey"`
	// Region: Provider region/zone/location the resource lives in.
	Region          *string              `json:"region"`
	CurrentSize     OversizedSizeSummary `json:"currentSize"`
	RecommendedSize OversizedSizeSummary `json:"recommendedSize"`
	// CPUP95: p95 CPU utilisation over the window, percent of the current size.
	CPUP95 float64 `json:"cpuP95"`
	// MemoryP95: p95 memory utilisation, percent of the current size; null when
	// unmeasured.
	MemoryP95 *float64 `json:"memoryP95"`
	// MemoryMeasured: False when the provider stores no memory series for this
	// resource.
	MemoryMeasured bool `json:"memoryMeasured"`
	// ProjectedCPUP95: Projected p95 CPU on the recommended size, for the
	// confirm dialog.
	ProjectedCPUP95 float64 `json:"projectedCpuP95"`
	// Currency: ISO 4217 code the size prices are quoted in.
	Currency string `json:"currency"`
	// MonthlySaving: Current minus recommended monthly price; null when either
	// side is unpriced.
	MonthlySaving *float64 `json:"monthlySaving"`
	// ResizeNote: Plugin-authored caveat (e.g. the provider requires the machine
	// stopped).
	ResizeNote   *string `json:"resizeNote"`
	LastSyncedAt *string `json:"lastSyncedAt"`
}

OversizedResource is the `OversizedResource` schema.

type OversizedSizeSummary added in v0.29.0

type OversizedSizeSummary struct {
	ID       string `json:"id"`
	Label    string `json:"label"`
	Vcpus    int64  `json:"vcpus"`
	MemoryMb int64  `json:"memoryMb"`
	// PriceMonthly: Monthly catalog price in `currency`; null when unpriced.
	PriceMonthly *float64 `json:"priceMonthly"`
}

OversizedSizeSummary is the `OversizedSizeSummary` schema.

type OwnerCandidate added in v0.44.0

type OwnerCandidate struct {
	UserID string `json:"userId"`
	// Name: Display name, falling back to the email.
	Name  string `json:"name"`
	Email string `json:"email"`
}

OwnerCandidate is the `OwnerCandidate` schema.

type OwnerCandidateListResponse added in v0.44.0

type OwnerCandidateListResponse struct {
	Members []OwnerCandidate `json:"members"`
}

OwnerCandidateListResponse is the `OwnerCandidateListResponse` schema.

type OwnershipBlocker added in v0.8.0

type OwnershipBlocker struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// MemberCount: People in the organization
	MemberCount int64 `json:"memberCount"`
}

OwnershipBlocker is the `OwnershipBlocker` schema.

type OwnershipDeleteParams added in v0.44.0

type OwnershipDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ResourceID string
}

OwnershipDeleteParams holds the parameters for `client.ownership.delete`.

type OwnershipGetParams added in v0.44.0

type OwnershipGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

OwnershipGetParams holds the parameters for `client.ownership.get`.

Every field is optional; pass nil to take the defaults.

type OwnershipMembersParams added in v0.44.0

type OwnershipMembersParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

OwnershipMembersParams holds the parameters for `client.ownership.members`.

Every field is optional; pass nil to take the defaults.

type OwnershipNamespace added in v0.44.0

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

OwnershipNamespace is `client.ownership`.

func (*OwnershipNamespace) Delete added in v0.44.0

Delete: Clear a resource's ownership

Removes the ownership record. The resource itself is untouched.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/ownership

Raises on 400: Bad request

Raises on 404: Not found

func (*OwnershipNamespace) Get added in v0.44.0

Get: List resource ownership records

Every ownership record in the organization — owner, purpose and authorizing ticket, per resource. Only resources somebody has recorded something about appear; an absent record means the resource is unowned.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/ownership

func (*OwnershipNamespace) Members added in v0.44.0

Members: List people an owner can be set to

Org members, as a minimal id/name/email projection for the owner picker. Requires only `resources:read`, deliberately not `team:read`: recording who owns a resource must not be reserved for whoever can also read roles and membership.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/ownership/members

func (*OwnershipNamespace) Resource added in v0.44.0

Resource: Get one resource's ownership

The ownership record for a single resource, or null when none is recorded.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/ownership/resource

Raises on 400: Bad request

func (*OwnershipNamespace) Update added in v0.44.0

func (n *OwnershipNamespace) Update(ctx context.Context, params *OwnershipUpdateParams, opts ...RequestOption) (any, error)

Update: Set a resource's ownership

Upsert keyed by `resourceId` — ownership is a property of the resource, so there is no separate create and update. Omitted fields keep their value and `null` clears one. Clearing every field removes the record entirely and the response is `null`, which is the new truth rather than an empty record. An `ownerUserId` must be a member of this organization: ownership that looks routable but reaches nobody is worse than none.

_Requires permission: `resources:write`._

PUT /api/org/{orgId}/ownership

Raises on 400: Bad request

Raises on 404: Not found

type OwnershipResourceParams added in v0.44.0

type OwnershipResourceParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ResourceID string
}

OwnershipResourceParams holds the parameters for `client.ownership.resource`.

type OwnershipTransferRequired added in v0.8.0

type OwnershipTransferRequired struct {
	Error string `json:"error"`
	// Code: One of "transfer_ownership_required".
	Code          string             `json:"code"`
	Organizations []OwnershipBlocker `json:"organizations"`
}

OwnershipTransferRequired is the `OwnershipTransferRequired` schema.

type OwnershipUpdateParams added in v0.44.0

type OwnershipUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *ResourceOwnershipPatch
}

OwnershipUpdateParams holds the parameters for `client.ownership.update`.

Every field is optional; pass nil to take the defaults.

type PageClearResponse added in v0.6.0

type PageClearResponse struct {
	// Cleared: False when the key had no cooldown to clear.
	Cleared bool `json:"cleared"`
}

PageClearResponse is the `PageClearResponse` schema.

type PageRequest added in v0.6.0

type PageRequest struct {
	// Source: Stable name for the system raising the page: letters, digits, `.`,
	// `_` and `-`. It is the notification's sender, and it scopes the cooldown —
	// two services paging under the same key never throttle each other.
	Source string `json:"source"`
	// Message: The alert text. Becomes the SMS and notification body.
	Message string `json:"message"`
	// Title: Short headline for the notification. Defaults to `source`.
	Title *string `json:"title,omitempty"`
	// Key: Throttle key, `default` when unset. Pages sharing a key are
	// suppressed while that key is in cooldown, so a per-object key (a host, a
	// cluster id) alerts per object while the default key alerts once for the
	// whole source.
	Key *string `json:"key,omitempty"`
	// CooldownMinutes: Minutes to suppress repeat pages under the same key.
	// Defaults to 60; `0` sends every time.
	CooldownMinutes *int64 `json:"cooldownMinutes,omitempty"`
	// Voice: Also place a voice call to recipients who opted into voice. Off by
	// default — reserve it for things worth waking someone up for.
	Voice *bool `json:"voice,omitempty"`
}

PageRequest is the `PageRequest` schema.

type PageResponse added in v0.6.0

type PageResponse struct {
	// Delivered: True when at least one recipient was reached on any transport.
	Delivered bool `json:"delivered"`
	// Suppressed: True when the key was still in cooldown, so nothing was sent.
	Suppressed bool `json:"suppressed"`
	// Sms: Twilio deliveries (SMS + voice) that Twilio accepted.
	Sms int64 `json:"sms"`
	// Push: Push notifications accepted by Expo.
	Push int64 `json:"push"`
	// Slack: Slack channel posts Slack accepted.
	Slack int64 `json:"slack"`
	// MsTeams: Microsoft Teams webhook posts Teams accepted.
	MsTeams int64 `json:"msTeams"`
	// RetryAt: When suppressed, the time at which this key can page again.
	RetryAt *string `json:"retryAt,omitempty"`
}

PageResponse is the `PageResponse` schema.

type PagesCreateParams added in v0.6.0

type PagesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body PageRequest
}

PagesCreateParams holds the parameters for `client.pages.create`.

type PagesDeleteParams added in v0.6.0

type PagesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Source: Stable name for the system raising the page: letters, digits, `.`,
	// `_` and `-`. It is the notification's sender, and it scopes the cooldown —
	// two services paging under the same key never throttle each other.
	Source string
	// Key: Defaults to `default`.
	Key *string
}

PagesDeleteParams holds the parameters for `client.pages.delete`.

type PagesNamespace added in v0.6.0

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

PagesNamespace is `client.pages`.

func (*PagesNamespace) Create added in v0.6.0

func (n *PagesNamespace) Create(ctx context.Context, params PagesCreateParams, opts ...RequestOption) (*PageResponse, error)

Create: Raise an alert to the organization's on-call transports

Fans an alert out over whatever the org has configured — Twilio SMS (and voice on request), mobile push, Slack channels, and Microsoft Teams webhooks — honouring each recipient's opt-ins. This is the same alert a workflow raises with `infra.page(...)`, for code that runs somewhere Infrawrench does not: a health check, a deploy script, a cron on a box.

Repeat pages under the same `(source, key)` are **suppressed, not rejected**: a monitor that fires every minute pages once and then gets `200` with `suppressed: true` and the `retryAt` at which the key can page again. A page that reached nobody does not start a cooldown, so the next call tries again.

Recipients opt in per channel under the same setting that covers workflow pages.

_Requires permission: `pages:write`._

POST /api/org/{orgId}/pages

Raises on 400: Bad request

func (*PagesNamespace) Delete added in v0.6.0

Delete: Clear a page key's cooldown

Drops the cooldown for one `(source, key)` so the next page under it delivers immediately. Call it when the condition you alerted on recovers — the workflow equivalent is `infra.page.clear(key)`. Clearing a key that was never paged is not an error.

_Requires permission: `pages:write`._

DELETE /api/org/{orgId}/pages

Raises on 400: Bad request

type PeerPane

type PeerPane struct {
	TabLabel      string     `json:"tabLabel"`
	PluginLogoSvg string     `json:"pluginLogoSvg"`
	PeerPluginID  string     `json:"peerPluginId"`
	Schema        JSONObject `json:"schema"`
}

PeerPane is the `PeerPane` schema.

type PeerPaneStub

type PeerPaneStub struct {
	TabLabel      string `json:"tabLabel"`
	PluginLogoSvg string `json:"pluginLogoSvg"`
	PeerPluginID  string `json:"peerPluginId"`
}

PeerPaneStub is the `PeerPaneStub` schema.

type PeerPanesRequest

type PeerPanesRequest struct {
	AccountID        string      `json:"accountId"`
	ResourceID       ResourceID  `json:"resourceId"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

PeerPanesRequest is the `PeerPanesRequest` schema.

type Permission

type Permission = string

Permission: A permission string. Roles may grant exact permissions like the entries in this enum, or wildcards (e.g. `resources:*:read`, `*`).

const (
	PermissionAccountsRead           Permission = "accounts:read"
	PermissionAccountsWrite          Permission = "accounts:write"
	PermissionAccountsDelete         Permission = "accounts:delete"
	PermissionResourcesRead          Permission = "resources:read"
	PermissionResourcesWrite         Permission = "resources:write"
	PermissionResourcesDelete        Permission = "resources:delete"
	PermissionResourcesExecute       Permission = "resources:execute"
	PermissionSecretsRead            Permission = "secrets:read"
	PermissionSecretsWrite           Permission = "secrets:write"
	PermissionStorageRead            Permission = "storage:read"
	PermissionStorageWrite           Permission = "storage:write"
	PermissionDashboardsRead         Permission = "dashboards:read"
	PermissionDashboardsWrite        Permission = "dashboards:write"
	PermissionWorkflowsRead          Permission = "workflows:read"
	PermissionWorkflowsWrite         Permission = "workflows:write"
	PermissionWorkflowsApprove       Permission = "workflows:approve"
	PermissionDeploymentsRead        Permission = "deployments:read"
	PermissionDeploymentsPlan        Permission = "deployments:plan"
	PermissionDeploymentsWrite       Permission = "deployments:write"
	PermissionCostsRead              Permission = "costs:read"
	PermissionCostsWrite             Permission = "costs:write"
	PermissionBudgetsRead            Permission = "budgets:read"
	PermissionBudgetsWrite           Permission = "budgets:write"
	PermissionMetricAlertsRead       Permission = "metric-alerts:read"
	PermissionMetricAlertsWrite      Permission = "metric-alerts:write"
	PermissionFreezesRead            Permission = "freezes:read"
	PermissionFreezesWrite           Permission = "freezes:write"
	PermissionFreezesOverride        Permission = "freezes:override"
	PermissionIncidentsRead          Permission = "incidents:read"
	PermissionIncidentsWrite         Permission = "incidents:write"
	PermissionTagPolicyOverride      Permission = "tag-policy:override"
	PermissionConfigRead             Permission = "config:read"
	PermissionConfigWrite            Permission = "config:write"
	PermissionIacRead                Permission = "iac:read"
	PermissionIacWrite               Permission = "iac:write"
	PermissionAuditRead              Permission = "audit:read"
	PermissionAccessRead             Permission = "access:read"
	PermissionAccessRequest          Permission = "access:request"
	PermissionAccessApprove          Permission = "access:approve"
	PermissionTeamRead               Permission = "team:read"
	PermissionTeamInvite             Permission = "team:invite"
	PermissionTeamRoleWrite          Permission = "team:role:write"
	PermissionTeamRemove             Permission = "team:remove"
	PermissionApikeysRead            Permission = "apikeys:read"
	PermissionApikeysWrite           Permission = "apikeys:write"
	PermissionBillingRead            Permission = "billing:read"
	PermissionBillingWrite           Permission = "billing:write"
	PermissionSSHKeysRead            Permission = "ssh-keys:read"
	PermissionSSHKeysWrite           Permission = "ssh-keys:write"
	PermissionSessionRecordingsRead  Permission = "session-recordings:read"
	PermissionSessionRecordingsWrite Permission = "session-recordings:write"
	PermissionBastionsRead           Permission = "bastions:read"
	PermissionBastionsWrite          Permission = "bastions:write"
	PermissionChatRead               Permission = "chat:read"
	PermissionChatWrite              Permission = "chat:write"
	PermissionJiraRead               Permission = "jira:read"
	PermissionJiraWrite              Permission = "jira:write"
	PermissionLinearRead             Permission = "linear:read"
	PermissionLinearWrite            Permission = "linear:write"
	PermissionInvoicesRead           Permission = "invoices:read"
	PermissionInvoicesWrite          Permission = "invoices:write"
	PermissionInvoicesIssue          Permission = "invoices:issue"
	PermissionPagesWrite             Permission = "pages:write"
	PermissionOrgSettingsWrite       Permission = "org:settings:write"
)

The values Permission takes.

type PermissionCatalog

type PermissionCatalog struct {
	Permissions []Permission `json:"permissions"`
}

PermissionCatalog is the `PermissionCatalog` schema.

type PickerResource

type PickerResource struct {
	ID             ResourceID `json:"id"`
	Label          string     `json:"label"`
	PluginID       string     `json:"pluginId"`
	ResourceTypeID string     `json:"resourceTypeId"`
	AccountID      string     `json:"accountId"`
	OutputKey      string     `json:"outputKey"`
	OutputValue    string     `json:"outputValue"`
}

PickerResource is the `PickerResource` schema.

type PickerResourcesRequest

type PickerResourcesRequest struct {
	Sources      []PickerResourcesRequestSources `json:"sources"`
	AccountID    string                          `json:"accountId"`
	RegionHint   *string                         `json:"regionHint,omitempty"`
	CrossAccount *bool                           `json:"crossAccount,omitempty"`
}

PickerResourcesRequest is the `PickerResourcesRequest` schema.

type PickerResourcesRequestSources

type PickerResourcesRequestSources struct {
	PluginID       string `json:"pluginId"`
	ResourceTypeID string `json:"resourceTypeId"`
	OutputKey      string `json:"outputKey"`
}

PickerResourcesRequestSources is an object the spec declares inline.

type PinFull

type PinFull struct {
	PinID             string      `json:"pinId"`
	ResourceID        ResourceID  `json:"resourceId"`
	GridX             int64       `json:"gridX"`
	GridY             int64       `json:"gridY"`
	GridW             int64       `json:"gridW"`
	GridH             int64       `json:"gridH"`
	DisplayName       string      `json:"displayName"`
	PluginID          string      `json:"pluginId"`
	ResourceTypeID    string      `json:"resourceTypeId"`
	AccountID         string      `json:"accountId"`
	FieldsJSON        JSONObject  `json:"fieldsJson"`
	OutputsJSON       JSONObject  `json:"outputsJson"`
	PluginLogoSvg     string      `json:"pluginLogoSvg"`
	PluginDisplayName string      `json:"pluginDisplayName"`
	Status            ProbeStatus `json:"status"`
}

PinFull is the `PinFull` schema.

type PinRangeMetricSeries

type PinRangeMetricSeries struct {
	Label  string                       `json:"label"`
	Unit   *string                      `json:"unit,omitempty"`
	Points []PinRangeMetricSeriesPoints `json:"points"`
}

PinRangeMetricSeries is the `PinRangeMetricSeries` schema.

type PinRangeMetricSeriesPoints

type PinRangeMetricSeriesPoints struct {
	Timestamp float64 `json:"timestamp"`
	Value     float64 `json:"value"`
}

PinRangeMetricSeriesPoints is an object the spec declares inline.

type PinRangeResponse

type PinRangeResponse struct {
	Series []PinRangeMetricSeries `json:"series"`
}

PinRangeResponse is the `PinRangeResponse` schema.

type PinRequest

type PinRequest struct {
	DashboardID string     `json:"dashboardId"`
	ResourceID  ResourceID `json:"resourceId"`
	GridX       *int64     `json:"gridX,omitempty"`
	GridY       *int64     `json:"gridY,omitempty"`
}

PinRequest is the `PinRequest` schema.

type PluginID

type PluginID = string

PluginID: Manifest id of an installed plugin.

Spec schema: `PluginId`.

const (
	PluginIDAnthropic    PluginID = "anthropic"
	PluginIDAssemblyai   PluginID = "assemblyai"
	PluginIDAWS          PluginID = "aws"
	PluginIDAzure        PluginID = "azure"
	PluginIDCartesia     PluginID = "cartesia"
	PluginIDClickhouse   PluginID = "clickhouse"
	PluginIDCloudflare   PluginID = "cloudflare"
	PluginIDCloudinary   PluginID = "cloudinary"
	PluginIDCohere       PluginID = "cohere"
	PluginIDDatabricks   PluginID = "databricks"
	PluginIDDeepgram     PluginID = "deepgram"
	PluginIDDeepseek     PluginID = "deepseek"
	PluginIDDigitalocean PluginID = "digitalocean"
	PluginIDDocker       PluginID = "docker"
	PluginIDElevenlabs   PluginID = "elevenlabs"
	PluginIDFireworks    PluginID = "fireworks"
	PluginIDFly          PluginID = "fly"
	PluginIDGCP          PluginID = "gcp"
	PluginIDGemini       PluginID = "gemini"
	PluginIDGladia       PluginID = "gladia"
	PluginIDGroq         PluginID = "groq"
	PluginIDHetzner      PluginID = "hetzner"
	PluginIDKafka        PluginID = "kafka"
	PluginIDKubernetes   PluginID = "kubernetes"
	PluginIDMemcached    PluginID = "memcached"
	PluginIDMistral      PluginID = "mistral"
	PluginIDMongodb      PluginID = "mongodb"
	PluginIDMssql        PluginID = "mssql"
	PluginIDMysql        PluginID = "mysql"
	PluginIDNeon         PluginID = "neon"
	PluginIDNetlify      PluginID = "netlify"
	PluginIDOpenai       PluginID = "openai"
	PluginIDOpenrouter   PluginID = "openrouter"
	PluginIDOpensearch   PluginID = "opensearch"
	PluginIDOVH          PluginID = "ovh"
	PluginIDPlanetscale  PluginID = "planetscale"
	PluginIDPostgres     PluginID = "postgres"
	PluginIDRedis        PluginID = "redis"
	PluginIDReplicate    PluginID = "replicate"
	PluginIDRevai        PluginID = "revai"
	PluginIDScaleway     PluginID = "scaleway"
	PluginIDSpeechmatics PluginID = "speechmatics"
	PluginIDSSH          PluginID = "ssh"
	PluginIDTogether     PluginID = "together"
	PluginIDTurso        PluginID = "turso"
	PluginIDUploadthing  PluginID = "uploadthing"
	PluginIDVercel       PluginID = "vercel"
	PluginIDWorkos       PluginID = "workos"
	PluginIDXai          PluginID = "xai"
)

The values PluginID takes.

type PluginSummary

type PluginSummary struct {
	ID               string                `json:"id"`
	DisplayName      string                `json:"displayName"`
	LogoSvg          string                `json:"logoSvg"`
	CredentialFields []CredentialField     `json:"credentialFields"`
	Preflight        *PreflightDeclaration `json:"preflight"`
}

PluginSummary is the `PluginSummary` schema.

type PolicyTemplate added in v0.30.0

type PolicyTemplate struct {
	FormatLabel string `json:"formatLabel"`
	// Language: One of "json", "yaml", "text".
	Language     string                  `json:"language"`
	Document     string                  `json:"document"`
	Instructions *string                 `json:"instructions,omitempty"`
	HelpLink     *PolicyTemplateHelpLink `json:"helpLink,omitempty"`
}

PolicyTemplate is the `PolicyTemplate` schema.

type PolicyTemplateHelpLink struct {
	Label string `json:"label"`
	URL   string `json:"url"`
}

PolicyTemplateHelpLink is an object the spec declares inline.

type PolicyTemplateResponse added in v0.30.0

type PolicyTemplateResponse struct {
	Template PolicyTemplate `json:"template"`
}

PolicyTemplateResponse is the `PolicyTemplateResponse` schema.

type PostureAlertSettings added in v0.33.0

type PostureAlertSettings struct {
	// Enabled: Whether the poller sends posture alerts for this organization at
	// all.
	Enabled bool `json:"enabled"`
	// LastNotifiedAt: When the organization's posture alert scan last completed,
	// or null before the first. Owned by the poller's cooldown claim; not
	// writable through this API.
	LastNotifiedAt *string `json:"lastNotifiedAt"`
}

PostureAlertSettings is the `PostureAlertSettings` schema.

type PostureAlertSettingsUpdate added in v0.33.0

type PostureAlertSettingsUpdate struct {
	Enabled *bool `json:"enabled,omitempty"`
}

PostureAlertSettingsUpdate is the `PostureAlertSettingsUpdate` schema.

type PostureDismissal added in v0.43.0

type PostureDismissal struct {
	ResourceID string `json:"resourceId"`
	RuleID     string `json:"ruleId"`
	// DismissedAt: When the finding was accepted.
	DismissedAt string `json:"dismissedAt"`
	// DismissedBy: Display name or email of whoever accepted it; null when
	// unknown.
	DismissedBy *string `json:"dismissedBy"`
	// Reason: The operator's note, when they left one.
	Reason *string `json:"reason"`
}

PostureDismissal is the `PostureDismissal` schema.

type PostureDismissalCreate added in v0.43.0

type PostureDismissalCreate struct {
	// ResourceID: Infrawrench resource id the finding is on.
	ResourceID string `json:"resourceId"`
	// RuleID: The matched rule's id.
	RuleID string `json:"ruleId"`
	// Reason: Why this finding is acceptable. Trimmed; an empty note is stored
	// as none.
	Reason *string `json:"reason,omitempty"`
}

PostureDismissalCreate is the `PostureDismissalCreate` schema.

type PostureDismissalsCreateParams added in v0.43.0

type PostureDismissalsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *PostureDismissalCreate
}

PostureDismissalsCreateParams holds the parameters for `client.posture.dismissals.create`.

Every field is optional; pass nil to take the defaults.

type PostureDismissalsDeleteParams added in v0.43.0

type PostureDismissalsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ResourceID: Infrawrench resource id the finding is on.
	ResourceID string
	// RuleID: The matched rule's id.
	RuleID string
}

PostureDismissalsDeleteParams holds the parameters for `client.posture.dismissals.delete`.

type PostureDismissalsNamespace added in v0.43.0

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

PostureDismissalsNamespace is `client.posture.dismissals`.

func (*PostureDismissalsNamespace) Create added in v0.43.0

Create: Dismiss a posture finding

Accept a finding — the bucket really is meant to be public, the key really is rotated out of band. The finding leaves `findings` and stops feeding the daily posture alerts, but the rule keeps being evaluated and the finding is reported back under `dismissed` for as long as it still matches. Idempotent: dismissing an already-dismissed finding rewrites the note and the author.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/posture/dismissals

Raises on 400: Bad request

func (*PostureDismissalsNamespace) Delete added in v0.43.0

Delete: Restore a dismissed posture finding

Undo a dismissal, putting the finding back on the list and back into the alert feed. The finding is identified by query parameters rather than path segments because resource ids are provider-native and routinely contain slashes.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/posture/dismissals

Raises on 400: Bad request

Raises on 404: Not found

type PostureFinding added in v0.33.0

type PostureFinding struct {
	// ResourceID: Infrawrench resource id.
	ResourceID       string   `json:"resourceId"`
	PluginID         PluginID `json:"pluginId"`
	PluginName       string   `json:"pluginName"`
	ResourceTypeID   string   `json:"resourceTypeId"`
	ResourceTypeName string   `json:"resourceTypeName"`
	AccountID        string   `json:"accountId"`
	AccountName      string   `json:"accountName"`
	DisplayName      string   `json:"displayName"`
	// ExternalID: Provider-native id, when known.
	ExternalID *string `json:"externalId"`
	// RuleID: The matched rule's stable id, unique within the plugin.
	RuleID string `json:"ruleId"`
	// Title: Short rule title.
	Title string `json:"title"`
	// Severity: How bad the finding is. `critical` and `high` findings feed the
	// posture alerts; `medium` and `low` are hygiene work surfaced on the
	// posture screen only.
	//
	// One of "critical", "high", "medium", "low".
	Severity string `json:"severity"`
	// Category: Grouping bucket for what kind of exposure the finding describes.
	//
	// One of "public-exposure", "encryption", "credential-age",
	// "data-protection", "other".
	Category string `json:"category"`
	// Reason: Plugin-authored explanation of why this is a finding.
	Reason string `json:"reason"`
}

PostureFinding is the `PostureFinding` schema.

type PostureGetParams added in v0.33.0

type PostureGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

PostureGetParams holds the parameters for `client.posture.get`.

Every field is optional; pass nil to take the defaults.

type PostureListResponse added in v0.33.0

type PostureListResponse struct {
	// Findings: Live findings, worst severity first. Dismissed findings are not
	// included.
	Findings []PostureFinding `json:"findings"`
	// TotalCount: Live finding count; dismissals excluded.
	TotalCount int64                 `json:"totalCount"`
	Counts     PostureSeverityCounts `json:"counts"`
	// Dismissed: Findings a dismissal is currently suppressing, most recently
	// dismissed first. Only dismissals whose rule still matches appear, so a
	// finding that has since been fixed simply drops out.
	Dismissed      []DismissedPostureFinding `json:"dismissed"`
	DismissedCount int64                     `json:"dismissedCount"`
	GeneratedAt    string                    `json:"generatedAt"`
}

PostureListResponse is the `PostureListResponse` schema.

type PostureNamespace added in v0.33.0

type PostureNamespace struct {

	// Dismissals: `client.posture.dismissals`.
	Dismissals *PostureDismissalsNamespace
	// Settings: `client.posture.settings`.
	Settings *PostureSettingsNamespace
	// contains filtered or unexported fields
}

PostureNamespace is `client.posture`.

func (*PostureNamespace) Get added in v0.33.0

Get: List security posture findings on synced resources

Plugin-declared security checks evaluated over already-synced resource state: public buckets, 0.0.0.0/0 ingress rules, unencrypted disks, publicly reachable database endpoints, stale credentials, missing deletion/backup protection. No provider API calls are made and results reflect the last sync. Findings are sorted worst severity first, with per-severity counts. Findings the organization has dismissed are reported separately under `dismissed` and are excluded from `findings`, `counts` and the posture alerts.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/posture

type PostureSettingsGetParams added in v0.33.0

type PostureSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

PostureSettingsGetParams holds the parameters for `client.posture.settings.get`.

Every field is optional; pass nil to take the defaults.

type PostureSettingsNamespace added in v0.33.0

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

PostureSettingsNamespace is `client.posture.settings`.

func (*PostureSettingsNamespace) Get added in v0.33.0

Get: Get the organization's posture alert settings

Whether the poller's daily posture alert scan is enabled. An organization that never saved reads the shipped defaults (enabled).

_Requires permission: `org:settings:write`._

GET /api/org/{orgId}/posture/settings

func (*PostureSettingsNamespace) Update added in v0.33.0

Update: Update the posture alert settings

Saving never resets the alert cooldown.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/posture/settings

Raises on 400: Bad request

type PostureSettingsUpdateParams added in v0.33.0

type PostureSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *PostureAlertSettingsUpdate
}

PostureSettingsUpdateParams holds the parameters for `client.posture.settings.update`.

Every field is optional; pass nil to take the defaults.

type PostureSeverityCounts added in v0.33.0

type PostureSeverityCounts struct {
	Critical int64 `json:"critical"`
	High     int64 `json:"high"`
	Medium   int64 `json:"medium"`
	Low      int64 `json:"low"`
}

PostureSeverityCounts: Live finding count per severity; every bucket present, zeros included.

type PreflightCapability added in v0.30.0

type PreflightCapability struct {
	ID                  string                `json:"id"`
	Label               string                `json:"label"`
	Description         *string               `json:"description,omitempty"`
	RequiredPermissions []PreflightPermission `json:"requiredPermissions"`
	Essential           *bool                 `json:"essential,omitempty"`
}

PreflightCapability is the `PreflightCapability` schema.

type PreflightCheck added in v0.30.0

type PreflightCheck struct {
	CapabilityID string `json:"capabilityId"`
	// Status: One of "ok", "missing", "unknown".
	Status             string                  `json:"status"`
	MissingPermissions []PreflightPermission   `json:"missingPermissions"`
	Message            *string                 `json:"message"`
	HelpLink           *PreflightCheckHelpLink `json:"helpLink"`
}

PreflightCheck is the `PreflightCheck` schema.

type PreflightCheckHelpLink struct {
	Label string `json:"label"`
	URL   string `json:"url"`
}

PreflightCheckHelpLink is an object the spec declares inline.

type PreflightDeclaration added in v0.30.0

type PreflightDeclaration struct {
	Capabilities   []PreflightCapability               `json:"capabilities"`
	TemplateFormat *PreflightDeclarationTemplateFormat `json:"templateFormat,omitempty"`
}

PreflightDeclaration: Declared when the plugin supports credential preflight (per-capability permission checks). `null` for plugins without it.

The API may send null in its place.

type PreflightDeclarationTemplateFormat added in v0.30.0

type PreflightDeclarationTemplateFormat struct {
	Label string `json:"label"`
	// Language: One of "json", "yaml", "text".
	Language string `json:"language"`
}

PreflightDeclarationTemplateFormat is an object the spec declares inline.

type PreflightPermission added in v0.30.0

type PreflightPermission struct {
	// ID: Provider-native permission string, e.g. `ce:GetCostAndUsage`.
	ID    string `json:"id"`
	Label string `json:"label"`
}

PreflightPermission is the `PreflightPermission` schema.

type PreflightReport added in v0.30.0

type PreflightReport struct {
	PluginID  string `json:"pluginId"`
	Supported bool   `json:"supported"`
	// Identity: Provider-side identity the credential resolved to (ARN, service
	// account…).
	Identity *string          `json:"identity"`
	Checks   []PreflightCheck `json:"checks"`
}

PreflightReport is the `PreflightReport` schema.

type PreflightRequest added in v0.30.0

type PreflightRequest struct {
	PluginID    string            `json:"pluginId"`
	Credentials map[string]string `json:"credentials"`
	// BastionID: Probe through this bastion, matching how the account will
	// egress once created.
	BastionID *string `json:"bastionId,omitempty"`
}

PreflightRequest is the `PreflightRequest` schema.

type ProbeMetricSeries added in v0.33.0

type ProbeMetricSeries struct {
	// Label: "Latency" (ms) or "Up" (1/0).
	Label  string                    `json:"label"`
	Unit   *string                   `json:"unit,omitempty"`
	Points []ProbeMetricSeriesPoints `json:"points"`
}

ProbeMetricSeries is the `ProbeMetricSeries` schema.

type ProbeMetricSeriesPoints added in v0.33.0

type ProbeMetricSeriesPoints struct {
	// Timestamp: Unix epoch milliseconds.
	Timestamp float64 `json:"timestamp"`
	Value     float64 `json:"value"`
}

ProbeMetricSeriesPoints is an object the spec declares inline.

type ProbeMetrics added in v0.33.0

type ProbeMetrics struct {
	Series []ProbeMetricSeries `json:"series"`
}

ProbeMetrics is the `ProbeMetrics` schema.

type ProbeRequest

type ProbeRequest struct {
	Items []ProbeRequestItems `json:"items"`
}

ProbeRequest is the `ProbeRequest` schema.

type ProbeRequestItems

type ProbeRequestItems struct {
	ResourceID     ResourceID `json:"resourceId"`
	AccountID      string     `json:"accountId"`
	PluginID       string     `json:"pluginId"`
	ResourceTypeID string     `json:"resourceTypeId"`
}

ProbeRequestItems is an object the spec declares inline.

type ProbeStatus

type ProbeStatus struct {
	// Phase: One of "ok", "error".
	Phase          string                      `json:"phase"`
	Error          *string                     `json:"error,omitempty"`
	Stats          []JSONObject                `json:"stats,omitempty"`
	Sparkline      []ProbeStatusSparkline      `json:"sparkline,omitempty"`
	SparklineLabel *string                     `json:"sparklineLabel,omitempty"`
	ResourceCounts []ProbeStatusResourceCounts `json:"resourceCounts,omitempty"`
}

ProbeStatus is the `ProbeStatus` schema.

type ProbeStatusResourceCounts

type ProbeStatusResourceCounts struct {
	TypeLabel string `json:"typeLabel"`
	Count     int64  `json:"count"`
}

ProbeStatusResourceCounts is an object the spec declares inline.

type ProbeStatusSparkline

type ProbeStatusSparkline struct {
	// Timestamp: Unix epoch milliseconds.
	Timestamp float64 `json:"timestamp"`
	Value     float64 `json:"value"`
}

ProbeStatusSparkline is an object the spec declares inline.

type ProbeSuggestion added in v0.33.0

type ProbeSuggestion struct {
	// URL: Normalized to an absolute URL — bare hosts get https://.
	URL            string   `json:"url"`
	ResourceID     string   `json:"resourceId"`
	DisplayName    string   `json:"displayName"`
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	AccountID      string   `json:"accountId"`
	// OutputKey: The output/field key the URL was mined from.
	OutputKey string `json:"outputKey"`
}

ProbeSuggestion is the `ProbeSuggestion` schema.

type ProbeSuggestions added in v0.33.0

type ProbeSuggestions struct {
	Suggestions []ProbeSuggestion `json:"suggestions"`
}

ProbeSuggestions is the `ProbeSuggestions` schema.

type ProbesCreateParams added in v0.33.0

type ProbesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *SyntheticProbeCreate
}

ProbesCreateParams holds the parameters for `client.probes.create`.

Every field is optional; pass nil to take the defaults.

type ProbesDeleteParams added in v0.33.0

type ProbesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	ProbeID string
}

ProbesDeleteParams holds the parameters for `client.probes.delete`.

type ProbesGetParams added in v0.33.0

type ProbesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

ProbesGetParams holds the parameters for `client.probes.get`.

Every field is optional; pass nil to take the defaults.

type ProbesMetricsParams added in v0.33.0

type ProbesMetricsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	ProbeID string
	// StartMs: Range start, Unix epoch ms.
	StartMs *string
	// EndMs: Range end, Unix epoch ms.
	EndMs *string
}

ProbesMetricsParams holds the parameters for `client.probes.metrics`.

type ProbesNamespace added in v0.33.0

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

ProbesNamespace is `client.probes`.

func (*ProbesNamespace) Create added in v0.33.0

Create: Create a probe

Point an uptime/latency check at an endpoint. Numeric inputs are clamped into their allowed ranges rather than rejected; the first check runs within one poller tick. Audit-logged.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/probes

Raises on 400: Bad request

Raises on 404: Not found

func (*ProbesNamespace) Delete added in v0.33.0

func (n *ProbesNamespace) Delete(ctx context.Context, params ProbesDeleteParams, opts ...RequestOption) error

Delete: Delete a probe

Remove the probe. Recorded series age out of the metric store. Audit-logged.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/probes/{probeId}

Raises on 404: Not found

func (*ProbesNamespace) Get added in v0.33.0

Get: List synthetic probes

Every probe in the organization with its live status, consecutive-failure count, last latency and trailing-24h uptime. Probes run on an interval from an edge proxy outside the cluster, so results reflect what an internet client would see.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/probes

func (*ProbesNamespace) Metrics added in v0.33.0

func (n *ProbesNamespace) Metrics(ctx context.Context, params ProbesMetricsParams, opts ...RequestOption) (*ProbeMetrics, error)

Metrics: Read a probe's recorded series

The "Latency" (ms) and "Up" (1/0) series over a time range, from the shared metric store. Resolution auto-selects raw/1-minute/1-hour rollups by span. Defaults to the trailing 24 hours.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/probes/{probeId}/metrics

Raises on 400: Bad request

Raises on 404: Not found

Raises on 503: A backing service this endpoint depends on is not available

func (*ProbesNamespace) Suggestions added in v0.33.0

Suggestions: Suggest endpoints from synced resources

Endpoint candidates mined from the organization's synced resource outputs and fields (keys like url, endpoint, host, domain, publicIp). A cheap read over stored state — no provider API calls. Deduplicated by URL.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/probes/suggestions

func (*ProbesNamespace) Update added in v0.33.0

Update: Update or disable a probe

Edit settings and/or toggle `enabled`. Changing the URL or method resets the probe's state to `unknown` — the history belongs to the old endpoint. Audit-logged.

_Requires permission: `resources:write`._

PUT /api/org/{orgId}/probes/{probeId}

Raises on 400: Bad request

Raises on 404: Not found

type ProbesSuggestionsParams added in v0.33.0

type ProbesSuggestionsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

ProbesSuggestionsParams holds the parameters for `client.probes.suggestions`.

Every field is optional; pass nil to take the defaults.

type ProbesUpdateParams added in v0.33.0

type ProbesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID   *string
	ProbeID string
	// Body: the JSON request body.
	Body *SyntheticProbeUpdate
}

ProbesUpdateParams holds the parameters for `client.probes.update`.

type Profile

type Profile struct {
	ID                string  `json:"id"`
	Email             string  `json:"email"`
	EmailVerified     bool    `json:"emailVerified"`
	FirstName         *string `json:"firstName"`
	LastName          *string `json:"lastName"`
	ProfilePictureURL *string `json:"profilePictureUrl"`
	LastSignInAt      *string `json:"lastSignInAt"`
	CreatedAt         string  `json:"createdAt"`
	// Identities: Connected OAuth accounts, if any
	Identities []ProfileIdentities `json:"identities"`
}

Profile is the `Profile` schema.

type ProfileEmailChangeConfirmParams

type ProfileEmailChangeConfirmParams struct {
	// Body: the JSON request body.
	Body *ProfileEmailChangeConfirmRequest
}

ProfileEmailChangeConfirmParams holds the parameters for `client.profile.emailChange.confirm`.

Every field is optional; pass nil to take the defaults.

type ProfileEmailChangeConfirmRequest

type ProfileEmailChangeConfirmRequest struct {
	Code string `json:"code"`
}

ProfileEmailChangeConfirmRequest is an object the spec declares inline.

type ProfileEmailChangeConfirmResponse

type ProfileEmailChangeConfirmResponse struct {
	Email string `json:"email"`
}

ProfileEmailChangeConfirmResponse is an object the spec declares inline.

type ProfileEmailChangeCreateParams

type ProfileEmailChangeCreateParams struct {
	// Body: the JSON request body.
	Body *ProfileEmailChangeCreateRequest
}

ProfileEmailChangeCreateParams holds the parameters for `client.profile.emailChange.create`.

Every field is optional; pass nil to take the defaults.

type ProfileEmailChangeCreateRequest

type ProfileEmailChangeCreateRequest struct {
	NewEmail string `json:"newEmail"`
}

ProfileEmailChangeCreateRequest is an object the spec declares inline.

type ProfileEmailChangeCreateResponse

type ProfileEmailChangeCreateResponse struct {
	NewEmail  string `json:"newEmail"`
	ExpiresAt string `json:"expiresAt"`
}

ProfileEmailChangeCreateResponse is an object the spec declares inline.

type ProfileEmailChangeNamespace

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

ProfileEmailChangeNamespace is `client.profile.emailChange`.

func (*ProfileEmailChangeNamespace) Confirm

Confirm: Redeem an email change code

On success the account's email is the new address and it is marked verified.

POST /api/profile/email-change/confirm

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 403: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

func (*ProfileEmailChangeNamespace) Create

Create: Send a confirmation code to a new email address

Starts an email change. The code goes to the new address and the account keeps its current address until `/api/profile/email-change/confirm` redeems it, so an abandoned or mistyped change is harmless.

POST /api/profile/email-change

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 403: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

type ProfileIdentities

type ProfileIdentities struct {
	// Provider: WorkOS OAuth provider id
	Provider string `json:"provider"`
}

ProfileIdentities is an object the spec declares inline.

type ProfileMFAChallengeParams

type ProfileMFAChallengeParams struct {
	FactorID string
}

ProfileMFAChallengeParams holds the parameters for `client.profile.mfa.challenge`.

type ProfileMFADeleteParams

type ProfileMFADeleteParams struct {
	FactorID string
}

ProfileMFADeleteParams holds the parameters for `client.profile.mfa.delete`.

type ProfileMFANamespace

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

ProfileMFANamespace is `client.profile.mfa`.

func (*ProfileMFANamespace) Challenge

Challenge: Issue a fresh challenge for a factor

POST /api/profile/mfa/{factorId}/challenge

Raises on 401: Unauthenticated

Raises on 404: Not found

func (*ProfileMFANamespace) Create

Create: Begin TOTP enrolment

Creates the factor and a first challenge. The factor only becomes usable once a code is verified; abandon the flow by DELETEing the returned `factorId`.

POST /api/profile/mfa

Raises on 401: Unauthenticated

Raises on 403: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

func (*ProfileMFANamespace) Delete

func (n *ProfileMFANamespace) Delete(ctx context.Context, params ProfileMFADeleteParams, opts ...RequestOption) (*OK, error)

Delete: Remove an authentication factor

DELETE /api/profile/mfa/{factorId}

Raises on 401: Unauthenticated

Raises on 403: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

Raises on 404: Not found

func (*ProfileMFANamespace) List

func (n *ProfileMFANamespace) List(ctx context.Context, opts ...RequestOption) ([]AuthFactor, error)

List: List enrolled authentication factors

Includes factors whose enrolment was never confirmed — WorkOS does not expose a verified flag.

GET /api/profile/mfa

Raises on 401: Unauthenticated

func (*ProfileMFANamespace) Verify

Verify: Verify a code against a challenge

POST /api/profile/mfa/{factorId}/verify

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 404: Not found

type ProfileMFAVerifyParams

type ProfileMFAVerifyParams struct {
	FactorID string
	// Body: the JSON request body.
	Body *ProfileMfaverifyRequest
}

ProfileMFAVerifyParams holds the parameters for `client.profile.mfa.verify`.

type ProfileMfachallengeResponse

type ProfileMfachallengeResponse struct {
	ChallengeID string `json:"challengeId"`
}

ProfileMfachallengeResponse is an object the spec declares inline.

type ProfileMfaverifyRequest

type ProfileMfaverifyRequest struct {
	ChallengeID string `json:"challengeId"`
	Code        string `json:"code"`
}

ProfileMfaverifyRequest is an object the spec declares inline.

type ProfileMfaverifyResponse

type ProfileMfaverifyResponse struct {
	Verified bool `json:"verified"`
}

ProfileMfaverifyResponse is an object the spec declares inline.

type ProfileNamespace

type ProfileNamespace struct {

	// EmailChange: `client.profile.emailChange`.
	EmailChange *ProfileEmailChangeNamespace
	// MFA: `client.profile.mfa`.
	MFA *ProfileMFANamespace
	// Sessions: `client.profile.sessions`.
	Sessions *ProfileSessionsNamespace
	// contains filtered or unexported fields
}

ProfileNamespace is `client.profile`.

func (*ProfileNamespace) Delete added in v0.8.0

func (n *ProfileNamespace) Delete(ctx context.Context, opts ...RequestOption) (*AccountDeleted, error)

Delete: Delete the signed-in user's account

Irreversible. Organizations where the caller is the only member are deleted and their subscriptions cancelled; other memberships are simply removed. Refuses with `transfer_ownership_required` while the caller is the only owner of an organization other people belong to.

DELETE /api/profile

Raises on 401: Unauthenticated

Raises on 403: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

Raises on 409: The caller still solely owns a shared organization; nothing was deleted.

Raises on 502: A subscription could not be cancelled; nothing was deleted.

func (*ProfileNamespace) DeletionPreview added in v0.8.0

func (n *ProfileNamespace) DeletionPreview(ctx context.Context, opts ...RequestOption) (*AccountDeletionPreview, error)

DeletionPreview: What deleting this account would do

Read-only. Lets a confirmation screen name the organizations that go with the account, and the ones that must be handed over first.

GET /api/profile/deletion-preview

Raises on 401: Unauthenticated

func (*ProfileNamespace) Get

func (n *ProfileNamespace) Get(ctx context.Context, opts ...RequestOption) (*Profile, error)

Get: The signed-in user's account profile

User-scoped, not organization-scoped: one WorkOS identity is shared across every organization the user belongs to.

GET /api/profile

Raises on 401: Unauthenticated

func (*ProfileNamespace) PasswordReset

PasswordReset: Mint a password reset link for the signed-in user

Returns a one-time AuthKit-hosted reset URL rather than emailing it — the caller already holds a valid session for the account. Also the way to set a first password on an SSO or OAuth-only account.

POST /api/profile/password-reset

Raises on 401: Unauthenticated

Raises on 403: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

func (*ProfileNamespace) SendVerificationEmail

func (n *ProfileNamespace) SendVerificationEmail(ctx context.Context, opts ...RequestOption) (*OK, error)

SendVerificationEmail: Re-send the email verification message

POST /api/profile/send-verification-email

Raises on 400: Bad request

Raises on 401: Unauthenticated

func (*ProfileNamespace) Update

Update: Update the signed-in user's name

PATCH /api/profile

Raises on 400: Bad request

Raises on 401: Unauthenticated

type ProfilePasswordResetResponse

type ProfilePasswordResetResponse struct {
	PasswordResetURL string `json:"passwordResetUrl"`
	ExpiresAt        string `json:"expiresAt"`
}

ProfilePasswordResetResponse is an object the spec declares inline.

type ProfileSessionsDeleteParams

type ProfileSessionsDeleteParams struct {
	SessionID string
}

ProfileSessionsDeleteParams holds the parameters for `client.profile.sessions.delete`.

type ProfileSessionsNamespace

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

ProfileSessionsNamespace is `client.profile.sessions`.

func (*ProfileSessionsNamespace) Delete

Delete: Revoke one session

Refuses the session making the request — use sign-out for that.

DELETE /api/profile/sessions/{sessionId}

Raises on 400: Bad request

Raises on 401: Unauthenticated

Raises on 404: Not found

func (*ProfileSessionsNamespace) List

List: List the signed-in user's active sessions

GET /api/profile/sessions

Raises on 401: Unauthenticated

func (*ProfileSessionsNamespace) RevokeOthers

RevokeOthers: Revoke every session except the current one

POST /api/profile/sessions/revoke-others

Raises on 401: Unauthenticated

Raises on 403: Recent sign-in required. Send the user through sign-in again and retry; the request itself was well-formed.

type ProfileSessionsRevokeOthersResponse

type ProfileSessionsRevokeOthersResponse struct {
	Revoked int64 `json:"revoked"`
}

ProfileSessionsRevokeOthersResponse is an object the spec declares inline.

type ProfileSummary

type ProfileSummary struct {
	ID                string  `json:"id"`
	Email             string  `json:"email"`
	EmailVerified     bool    `json:"emailVerified"`
	FirstName         *string `json:"firstName"`
	LastName          *string `json:"lastName"`
	ProfilePictureURL *string `json:"profilePictureUrl"`
	LastSignInAt      *string `json:"lastSignInAt"`
	CreatedAt         string  `json:"createdAt"`
}

ProfileSummary is the `ProfileSummary` schema.

type ProfileUpdateParams

type ProfileUpdateParams struct {
	// Body: the JSON request body.
	Body *ProfileUpdateRequest
}

ProfileUpdateParams holds the parameters for `client.profile.update`.

Every field is optional; pass nil to take the defaults.

type ProfileUpdateRequest

type ProfileUpdateRequest struct {
	FirstName *string `json:"firstName,omitempty"`
	LastName  *string `json:"lastName,omitempty"`
}

ProfileUpdateRequest is an object the spec declares inline.

type ProviderIncidentImpact added in v0.29.0

type ProviderIncidentImpact = string

ProviderIncidentImpact: Normalized incident severity, least to most severe.

const (
	ProviderIncidentImpactMaintenance ProviderIncidentImpact = "maintenance"
	ProviderIncidentImpactMinor       ProviderIncidentImpact = "minor"
	ProviderIncidentImpactMajor       ProviderIncidentImpact = "major"
	ProviderIncidentImpactCritical    ProviderIncidentImpact = "critical"
)

The values ProviderIncidentImpact takes.

type ProviderIncidentResourceSample added in v0.29.0

type ProviderIncidentResourceSample struct {
	// ID: Resource id.
	ID             string `json:"id"`
	DisplayName    string `json:"displayName"`
	ResourceTypeID string `json:"resourceTypeId"`
	// Region: The resource's region field, when it has one.
	Region *string `json:"region,omitempty"`
}

ProviderIncidentResourceSample is the `ProviderIncidentResourceSample` schema.

type ProviderIncidentState added in v0.29.0

type ProviderIncidentState = string

ProviderIncidentState: Normalized incident lifecycle state as the provider reports it.

const (
	ProviderIncidentStateInvestigating ProviderIncidentState = "investigating"
	ProviderIncidentStateIdentified    ProviderIncidentState = "identified"
	ProviderIncidentStateMonitoring    ProviderIncidentState = "monitoring"
	ProviderIncidentStateResolved      ProviderIncidentState = "resolved"
)

The values ProviderIncidentState takes.

type PublicStatusComponent added in v0.44.0

type PublicStatusComponent struct {
	// ID: Stable per page. Deliberately not the probe id.
	ID        string  `json:"id"`
	Name      string  `json:"name"`
	GroupName *string `json:"groupName"`
	// State: A component's public state. A paused probe reads `unknown`
	// regardless of its last result — the page is a claim about what is being
	// checked now.
	//
	// One of "operational", "degraded", "down", "unknown".
	State     string   `json:"state"`
	Uptime24h *float64 `json:"uptime24h"`
	// History: Oldest first; empty when history is hidden.
	History []StatusHistoryDay `json:"history"`
}

PublicStatusComponent is the `PublicStatusComponent` schema.

type PublicStatusPage added in v0.44.0

type PublicStatusPage struct {
	Title       string  `json:"title"`
	Description *string `json:"description"`
	// State: Rollup over the components. `degraded` means some but not all are
	// down; components with no data are ignored rather than dragging the page to
	// unknown.
	//
	// One of "operational", "degraded", "major_outage", "unknown".
	State string `json:"state"`
	// Summary: One sentence describing `state`.
	Summary     string                  `json:"summary"`
	Components  []PublicStatusComponent `json:"components"`
	SupportURL  *string                 `json:"supportUrl"`
	ShowHistory bool                    `json:"showHistory"`
	ShowUptime  bool                    `json:"showUptime"`
	HistoryDays int64                   `json:"historyDays"`
	GeneratedAt string                  `json:"generatedAt"`
}

PublicStatusPage is the `PublicStatusPage` schema.

type PushedCostRow added in v0.6.0

type PushedCostRow struct {
	// Date: UTC day the spend belongs to.
	Date     string `json:"date"`
	Currency string `json:"currency"`
	// Amount: Money for this day/dimension combination. Negative for credits.
	Amount float64 `json:"amount"`
	// Service: Becomes a group/filter value.
	Service *string `json:"service,omitempty"`
	Region  *string `json:"region,omitempty"`
	// ResourceID: Opaque id of the thing being billed; groups the `resource`
	// dimension.
	ResourceID *string `json:"resourceId,omitempty"`
	// Tags: Cost-allocation tags, at most 32. Keys starting with `infrawrench:`
	// are reserved and rejected.
	Tags        map[string]string `json:"tags,omitempty"`
	UsageAmount *float64          `json:"usageAmount,omitempty"`
	UsageUnit   *string           `json:"usageUnit,omitempty"`
	// AccountID: Attribute this row to a connected account. Must belong to the
	// calling organization. Omit to attribute it to the source itself.
	AccountID *string `json:"accountId,omitempty"`
}

PushedCostRow is the `PushedCostRow` schema.

type QueryMonitor added in v1.37.0

type QueryMonitor struct {
	ID             string  `json:"id"`
	Name           string  `json:"name"`
	Description    *string `json:"description"`
	AccountID      string  `json:"accountId"`
	AccountName    *string `json:"accountName"`
	ResourceID     *string `json:"resourceId"`
	ResourceTypeID *string `json:"resourceTypeId"`
	ResourceName   *string `json:"resourceName"`
	SQL            string  `json:"sql"`
	// Mode: How the result is reduced to one number. `scalar` reads the first
	// column of the first row; `rowCount` counts the rows, which is what lets
	// `SELECT … WHERE broken` be a monitor.
	//
	// One of "scalar", "rowCount".
	Mode string `json:"mode"`
	// Operator: One of "gt", "gte", "lt", "lte", "eq", "neq".
	Operator        string  `json:"operator"`
	Threshold       float64 `json:"threshold"`
	IntervalMinutes int64   `json:"intervalMinutes"`
	// ConsecutiveBreaches: Consecutive breaching runs before the alert fires. A
	// query against a live table is a sample: a count that dips while a batch
	// job is mid-write is not an incident, and a monitor that pages on it gets
	// muted within a week.
	ConsecutiveBreaches int64 `json:"consecutiveBreaches"`
	Enabled             bool  `json:"enabled"`
	// State: `unknown` is a first-class state, not an absence: a monitor whose
	// query failed has not told you the data is fine, and rendering that as `ok`
	// is how a broken monitor becomes indistinguishable from a healthy one.
	//
	// One of "ok", "breaching", "unknown".
	State     string   `json:"state"`
	LastValue *float64 `json:"lastValue"`
	LastRunAt *string  `json:"lastRunAt"`
	// LastError: Why the last run said nothing. Kept apart from the state
	// because 'the monitor is broken' and 'the data is bad' need different
	// people.
	LastError       *string `json:"lastError"`
	BreachStreak    int64   `json:"breachStreak"`
	LastAlertedAt   *string `json:"lastAlertedAt"`
	CreatedByUserID *string `json:"createdByUserId"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
}

QueryMonitor is the `QueryMonitor` schema.

type QueryMonitorCreate added in v1.37.0

type QueryMonitorCreate struct {
	Name           string  `json:"name"`
	Description    *string `json:"description,omitempty"`
	AccountID      string  `json:"accountId"`
	ResourceID     *string `json:"resourceId,omitempty"`
	ResourceTypeID *string `json:"resourceTypeId,omitempty"`
	SQL            string  `json:"sql"`
	// Mode: How the result is reduced to one number. `scalar` reads the first
	// column of the first row; `rowCount` counts the rows, which is what lets
	// `SELECT … WHERE broken` be a monitor.
	//
	// One of "scalar", "rowCount".
	Mode string `json:"mode"`
	// Operator: One of "gt", "gte", "lt", "lte", "eq", "neq".
	Operator            string  `json:"operator"`
	Threshold           float64 `json:"threshold"`
	IntervalMinutes     int64   `json:"intervalMinutes"`
	ConsecutiveBreaches *int64  `json:"consecutiveBreaches,omitempty"`
	Enabled             *bool   `json:"enabled,omitempty"`
}

QueryMonitorCreate is the `QueryMonitorCreate` schema.

type QueryMonitorList added in v1.37.0

type QueryMonitorList struct {
	Monitors []QueryMonitor `json:"monitors"`
}

QueryMonitorList is the `QueryMonitorList` schema.

type QueryMonitorTargetAccount added in v1.39.0

type QueryMonitorTargetAccount struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// AccountSQL: The account itself has a SQL driver, so it is a valid target
	// on its own.
	AccountSQL bool                         `json:"accountSql"`
	Resources  []QueryMonitorTargetResource `json:"resources"`
}

QueryMonitorTargetAccount is the `QueryMonitorTargetAccount` schema.

type QueryMonitorTargetResource added in v1.39.0

type QueryMonitorTargetResource struct {
	ID             string `json:"id"`
	Name           string `json:"name"`
	ResourceTypeID string `json:"resourceTypeId"`
	// TypeName: The resource type's display name, e.g. 'D1 Database'.
	TypeName string `json:"typeName"`
}

QueryMonitorTargetResource is the `QueryMonitorTargetResource` schema.

type QueryMonitorTargets added in v1.39.0

type QueryMonitorTargets struct {
	Accounts []QueryMonitorTargetAccount `json:"accounts"`
}

QueryMonitorTargets is the `QueryMonitorTargets` schema.

type QueryMonitorTestResult added in v1.37.0

type QueryMonitorTestResult struct {
	Value *float64 `json:"value"`
	// State: `unknown` is a first-class state, not an absence: a monitor whose
	// query failed has not told you the data is fine, and rendering that as `ok`
	// is how a broken monitor becomes indistinguishable from a healthy one.
	//
	// One of "ok", "breaching", "unknown".
	State      string  `json:"state"`
	Error      *string `json:"error"`
	DurationMs int64   `json:"durationMs"`
	// Rows: Up to 20 rows, for the preview.
	Rows []map[string]any `json:"rows"`
}

QueryMonitorTestResult is the `QueryMonitorTestResult` schema.

type QueryMonitorUpdate added in v1.37.0

type QueryMonitorUpdate struct {
	Name           *string `json:"name,omitempty"`
	Description    *string `json:"description,omitempty"`
	AccountID      *string `json:"accountId,omitempty"`
	ResourceID     *string `json:"resourceId,omitempty"`
	ResourceTypeID *string `json:"resourceTypeId,omitempty"`
	SQL            *string `json:"sql,omitempty"`
	// Mode: How the result is reduced to one number. `scalar` reads the first
	// column of the first row; `rowCount` counts the rows, which is what lets
	// `SELECT … WHERE broken` be a monitor.
	//
	// One of "scalar", "rowCount".
	Mode *string `json:"mode,omitempty"`
	// Operator: One of "gt", "gte", "lt", "lte", "eq", "neq".
	Operator            *string  `json:"operator,omitempty"`
	Threshold           *float64 `json:"threshold,omitempty"`
	IntervalMinutes     *int64   `json:"intervalMinutes,omitempty"`
	ConsecutiveBreaches *int64   `json:"consecutiveBreaches,omitempty"`
	Enabled             *bool    `json:"enabled,omitempty"`
}

QueryMonitorUpdate is the `QueryMonitorUpdate` schema.

type QueryMonitorsCreateParams added in v1.37.0

type QueryMonitorsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *QueryMonitorCreate
}

QueryMonitorsCreateParams holds the parameters for `client.queryMonitors.create`.

Every field is optional; pass nil to take the defaults.

type QueryMonitorsDeleteParams added in v1.37.0

type QueryMonitorsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	MonitorID string
}

QueryMonitorsDeleteParams holds the parameters for `client.queryMonitors.delete`.

type QueryMonitorsGetGetOrgOrgIDQueryMonitorsMonitorIDParams added in v1.37.0

type QueryMonitorsGetGetOrgOrgIDQueryMonitorsMonitorIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	MonitorID string
}

QueryMonitorsGetGetOrgOrgIDQueryMonitorsMonitorIDParams holds the parameters for `client.queryMonitors.get.getOrgOrgIdQueryMonitorsMonitorId`.

type QueryMonitorsGetGetParams added in v1.37.0

type QueryMonitorsGetGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

QueryMonitorsGetGetParams holds the parameters for `client.queryMonitors.get.get`.

Every field is optional; pass nil to take the defaults.

type QueryMonitorsGetNamespace added in v1.37.0

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

QueryMonitorsGetNamespace is `client.queryMonitors.get`.

func (*QueryMonitorsGetNamespace) Get added in v1.37.0

Get: List query monitors

GET /api/org/{orgId}/query-monitors

func (*QueryMonitorsGetNamespace) GetOrgOrgIDQueryMonitorsMonitorID added in v1.37.0

GetOrgOrgIDQueryMonitorsMonitorID: Get one query monitor

GET /api/org/{orgId}/query-monitors/{monitorId}

Raises on 404: Not found

type QueryMonitorsNamespace added in v1.37.0

type QueryMonitorsNamespace struct {

	// Get: `client.queryMonitors.get`.
	Get *QueryMonitorsGetNamespace
	// contains filtered or unexported fields
}

QueryMonitorsNamespace is `client.queryMonitors`.

func (*QueryMonitorsNamespace) Create added in v1.37.0

Create: Create a query monitor

A monitor may only run `select`, `with`, `show` or `explain`, and only a **single** statement. That is a deliberate allowlist of leading keywords rather than a denylist of dangerous ones: a denylist has to be right about every dialect's spelling of every destructive verb, forever, and only has to be wrong once. Comments are stripped before the check, so `-- harmless\nDROP TABLE x` is rejected, and `SELECT 1; DROP TABLE x` is rejected by the single-statement rule.

Takes `resources:execute`, like the SQL editor: saving a monitor arranges for a query to run against a customer database on a schedule, forever, which is a strictly larger act than running one while watching it.

POST /api/org/{orgId}/query-monitors

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

func (*QueryMonitorsNamespace) Delete added in v1.37.0

Delete: Delete a query monitor

DELETE /api/org/{orgId}/query-monitors/{monitorId}

Raises on 404: Not found

func (*QueryMonitorsNamespace) Targets added in v1.39.0

Targets: List what a monitor can run against

The editor's target picker: each account with a SQL driver of its own, plus the SQL-capable resources inside it — a database that is a *resource* (a ClickHouse service, a D1 or Turso database, a Databricks SQL warehouse, a BigQuery dataset) rather than the account's own connection. Accounts with neither are omitted; a monitor pointed at one could only ever fail. Pass a resource's `id` (and optionally its `resourceTypeId` — the server fills it from the synced resource either way) when creating a monitor to scope the query to that resource.

GET /api/org/{orgId}/query-monitors/targets

func (*QueryMonitorsNamespace) Test added in v1.37.0

Test: Run a query once without saving it

The editor's 'try it' button. Goes through the same read-only guard as a scheduled run — a query that could not be saved as a monitor must not be runnable through the monitor's own preview — and applies the threshold, so the answer says whether it *would* be breaching rather than leaving the reader to compare two numbers.

POST /api/org/{orgId}/query-monitors/test

Raises on 400: Bad request

func (*QueryMonitorsNamespace) Update added in v1.37.0

Update: Edit a query monitor

Omitted fields are left alone and the result is validated after merging. Changing the query, the mode, the operator or the threshold **re-arms** the monitor: the stored breach streak was accumulated against a different question, and carrying it forward would fire an alert on the first run of a rule nobody has tested.

PATCH /api/org/{orgId}/query-monitors/{monitorId}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

type QueryMonitorsTargetsParams added in v1.39.0

type QueryMonitorsTargetsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

QueryMonitorsTargetsParams holds the parameters for `client.queryMonitors.targets`.

Every field is optional; pass nil to take the defaults.

type QueryMonitorsTestParams added in v1.37.0

type QueryMonitorsTestParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *QueryMonitorCreate
}

QueryMonitorsTestParams holds the parameters for `client.queryMonitors.test`.

Every field is optional; pass nil to take the defaults.

type QueryMonitorsUpdateParams added in v1.37.0

type QueryMonitorsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	MonitorID string
	// Body: the JSON request body.
	Body *QueryMonitorUpdate
}

QueryMonitorsUpdateParams holds the parameters for `client.queryMonitors.update`.

type QuietHours added in v1.0.0

type QuietHours struct {
	// Timezone: IANA zone, e.g. Europe/Berlin
	Timezone    string `json:"timezone"`
	StartMinute int64  `json:"startMinute"`
	// EndMinute: May be less than startMinute for an overnight window. Equal
	// means empty.
	EndMinute int64 `json:"endMinute"`
	// Days: ISO weekdays the window applies on, matched against the day the
	// window opened. Empty means every day.
	Days           []int64        `json:"days"`
	UrgentOverride *AlertSeverity `json:"urgentOverride"`
}

QuietHours: A recurring local-time window during which the rule holds its alerts. Held, not dropped — a held alert is queued and delivered when the window closes.

The API may send null in its place.

type QuotaAccountStatus added in v1.12.0

type QuotaAccountStatus struct {
	AccountID   string   `json:"accountId"`
	AccountName string   `json:"accountName"`
	PluginID    PluginID `json:"pluginId"`
	// QuotaCount: Quota rows currently stored for this account.
	QuotaCount int64 `json:"quotaCount"`
	// LastPolledAt: Last successful collection; null if never.
	LastPolledAt *string `json:"lastPolledAt"`
	// LastError: Last collection failure, or null when the last pass succeeded.
	LastError          *string `json:"lastError"`
	LastErrorHelpLabel *string `json:"lastErrorHelpLabel"`
	// LastErrorHelpURL: Set when the failure was a fixable permission gap rather
	// than an outage.
	LastErrorHelpURL *string `json:"lastErrorHelpUrl"`
	// Partial: The plugin reports a representative subset of the provider's
	// quotas, not all of them. True for AWS and DigitalOcean.
	Partial bool `json:"partial"`
}

QuotaAccountStatus is the `QuotaAccountStatus` schema.

type QuotaAlertSettings added in v1.12.0

type QuotaAlertSettings struct {
	// Enabled: Whether the poller sends quota alerts for this organization at
	// all.
	Enabled bool `json:"enabled"`
	// Threshold: Utilisation fraction at or above which a quota alerts. Default
	// 0.8. Bounded below at 0.5 (a lower threshold makes every quota critical)
	// and above at 0.99 (at 1.0 the provider is already refusing requests, so
	// the alert reports an outage rather than warning about one). Values outside
	// the range are rejected, not clamped.
	Threshold float64 `json:"threshold"`
	// LastNotifiedAt: When the organization's quota alert scan last completed,
	// or null before the first. Owned by the poller's cooldown claim; not
	// writable through this API.
	LastNotifiedAt *string `json:"lastNotifiedAt"`
}

QuotaAlertSettings is the `QuotaAlertSettings` schema.

type QuotaAlertSettingsUpdate added in v1.12.0

type QuotaAlertSettingsUpdate struct {
	Enabled   *bool    `json:"enabled,omitempty"`
	Threshold *float64 `json:"threshold,omitempty"`
}

QuotaAlertSettingsUpdate is the `QuotaAlertSettingsUpdate` schema.

type QuotaListResponse added in v1.12.0

type QuotaListResponse struct {
	// Rows: Every quota with a reading, worst first.
	Rows []QuotaRow `json:"rows"`
	// Accounts: Per-account collection status for every account on a
	// quota-capable plugin. Present even when the account has rows: an empty
	// `rows` alone cannot distinguish 'nothing is near a limit' from 'every
	// collection is failing'.
	Accounts []QuotaAccountStatus `json:"accounts"`
	// Threshold: The organization's alert threshold as a fraction, so the page's
	// marker and the alert agree.
	Threshold float64 `json:"threshold"`
	// UnsupportedPluginIDs: Plugins the organization holds accounts with that
	// cannot report quotas at all. Named rather than counted, because the
	// absence is the finding.
	UnsupportedPluginIDs []PluginID `json:"unsupportedPluginIds"`
}

QuotaListResponse is the `QuotaListResponse` schema.

type QuotaRow added in v1.12.0

type QuotaRow struct {
	// Key: Plugin-chosen stable id for this quota within the account.
	Key         string   `json:"key"`
	AccountID   string   `json:"accountId"`
	AccountName string   `json:"accountName"`
	PluginID    PluginID `json:"pluginId"`
	// Service: Provider service in the provider's own vocabulary.
	Service string `json:"service"`
	Name    string `json:"name"`
	// Region: Provider region, or null for an account-wide quota. Never the
	// string 'global'.
	Region *string `json:"region"`
	// Limit: The ceiling the provider will enforce, in `unit`.
	Limit float64 `json:"limit"`
	// Used: How much of `limit` is consumed, in the same unit.
	Used float64 `json:"used"`
	// Utilization: used / limit. Not clamped at 1 — an over-quota reading is a
	// real state.
	Utilization float64 `json:"utilization"`
	// Unit: What is being counted, in the provider's own word.
	Unit *string `json:"unit"`
	// Adjustable: Whether the provider lets the customer request an increase.
	// Null means the plugin does not know, which is not the same as `false`.
	Adjustable *bool `json:"adjustable"`
	// DocsURL: Provider page explaining or raising this quota.
	DocsURL *string `json:"docsUrl"`
	// ObservedAt: When this reading was collected.
	ObservedAt string `json:"observedAt"`
	// Severity: Where the quota sits: `exhausted` (used >= limit — the provider
	// is already refusing requests), `critical` (at or over the organization's
	// threshold), `trending` (under the threshold, but the fitted trend reaches
	// the limit within 30 days), or `ok`. Ordered: an exhausted quota is also
	// over threshold and also trending, and reports as `exhausted`.
	//
	// One of "exhausted", "critical", "trending", "ok".
	Severity string     `json:"severity"`
	Trend    QuotaTrend `json:"trend"`
}

QuotaRow is the `QuotaRow` schema.

type QuotaTrend added in v1.12.0

type QuotaTrend struct {
	// PerDay: Least-squares change in utilisation fraction per day over the last
	// 14 days of snapshots. Null when fewer than 3 readings exist, or when every
	// reading shares an instant. Null means 'not enough history', never 'no
	// risk'.
	PerDay *float64 `json:"perDay"`
	// DaysToExhaustion: Days until used reaches limit at the fitted rate. Null
	// when the trend is flat or falling, when the quota is already at its limit,
	// or when exhaustion lands beyond the 30-day horizon.
	DaysToExhaustion *float64 `json:"daysToExhaustion"`
	// Points: Snapshots the fit used.
	Points int64 `json:"points"`
}

QuotaTrend is the `QuotaTrend` schema.

type QuotasGetParams added in v1.12.0

type QuotasGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

QuotasGetParams holds the parameters for `client.quotas.get`.

Every field is optional; pass nil to take the defaults.

type QuotasNamespace added in v1.12.0

type QuotasNamespace struct {

	// Settings: `client.quotas.settings`.
	Settings *QuotasSettingsNamespace
	// contains filtered or unexported fields
}

QuotasNamespace is `client.quotas`.

func (*QuotasNamespace) Get added in v1.12.0

Get: List provider quota utilisation across the organization

How close each account is to the limits its provider enforces, with the trend fitted over the last 14 days of collected readings. Both halves of every row — the used figure and the limit — come from the provider; nothing is filled in from published defaults, so an account with an approved increase reads as having the headroom it has. This is a read over already-collected snapshots: no provider API calls are made here, and the readings are as fresh as the last collection pass (roughly six hours). A plugin that declares no quota capability contributes nothing rather than zero — see `unsupportedPluginIds`.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/quotas

type QuotasSettingsGetParams added in v1.12.0

type QuotasSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

QuotasSettingsGetParams holds the parameters for `client.quotas.settings.get`.

Every field is optional; pass nil to take the defaults.

type QuotasSettingsNamespace added in v1.12.0

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

QuotasSettingsNamespace is `client.quotas.settings`.

func (*QuotasSettingsNamespace) Get added in v1.12.0

Get: Get the organization's quota alert settings

The threshold feeds both the feed's severity buckets and the poller's daily alert scan. An organization that never saved reads the shipped defaults (enabled, 0.8).

_Requires permission: `org:settings:write`._

GET /api/org/{orgId}/quotas/settings

func (*QuotasSettingsNamespace) Update added in v1.12.0

Update: Update the quota alert settings

Every field is optional so a single toggle can be saved on its own. `threshold` is a fraction from 0.5 to 0.99 and is rejected rather than clamped when out of range. Saving never resets the alert cooldown.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/quotas/settings

Raises on 400: Bad request

type QuotasSettingsUpdateParams added in v1.12.0

type QuotasSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *QuotaAlertSettingsUpdate
}

QuotasSettingsUpdateParams holds the parameters for `client.quotas.settings.update`.

Every field is optional; pass nil to take the defaults.

type ReauthenticationRequired

type ReauthenticationRequired struct {
	// Error: Human-readable error message
	Error string `json:"error"`
	// Code: One of "reauthentication_required".
	Code string `json:"code"`
}

ReauthenticationRequired is the `ReauthenticationRequired` schema.

type RegisteredAgent added in v1.26.0

type RegisteredAgent struct {
	RegistrationID string `json:"registration_id"`
	// Credential: Bearer credential for this registration. Format
	// `iwa_<base64url>`. Returned once and never recoverable — there is no route
	// that can show it again.
	Credential     string `json:"credential"`
	OrganizationID string `json:"organization_id"`
	// TrialExpiresAt: When the trial workspace is deleted unless a person claims
	// it.
	TrialExpiresAt string `json:"trial_expires_at"`
	ClaimURL       string `json:"claim_url"`
	// Notice: Human-readable summary of the trial terms, meant to be relayed to
	// the user.
	Notice string `json:"notice"`
}

RegisteredAgent is the `RegisteredAgent` schema.

type ReorderRequest

type ReorderRequest struct {
	Cards       []ReorderRequestCards `json:"cards,omitempty"`
	ResourceIDs []ResourceID          `json:"resourceIds,omitempty"`
}

ReorderRequest is the `ReorderRequest` schema.

type ReorderRequestCards

type ReorderRequestCards struct {
	// Kind: One of "resource", "workflow", "widget".
	Kind string `json:"kind"`
	ID   string `json:"id"`
}

ReorderRequestCards is an object the spec declares inline.

type ReportDeliveryTargetOption added in v1.6.0

type ReportDeliveryTargetOption struct {
	// ID: The stored row id — what the schedule input carries.
	ID string `json:"id"`
	// Label: Display label: `#channel` for Slack, the saved label for Teams.
	Label string `json:"label"`
}

ReportDeliveryTargetOption is the `ReportDeliveryTargetOption` schema.

type ReportDeliveryTargets added in v1.6.0

type ReportDeliveryTargets struct {
	SlackChannels []ReportDeliveryTargetOption `json:"slackChannels"`
	TeamsWebhooks []ReportDeliveryTargetOption `json:"teamsWebhooks"`
	// EmailAvailable: Whether this deployment can send mail at all. Addresses
	// can be saved regardless, but they deliver nowhere until a mail provider is
	// configured.
	EmailAvailable bool `json:"emailAvailable"`
}

ReportDeliveryTargets is the `ReportDeliveryTargets` schema.

type ReportNotification added in v1.6.0

type ReportNotification struct {
	ID           string `json:"id"`
	CostReportID string `json:"costReportId"`
	// Cadence: How often the schedule fires. The report itself decides what
	// window it charts.
	//
	// One of "daily", "weekly", "monthly".
	Cadence         string   `json:"cadence"`
	SendDay         int64    `json:"sendDay"`
	SendDayOfMonth  int64    `json:"sendDayOfMonth"`
	Hour            int64    `json:"hour"`
	Timezone        string   `json:"timezone"`
	SlackChannelIDs []string `json:"slackChannelIds"`
	TeamsWebhookIDs []string `json:"teamsWebhookIds"`
	EmailRecipients []string `json:"emailRecipients"`
	Enabled         bool     `json:"enabled"`
	// NextSendAt: When the next scheduled send is due; null while disabled.
	NextSendAt *string `json:"nextSendAt"`
	// LastSentAt: When a delivery last actually reached at least one
	// destination.
	LastSentAt *string `json:"lastSentAt"`
	// LastStatus: What the last attempt did. `partial` means some destinations
	// took it and some failed — never retried automatically, because a retry
	// would double-post where it landed.
	//
	// One of "pending", "succeeded", "partial", "failed", "no_targets".
	LastStatus      *string `json:"lastStatus"`
	LastError       *string `json:"lastError"`
	CreatedByUserID *string `json:"createdByUserId"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
}

ReportNotification is the `ReportNotification` schema.

type ReportNotificationInput added in v1.6.0

type ReportNotificationInput struct {
	// Cadence: How often the schedule fires. The report itself decides what
	// window it charts.
	//
	// One of "daily", "weekly", "monthly".
	Cadence string `json:"cadence"`
	// SendDay: ISO day of week (1 = Monday … 7 = Sunday); read only when cadence
	// is weekly.
	SendDay *int64 `json:"sendDay,omitempty"`
	// SendDayOfMonth: Day of month; read only when cadence is monthly. A day the
	// month doesn't have clamps to its last day, so 31 means month end
	// everywhere.
	SendDayOfMonth *int64 `json:"sendDayOfMonth,omitempty"`
	// Hour: Local hour in `timezone` the delivery fires at.
	Hour int64 `json:"hour"`
	// Timezone: IANA zone, e.g. `Europe/Berlin`. Validated server-side.
	Timezone string `json:"timezone"`
	// SlackChannelIDs: Stored Slack channel row ids (from the targets endpoint)
	// to post to.
	SlackChannelIDs []string `json:"slackChannelIds"`
	// TeamsWebhookIDs: Stored Teams webhook row ids (from the targets endpoint)
	// to post to.
	TeamsWebhookIDs []string `json:"teamsWebhookIds"`
	// EmailRecipients: Email addresses; normalized (lowercased) server-side. At
	// most 20.
	EmailRecipients []string `json:"emailRecipients"`
	Enabled         bool     `json:"enabled"`
}

ReportNotificationInput: A full replace, like a report's own PUT. At least one destination is required — a schedule with nowhere to deliver would only ever record failures.

type ReportNotificationSendResult added in v1.6.0

type ReportNotificationSendResult struct {
	Attempted int64                             `json:"attempted"`
	Succeeded int64                             `json:"succeeded"`
	Slack     ReportNotificationSendResultSlack `json:"slack"`
	Teams     ReportNotificationSendResultTeams `json:"teams"`
	Email     ReportNotificationSendResultEmail `json:"email"`
}

ReportNotificationSendResult is the `ReportNotificationSendResult` schema.

type ReportNotificationSendResultEmail added in v1.6.0

type ReportNotificationSendResultEmail struct {
	Attempted int64 `json:"attempted"`
	Succeeded int64 `json:"succeeded"`
}

ReportNotificationSendResultEmail is an object the spec declares inline.

type ReportNotificationSendResultSlack added in v1.6.0

type ReportNotificationSendResultSlack struct {
	Attempted int64 `json:"attempted"`
	Succeeded int64 `json:"succeeded"`
}

ReportNotificationSendResultSlack is an object the spec declares inline.

type ReportNotificationSendResultTeams added in v1.6.0

type ReportNotificationSendResultTeams struct {
	Attempted int64 `json:"attempted"`
	Succeeded int64 `json:"succeeded"`
}

ReportNotificationSendResultTeams is an object the spec declares inline.

type RequestOption

type RequestOption func(*requestConfig)

RequestOption overrides configuration for a single call. Cancellation and deadlines are not here on purpose: that is what the context.Context every method takes is for.

func WithQueryParam

func WithQueryParam(name, value string) RequestOption

WithQueryParam appends a query parameter this call's signature does not describe — an escape hatch for a server that has grown a parameter the generated code has not caught up with.

func WithRequestHeader

func WithRequestHeader(name, value string) RequestOption

WithRequestHeader sets a header on this call only, overriding any header of the same name set on the client.

type RequiredTag added in v0.29.0

type RequiredTag struct {
	Key string `json:"key"`
	// AllowedValues: When set, the tag's value must be one of these (compared
	// exactly).
	AllowedValues []string `json:"allowedValues,omitempty"`
}

RequiredTag is the `RequiredTag` schema.

type Resource

type Resource struct {
	ID               ResourceID  `json:"id"`
	PluginID         string      `json:"pluginId"`
	ResourceTypeID   string      `json:"resourceTypeId"`
	AccountID        string      `json:"accountId"`
	DisplayName      string      `json:"displayName"`
	ExternalID       *string     `json:"externalId"`
	FieldsJSON       JSONObject  `json:"fieldsJson"`
	OutputsJSON      JSONObject  `json:"outputsJson"`
	ParentResourceID *ResourceID `json:"parentResourceId"`
}

Resource is the `Resource` schema.

type ResourceChangeEntry added in v0.22.0

type ResourceChangeEntry struct {
	ID             string     `json:"id"`
	ResourceID     ResourceID `json:"resourceId"`
	AccountID      string     `json:"accountId"`
	PluginID       string     `json:"pluginId"`
	ResourceTypeID string     `json:"resourceTypeId"`
	// DisplayName: Resource display name at the time of the change — survives
	// deletion.
	DisplayName string             `json:"displayName"`
	ChangeKind  ResourceChangeKind `json:"changeKind"`
	// Diff: Changed fields for `updated` events; empty for `created` and
	// `deleted`.
	Diff []ResourceFieldChange `json:"diff"`
	// Origin: Who caused the change when a non-sync writer knows: `schedule` for
	// sleep/wake schedule transitions. Absent/null = observed by sync.
	//
	// One of "schedule".
	Origin    *string `json:"origin,omitempty"`
	CreatedAt string  `json:"createdAt"`
	// RevertedAt: When this event was reverted, or null if it never was.
	// Reverting is a one-shot: an event carrying a timestamp here cannot be
	// reverted again.
	RevertedAt *string `json:"revertedAt,omitempty"`
}

ResourceChangeEntry is the `ResourceChangeEntry` schema.

type ResourceChangeFeedEntry added in v0.22.0

type ResourceChangeFeedEntry struct {
	ID             string     `json:"id"`
	ResourceID     ResourceID `json:"resourceId"`
	AccountID      string     `json:"accountId"`
	PluginID       string     `json:"pluginId"`
	ResourceTypeID string     `json:"resourceTypeId"`
	// DisplayName: Resource display name at the time of the change — survives
	// deletion.
	DisplayName string             `json:"displayName"`
	ChangeKind  ResourceChangeKind `json:"changeKind"`
	// Diff: Changed fields for `updated` events; empty for `created` and
	// `deleted`.
	Diff []ResourceFieldChange `json:"diff"`
	// Origin: Who caused the change when a non-sync writer knows: `schedule` for
	// sleep/wake schedule transitions. Absent/null = observed by sync.
	//
	// One of "schedule".
	Origin    *string `json:"origin,omitempty"`
	CreatedAt string  `json:"createdAt"`
	// RevertedAt: When this event was reverted, or null if it never was.
	// Reverting is a one-shot: an event carrying a timestamp here cannot be
	// reverted again.
	RevertedAt  *string `json:"revertedAt,omitempty"`
	AccountName *string `json:"accountName"`
}

ResourceChangeFeedEntry is the `ResourceChangeFeedEntry` schema.

type ResourceChangeFeedResponse added in v0.22.0

type ResourceChangeFeedResponse struct {
	Entries []ResourceChangeFeedEntry `json:"entries"`
	Total   int64                     `json:"total"`
}

ResourceChangeFeedResponse is the `ResourceChangeFeedResponse` schema.

type ResourceChangeKind added in v0.22.0

type ResourceChangeKind = string

ResourceChangeKind: What happened between two consecutive syncs: the resource appeared, a stored field changed, or the resource disappeared upstream.

const (
	ResourceChangeKindCreated ResourceChangeKind = "created"
	ResourceChangeKindUpdated ResourceChangeKind = "updated"
	ResourceChangeKindDeleted ResourceChangeKind = "deleted"
)

The values ResourceChangeKind takes.

type ResourceChangeListResponse added in v0.22.0

type ResourceChangeListResponse struct {
	Entries []ResourceChangeEntry `json:"entries"`
}

ResourceChangeListResponse is the `ResourceChangeListResponse` schema.

type ResourceDetail

type ResourceDetail struct {
	DetailSchema            JSONObject         `json:"detailSchema"`
	ChildResources          []ChildResourceRef `json:"childResources"`
	ChildTypes              []ChildTypeRef     `json:"childTypes"`
	PluginID                string             `json:"pluginId"`
	PluginLogoSvg           string             `json:"pluginLogoSvg"`
	ResourceID              ResourceID         `json:"resourceId"`
	AccountID               string             `json:"accountId"`
	ResourceTypeID          string             `json:"resourceTypeId"`
	PeerPanes               []PeerPane         `json:"peerPanes"`
	PeerIntegrationStubs    []PeerPaneStub     `json:"peerIntegrationStubs"`
	CanDelete               bool               `json:"canDelete"`
	CanEdit                 bool               `json:"canEdit"`
	EditableFields          []EditableField    `json:"editableFields"`
	CredentialFormats       []CredentialFormat `json:"credentialFormats"`
	SupportsTerraformExport bool               `json:"supportsTerraformExport"`
	HasManifestEditor       bool               `json:"hasManifestEditor"`
	HasSecretVersions       bool               `json:"hasSecretVersions"`
	ResourceDisplayName     string             `json:"resourceDisplayName"`
	ResourceTypeLabel       string             `json:"resourceTypeLabel"`
	ResourceFields          JSONObject         `json:"resourceFields"`
	HasSQLEditor            bool               `json:"hasSqlEditor"`
	HasStorageBrowser       bool               `json:"hasStorageBrowser"`
	HasArtifactRegistry     bool               `json:"hasArtifactRegistry"`
	HasKVBrowser            bool               `json:"hasKvBrowser"`
	HasKVConsole            bool               `json:"hasKvConsole"`
	KVDriverName            *string            `json:"kvDriverName,omitempty"`
	IsMongoDB               bool               `json:"isMongoDb"`
	HasDockerActions        bool               `json:"hasDockerActions"`
	HasSSHTerminal          bool               `json:"hasSshTerminal"`
	HasSFTPBrowser          bool               `json:"hasSftpBrowser"`
	SSHHost                 *string            `json:"sshHost"`
	SSHPrivateHost          *string            `json:"sshPrivateHost,omitempty"`
	DefaultSSHUsername      *string            `json:"defaultSshUsername"`
	ContainerID             string             `json:"containerId"`
	DatabaseName            string             `json:"databaseName"`
	StorageBucketName       string             `json:"storageBucketName"`
	SupportsMetrics         bool               `json:"supportsMetrics"`
	// Schedulable: The type declares lifecycle start/stop actions, so this
	// resource can carry a sleep/wake schedule.
	Schedulable bool `json:"schedulable"`
}

ResourceDetail is the `ResourceDetail` schema.

type ResourceFieldChange added in v0.22.0

type ResourceFieldChange struct {
	// Field: Top-level field key that changed. Resolved-output keys are prefixed
	// `outputs.`.
	Field string `json:"field"`
	// From: Previous value (null when the field was absent).
	From any `json:"from,omitempty"`
	// To: New value.
	To any `json:"to,omitempty"`
}

ResourceFieldChange is the `ResourceFieldChange` schema.

type ResourceID

type ResourceID = string

ResourceID: Composite id `pluginId:accountId:externalId`.

Spec schema: `ResourceId`.

type ResourceLease added in v0.33.0

type ResourceLease struct {
	ID string `json:"id"`
	// ResourceID: Infrawrench resource id the lease is attached to.
	ResourceID     string   `json:"resourceId"`
	AccountID      string   `json:"accountId"`
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	// ResourceName: Resource display name (denormalized at lease time, so it
	// survives deletion).
	ResourceName string `json:"resourceName"`
	AccountName  string `json:"accountName"`
	// ExpiresAt: The lease deadline.
	ExpiresAt string `json:"expiresAt"`
	// AutoDelete: Whether the resource is deleted at expiry. Auto-delete is
	// announced twice before it fires and deferred while an org change freeze is
	// in effect.
	AutoDelete bool `json:"autoDelete"`
	// Note: Why/who-for; shown on the expiry radar.
	Note *string `json:"note"`
	// Status: Lease lifecycle: `active` (counting down), `deleted` (auto-delete
	// completed), `failed` (auto-delete was retried and given up on — see
	// `lastError`), or `canceled` (called off; the resource stays).
	//
	// One of "active", "deleted", "failed", "canceled".
	Status string `json:"status"`
	// FirstWarningAt: When the first auto-delete announcement went out; null
	// until sent.
	FirstWarningAt *string `json:"firstWarningAt"`
	// FinalWarningAt: When the final auto-delete announcement went out; null
	// until sent.
	FinalWarningAt *string `json:"finalWarningAt"`
	DeleteAttempts int64   `json:"deleteAttempts"`
	// LastError: Last auto-delete failure or freeze-deferral detail; never
	// silent.
	LastError *string `json:"lastError"`
	// CompletedAt: When the lease reached a terminal status.
	CompletedAt *string `json:"completedAt"`
	CreatedAt   string  `json:"createdAt"`
	UpdatedAt   string  `json:"updatedAt"`
}

ResourceLease is the `ResourceLease` schema.

type ResourceLeaseCreate added in v0.33.0

type ResourceLeaseCreate struct {
	ResourceID string `json:"resourceId"`
	AccountID  string `json:"accountId"`
	// ExpiresAt: Must be in the future, at most 365 days out.
	ExpiresAt string `json:"expiresAt"`
	// AutoDelete: Requires the `resources:delete` permission when true.
	AutoDelete *bool   `json:"autoDelete,omitempty"`
	Note       *string `json:"note,omitempty"`
}

ResourceLeaseCreate is the `ResourceLeaseCreate` schema.

type ResourceLeaseList added in v0.33.0

type ResourceLeaseList struct {
	Leases []ResourceLease `json:"leases"`
}

ResourceLeaseList is the `ResourceLeaseList` schema.

type ResourceLeaseLookup added in v0.33.0

type ResourceLeaseLookup struct {
	Lease any `json:"lease"`
}

ResourceLeaseLookup is the `ResourceLeaseLookup` schema.

type ResourceLeaseUpdate added in v0.33.0

type ResourceLeaseUpdate struct {
	ExpiresAt *string `json:"expiresAt,omitempty"`
	// AutoDelete: Requires the `resources:delete` permission when set to true.
	AutoDelete *bool `json:"autoDelete,omitempty"`
	// Note: `null` clears the note.
	Note *string `json:"note,omitempty"`
}

ResourceLeaseUpdate is the `ResourceLeaseUpdate` schema.

type ResourceOwnerAnnotation added in v0.44.0

type ResourceOwnerAnnotation struct {
	// UserID: Set when a routable org member owns it.
	UserID *string `json:"userId"`
	// DisplayName: The member's name, or the free-text owner.
	DisplayName string `json:"displayName"`
	// IsLabel: True when the owner is free text — nothing can be routed to it.
	IsLabel   bool    `json:"isLabel"`
	TicketURL *string `json:"ticketUrl"`
	Purpose   *string `json:"purpose"`
}

ResourceOwnerAnnotation: Who owns this resource, or null when nobody has claimed it. Present only when the owner can be named: a resource carrying a purpose but no owner reads as null, because the question this answers is who to tell.

The API may send null in its place.

type ResourceOwnership added in v0.44.0

type ResourceOwnership struct {
	ID             string   `json:"id"`
	ResourceID     string   `json:"resourceId"`
	AccountID      string   `json:"accountId"`
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	// ResourceName: Resource display name, denormalized so a report can name a
	// deleted resource.
	ResourceName string `json:"resourceName"`
	// OwnerUserID: The routable owner — an org member. Alerts about this
	// resource reach them.
	OwnerUserID *string `json:"ownerUserId"`
	// OwnerName: Resolved server-side; null when unset or removed.
	OwnerName  *string `json:"ownerName"`
	OwnerEmail *string `json:"ownerEmail"`
	// OwnerLabel: Free-text owner (a team, a rota, a contractor). Display-only,
	// never routed.
	OwnerLabel *string `json:"ownerLabel"`
	// Purpose: What this resource is for.
	Purpose *string `json:"purpose"`
	// TicketURL: Link to the ticket that authorized it.
	TicketURL *string `json:"ticketUrl"`
	CreatedAt string  `json:"createdAt"`
	UpdatedAt string  `json:"updatedAt"`
}

ResourceOwnership is the `ResourceOwnership` schema.

type ResourceOwnershipEnvelope added in v0.44.0

type ResourceOwnershipEnvelope struct {
	Ownership any `json:"ownership"`
}

ResourceOwnershipEnvelope is the `ResourceOwnershipEnvelope` schema.

type ResourceOwnershipListResponse added in v0.44.0

type ResourceOwnershipListResponse struct {
	Ownership []ResourceOwnership `json:"ownership"`
}

ResourceOwnershipListResponse is the `ResourceOwnershipListResponse` schema.

type ResourceOwnershipPatch added in v0.44.0

type ResourceOwnershipPatch struct {
	ResourceID string `json:"resourceId"`
	// OwnerUserID: Omit to keep, null to clear.
	OwnerUserID *string `json:"ownerUserId,omitempty"`
	// OwnerLabel: Omit to keep, null to clear.
	OwnerLabel *string `json:"ownerLabel,omitempty"`
	// Purpose: Omit to keep, null to clear.
	Purpose *string `json:"purpose,omitempty"`
	// TicketURL: Omit to keep, null to clear.
	TicketURL *string `json:"ticketUrl,omitempty"`
}

ResourceOwnershipPatch is the `ResourceOwnershipPatch` schema.

type ResourceStatus

type ResourceStatus = string

ResourceStatus: Normalized status reported by a plugin's renderSidebarItem/renderDetail.

const (
	ResourceStatusHealthy      ResourceStatus = "healthy"
	ResourceStatusDegraded     ResourceStatus = "degraded"
	ResourceStatusError        ResourceStatus = "error"
	ResourceStatusUnknown      ResourceStatus = "unknown"
	ResourceStatusProvisioning ResourceStatus = "provisioning"
	ResourceStatusInfo         ResourceStatus = "info"
)

The values ResourceStatus takes.

type ResourceTypeID

type ResourceTypeID = string

ResourceTypeID: Resource type id. Note: not every plugin exposes every type — see the plugin's `resourceTypes` for the valid (pluginId, typeId) pairs.

Spec schema: `ResourceTypeId`.

const (
	ResourceTypeIDAccessApplication              ResourceTypeID = "access-application"
	ResourceTypeIDAccessPolicy                   ResourceTypeID = "access-policy"
	ResourceTypeIDAccount                        ResourceTypeID = "account"
	ResourceTypeIDAcmCertificate                 ResourceTypeID = "acm-certificate"
	ResourceTypeIDAgentAPIKey                    ResourceTypeID = "agent-api-key"
	ResourceTypeIDAiGateway                      ResourceTypeID = "ai-gateway"
	ResourceTypeIDAiSearch                       ResourceTypeID = "ai-search"
	ResourceTypeIDAlb                            ResourceTypeID = "alb"
	ResourceTypeIDAlertPolicy                    ResourceTypeID = "alert-policy"
	ResourceTypeIDAlloydbCluster                 ResourceTypeID = "alloydb-cluster"
	ResourceTypeIDAlloydbInstance                ResourceTypeID = "alloydb-instance"
	ResourceTypeIDAPIGateway                     ResourceTypeID = "api-gateway"
	ResourceTypeIDAPIKey                         ResourceTypeID = "api-key"
	ResourceTypeIDApp                            ResourceTypeID = "app"
	ResourceTypeIDAppEngineService               ResourceTypeID = "app-engine-service"
	ResourceTypeIDApprunnerService               ResourceTypeID = "apprunner-service"
	ResourceTypeIDArtifactRegistryRepo           ResourceTypeID = "artifact-registry-repo"
	ResourceTypeIDAuditEvent                     ResourceTypeID = "audit-event"
	ResourceTypeIDAutoScalingGroup               ResourceTypeID = "auto-scaling-group"
	ResourceTypeIDAzureAksCluster                ResourceTypeID = "azure-aks-cluster"
	ResourceTypeIDAzureAppGateway                ResourceTypeID = "azure-app-gateway"
	ResourceTypeIDAzureAppRegistration           ResourceTypeID = "azure-app-registration"
	ResourceTypeIDAzureAppService                ResourceTypeID = "azure-app-service"
	ResourceTypeIDAzureAppServicePlan            ResourceTypeID = "azure-app-service-plan"
	ResourceTypeIDAzureContainerInstance         ResourceTypeID = "azure-container-instance"
	ResourceTypeIDAzureContainerRegistry         ResourceTypeID = "azure-container-registry"
	ResourceTypeIDAzureCosmosDB                  ResourceTypeID = "azure-cosmos-db"
	ResourceTypeIDAzureDisk                      ResourceTypeID = "azure-disk"
	ResourceTypeIDAzureDNSZone                   ResourceTypeID = "azure-dns-zone"
	ResourceTypeIDAzureEventHub                  ResourceTypeID = "azure-event-hub"
	ResourceTypeIDAzureFirewall                  ResourceTypeID = "azure-firewall"
	ResourceTypeIDAzureFunctionApp               ResourceTypeID = "azure-function-app"
	ResourceTypeIDAzureKeyVault                  ResourceTypeID = "azure-key-vault"
	ResourceTypeIDAzureLoadBalancer              ResourceTypeID = "azure-load-balancer"
	ResourceTypeIDAzureLogAnalytics              ResourceTypeID = "azure-log-analytics"
	ResourceTypeIDAzureManagedIdentity           ResourceTypeID = "azure-managed-identity"
	ResourceTypeIDAzureMysqlFlexible             ResourceTypeID = "azure-mysql-flexible"
	ResourceTypeIDAzureNatGateway                ResourceTypeID = "azure-nat-gateway"
	ResourceTypeIDAzureNsg                       ResourceTypeID = "azure-nsg"
	ResourceTypeIDAzurePostgresFlexible          ResourceTypeID = "azure-postgres-flexible"
	ResourceTypeIDAzurePrivateDNSZone            ResourceTypeID = "azure-private-dns-zone"
	ResourceTypeIDAzurePublicIP                  ResourceTypeID = "azure-public-ip"
	ResourceTypeIDAzureRedisCache                ResourceTypeID = "azure-redis-cache"
	ResourceTypeIDAzureResourceGroup             ResourceTypeID = "azure-resource-group"
	ResourceTypeIDAzureRouteTable                ResourceTypeID = "azure-route-table"
	ResourceTypeIDAzureServiceBus                ResourceTypeID = "azure-service-bus"
	ResourceTypeIDAzureSQLDatabase               ResourceTypeID = "azure-sql-database"
	ResourceTypeIDAzureStorageAccount            ResourceTypeID = "azure-storage-account"
	ResourceTypeIDAzureSubnet                    ResourceTypeID = "azure-subnet"
	ResourceTypeIDAzureVM                        ResourceTypeID = "azure-vm"
	ResourceTypeIDAzureVnet                      ResourceTypeID = "azure-vnet"
	ResourceTypeIDBackendService                 ResourceTypeID = "backend-service"
	ResourceTypeIDBackupVault                    ResourceTypeID = "backup-vault"
	ResourceTypeIDBalance                        ResourceTypeID = "balance"
	ResourceTypeIDBatch                          ResourceTypeID = "batch"
	ResourceTypeIDBatchInferenceJob              ResourceTypeID = "batch-inference-job"
	ResourceTypeIDBatchJobQueue                  ResourceTypeID = "batch-job-queue"
	ResourceTypeIDBedrockModel                   ResourceTypeID = "bedrock-model"
	ResourceTypeIDBigqueryDataset                ResourceTypeID = "bigquery-dataset"
	ResourceTypeIDBigqueryTable                  ResourceTypeID = "bigquery-table"
	ResourceTypeIDBigtableInstance               ResourceTypeID = "bigtable-instance"
	ResourceTypeIDBlockVolume                    ResourceTypeID = "block-volume"
	ResourceTypeIDCacheRule                      ResourceTypeID = "cache-rule"
	ResourceTypeIDCachedContent                  ResourceTypeID = "cached-content"
	ResourceTypeIDCertificate                    ResourceTypeID = "certificate"
	ResourceTypeIDChDatabase                     ResourceTypeID = "ch-database"
	ResourceTypeIDChService                      ResourceTypeID = "ch-service"
	ResourceTypeIDCloudArmorPolicy               ResourceTypeID = "cloud-armor-policy"
	ResourceTypeIDCloudBuildTrigger              ResourceTypeID = "cloud-build-trigger"
	ResourceTypeIDCloudDeployPipeline            ResourceTypeID = "cloud-deploy-pipeline"
	ResourceTypeIDCloudDNSRecordSet              ResourceTypeID = "cloud-dns-record-set"
	ResourceTypeIDCloudDNSZone                   ResourceTypeID = "cloud-dns-zone"
	ResourceTypeIDCloudFunction                  ResourceTypeID = "cloud-function"
	ResourceTypeIDCloudNat                       ResourceTypeID = "cloud-nat"
	ResourceTypeIDCloudRouter                    ResourceTypeID = "cloud-router"
	ResourceTypeIDCloudRunService                ResourceTypeID = "cloud-run-service"
	ResourceTypeIDCloudSchedulerJob              ResourceTypeID = "cloud-scheduler-job"
	ResourceTypeIDCloudTasksQueue                ResourceTypeID = "cloud-tasks-queue"
	ResourceTypeIDCloudformationStack            ResourceTypeID = "cloudformation-stack"
	ResourceTypeIDCloudfrontDistribution         ResourceTypeID = "cloudfront-distribution"
	ResourceTypeIDCloudsqlInstance               ResourceTypeID = "cloudsql-instance"
	ResourceTypeIDCloudtrailTrail                ResourceTypeID = "cloudtrail-trail"
	ResourceTypeIDCloudwatchAlarm                ResourceTypeID = "cloudwatch-alarm"
	ResourceTypeIDCloudwatchLogGroup             ResourceTypeID = "cloudwatch-log-group"
	ResourceTypeIDCodebuildProject               ResourceTypeID = "codebuild-project"
	ResourceTypeIDCodepipelinePipeline           ResourceTypeID = "codepipeline-pipeline"
	ResourceTypeIDCognitoUserPool                ResourceTypeID = "cognito-user-pool"
	ResourceTypeIDCollection                     ResourceTypeID = "collection"
	ResourceTypeIDComposerEnvironment            ResourceTypeID = "composer-environment"
	ResourceTypeIDConnection                     ResourceTypeID = "connection"
	ResourceTypeIDContainer                      ResourceTypeID = "container"
	ResourceTypeIDContainerRegistry              ResourceTypeID = "container-registry"
	ResourceTypeIDCustomHostname                 ResourceTypeID = "custom-hostname"
	ResourceTypeIDCustomVoice                    ResourceTypeID = "custom-voice"
	ResourceTypeIDD1Database                     ResourceTypeID = "d1-database"
	ResourceTypeIDDatabricksApp                  ResourceTypeID = "databricks-app"
	ResourceTypeIDDatabricksCatalog              ResourceTypeID = "databricks-catalog"
	ResourceTypeIDDatabricksCluster              ResourceTypeID = "databricks-cluster"
	ResourceTypeIDDatabricksClusterPolicy        ResourceTypeID = "databricks-cluster-policy"
	ResourceTypeIDDatabricksDashboard            ResourceTypeID = "databricks-dashboard"
	ResourceTypeIDDatabricksFunction             ResourceTypeID = "databricks-function"
	ResourceTypeIDDatabricksJob                  ResourceTypeID = "databricks-job"
	ResourceTypeIDDatabricksModelVersion         ResourceTypeID = "databricks-model-version"
	ResourceTypeIDDatabricksNodeType             ResourceTypeID = "databricks-node-type"
	ResourceTypeIDDatabricksPipeline             ResourceTypeID = "databricks-pipeline"
	ResourceTypeIDDatabricksRegisteredModel      ResourceTypeID = "databricks-registered-model"
	ResourceTypeIDDatabricksRepo                 ResourceTypeID = "databricks-repo"
	ResourceTypeIDDatabricksSchema               ResourceTypeID = "databricks-schema"
	ResourceTypeIDDatabricksSecretScope          ResourceTypeID = "databricks-secret-scope"
	ResourceTypeIDDatabricksServingEndpoint      ResourceTypeID = "databricks-serving-endpoint"
	ResourceTypeIDDatabricksSQLQuery             ResourceTypeID = "databricks-sql-query"
	ResourceTypeIDDatabricksSQLWarehouse         ResourceTypeID = "databricks-sql-warehouse"
	ResourceTypeIDDatabricksTable                ResourceTypeID = "databricks-table"
	ResourceTypeIDDatabricksVectorSearchEndpoint ResourceTypeID = "databricks-vector-search-endpoint"
	ResourceTypeIDDatabricksVectorSearchIndex    ResourceTypeID = "databricks-vector-search-index"
	ResourceTypeIDDatabricksVolume               ResourceTypeID = "databricks-volume"
	ResourceTypeIDDatabricksWorkspaceObject      ResourceTypeID = "databricks-workspace-object"
	ResourceTypeIDDataflowJob                    ResourceTypeID = "dataflow-job"
	ResourceTypeIDDataset                        ResourceTypeID = "dataset"
	ResourceTypeIDDBSubnetGroup                  ResourceTypeID = "db-subnet-group"
	ResourceTypeIDDBUser                         ResourceTypeID = "db-user"
	ResourceTypeIDDedicatedInference             ResourceTypeID = "dedicated-inference"
	ResourceTypeIDDeployedModel                  ResourceTypeID = "deployed-model"
	ResourceTypeIDDeployment                     ResourceTypeID = "deployment"
	ResourceTypeIDDirectory                      ResourceTypeID = "directory"
	ResourceTypeIDDirectoryGroup                 ResourceTypeID = "directory-group"
	ResourceTypeIDDirectoryUser                  ResourceTypeID = "directory-user"
	ResourceTypeIDDNSRecord                      ResourceTypeID = "dns-record"
	ResourceTypeIDDockerContainer                ResourceTypeID = "docker-container"
	ResourceTypeIDDockerImage                    ResourceTypeID = "docker-image"
	ResourceTypeIDDockerNetwork                  ResourceTypeID = "docker-network"
	ResourceTypeIDDockerVolume                   ResourceTypeID = "docker-volume"
	ResourceTypeIDDocumentdbCluster              ResourceTypeID = "documentdb-cluster"
	ResourceTypeIDDoksCluster                    ResourceTypeID = "doks-cluster"
	ResourceTypeIDDomain                         ResourceTypeID = "domain"
	ResourceTypeIDDroplet                        ResourceTypeID = "droplet"
	ResourceTypeIDDurableObjectNamespace         ResourceTypeID = "durable-object-namespace"
	ResourceTypeIDDynamodbTable                  ResourceTypeID = "dynamodb-table"
	ResourceTypeIDEbsVolume                      ResourceTypeID = "ebs-volume"
	ResourceTypeIDEc2Instance                    ResourceTypeID = "ec2-instance"
	ResourceTypeIDEcrRepository                  ResourceTypeID = "ecr-repository"
	ResourceTypeIDEcsService                     ResourceTypeID = "ecs-service"
	ResourceTypeIDEfsFileSystem                  ResourceTypeID = "efs-file-system"
	ResourceTypeIDEksCluster                     ResourceTypeID = "eks-cluster"
	ResourceTypeIDElasticIP                      ResourceTypeID = "elastic-ip"
	ResourceTypeIDElasticacheCluster             ResourceTypeID = "elasticache-cluster"
	ResourceTypeIDEmailRoutingRule               ResourceTypeID = "email-routing-rule"
	ResourceTypeIDEmbedJob                       ResourceTypeID = "embed-job"
	ResourceTypeIDEndpoint                       ResourceTypeID = "endpoint"
	ResourceTypeIDEval                           ResourceTypeID = "eval"
	ResourceTypeIDEvaluation                     ResourceTypeID = "evaluation"
	ResourceTypeIDEventbridgeRule                ResourceTypeID = "eventbridge-rule"
	ResourceTypeIDFile                           ResourceTypeID = "file"
	ResourceTypeIDFileSearchDocument             ResourceTypeID = "file-search-document"
	ResourceTypeIDFileSearchStore                ResourceTypeID = "file-search-store"
	ResourceTypeIDFineTune                       ResourceTypeID = "fine-tune"
	ResourceTypeIDFineTuningJob                  ResourceTypeID = "fine-tuning-job"
	ResourceTypeIDFinetunedModel                 ResourceTypeID = "finetuned-model"
	ResourceTypeIDFirestoreDatabase              ResourceTypeID = "firestore-database"
	ResourceTypeIDFirewall                       ResourceTypeID = "firewall"
	ResourceTypeIDFirewallRule                   ResourceTypeID = "firewall-rule"
	ResourceTypeIDFloatingIP                     ResourceTypeID = "floating-ip"
	ResourceTypeIDFolder                         ResourceTypeID = "folder"
	ResourceTypeIDForwardingRule                 ResourceTypeID = "forwarding-rule"
	ResourceTypeIDGateway                        ResourceTypeID = "gateway"
	ResourceTypeIDGceDisk                        ResourceTypeID = "gce-disk"
	ResourceTypeIDGceInstance                    ResourceTypeID = "gce-instance"
	ResourceTypeIDGCPProject                     ResourceTypeID = "gcp-project"
	ResourceTypeIDGCPServiceAccount              ResourceTypeID = "gcp-service-account"
	ResourceTypeIDGcsBucket                      ResourceTypeID = "gcs-bucket"
	ResourceTypeIDGenAiAgent                     ResourceTypeID = "gen-ai-agent"
	ResourceTypeIDGenAiKnowledgeBase             ResourceTypeID = "gen-ai-knowledge-base"
	ResourceTypeIDGenAiModelRouter               ResourceTypeID = "gen-ai-model-router"
	ResourceTypeIDGkeCluster                     ResourceTypeID = "gke-cluster"
	ResourceTypeIDGlueDatabase                   ResourceTypeID = "glue-database"
	ResourceTypeIDGroqBatch                      ResourceTypeID = "groq-batch"
	ResourceTypeIDGroqFile                       ResourceTypeID = "groq-file"
	ResourceTypeIDGroqFineTuning                 ResourceTypeID = "groq-fine-tuning"
	ResourceTypeIDGroqModel                      ResourceTypeID = "groq-model"
	ResourceTypeIDHardware                       ResourceTypeID = "hardware"
	ResourceTypeIDHealthCheck                    ResourceTypeID = "health-check"
	ResourceTypeIDHealthcheck                    ResourceTypeID = "healthcheck"
	ResourceTypeIDHistoryItem                    ResourceTypeID = "history-item"
	ResourceTypeIDHyperdrive                     ResourceTypeID = "hyperdrive"
	ResourceTypeIDIamRole                        ResourceTypeID = "iam-role"
	ResourceTypeIDIamUser                        ResourceTypeID = "iam-user"
	ResourceTypeIDImage                          ResourceTypeID = "image"
	ResourceTypeIDInferenceBatch                 ResourceTypeID = "inference-batch"
	ResourceTypeIDInstance                       ResourceTypeID = "instance"
	ResourceTypeIDInstanceGroup                  ResourceTypeID = "instance-group"
	ResourceTypeIDInstanceTemplate               ResourceTypeID = "instance-template"
	ResourceTypeIDInternetGateway                ResourceTypeID = "internet-gateway"
	ResourceTypeIDInvitation                     ResourceTypeID = "invitation"
	ResourceTypeIDInvite                         ResourceTypeID = "invite"
	ResourceTypeIDIPAccessRule                   ResourceTypeID = "ip-access-rule"
	ResourceTypeIDIPAllocation                   ResourceTypeID = "ip-allocation"
	ResourceTypeIDJob                            ResourceTypeID = "job"
	ResourceTypeIDK8sCluster                     ResourceTypeID = "k8s-cluster"
	ResourceTypeIDK8sConfigmap                   ResourceTypeID = "k8s-configmap"
	ResourceTypeIDK8sCronjob                     ResourceTypeID = "k8s-cronjob"
	ResourceTypeIDK8sDaemonset                   ResourceTypeID = "k8s-daemonset"
	ResourceTypeIDK8sDeployment                  ResourceTypeID = "k8s-deployment"
	ResourceTypeIDK8sIngress                     ResourceTypeID = "k8s-ingress"
	ResourceTypeIDK8sJob                         ResourceTypeID = "k8s-job"
	ResourceTypeIDK8sNamespace                   ResourceTypeID = "k8s-namespace"
	ResourceTypeIDK8sNode                        ResourceTypeID = "k8s-node"
	ResourceTypeIDK8sPod                         ResourceTypeID = "k8s-pod"
	ResourceTypeIDK8sSecret                      ResourceTypeID = "k8s-secret"
	ResourceTypeIDK8sService                     ResourceTypeID = "k8s-service"
	ResourceTypeIDK8sStatefulset                 ResourceTypeID = "k8s-statefulset"
	ResourceTypeIDKafkaCluster                   ResourceTypeID = "kafka-cluster"
	ResourceTypeIDKafkaConsumerGroup             ResourceTypeID = "kafka-consumer-group"
	ResourceTypeIDKafkaTopic                     ResourceTypeID = "kafka-topic"
	ResourceTypeIDKapsuleCluster                 ResourceTypeID = "kapsule-cluster"
	ResourceTypeIDKinesisStream                  ResourceTypeID = "kinesis-stream"
	ResourceTypeIDKmsKey                         ResourceTypeID = "kms-key"
	ResourceTypeIDKmsKeyRing                     ResourceTypeID = "kms-key-ring"
	ResourceTypeIDKVNamespace                    ResourceTypeID = "kv-namespace"
	ResourceTypeIDLambdaFunction                 ResourceTypeID = "lambda-function"
	ResourceTypeIDLoadBalancer                   ResourceTypeID = "load-balancer"
	ResourceTypeIDLogSink                        ResourceTypeID = "log-sink"
	ResourceTypeIDLogpushJob                     ResourceTypeID = "logpush-job"
	ResourceTypeIDMachine                        ResourceTypeID = "machine"
	ResourceTypeIDManagedDatabase                ResourceTypeID = "managed-database"
	ResourceTypeIDManagedDB                      ResourceTypeID = "managed-db"
	ResourceTypeIDManagedEndpoint                ResourceTypeID = "managed-endpoint"
	ResourceTypeIDManagedKube                    ResourceTypeID = "managed-kube"
	ResourceTypeIDMediaAsset                     ResourceTypeID = "media-asset"
	ResourceTypeIDMember                         ResourceTypeID = "member"
	ResourceTypeIDMemcachedInstance              ResourceTypeID = "memcached-instance"
	ResourceTypeIDMemorystoreMemcached           ResourceTypeID = "memorystore-memcached"
	ResourceTypeIDMemorystoreRedis               ResourceTypeID = "memorystore-redis"
	ResourceTypeIDMessageBatch                   ResourceTypeID = "message-batch"
	ResourceTypeIDMistralAPIKey                  ResourceTypeID = "mistral-api-key"
	ResourceTypeIDMistralBatchJob                ResourceTypeID = "mistral-batch-job"
	ResourceTypeIDMistralFile                    ResourceTypeID = "mistral-file"
	ResourceTypeIDMistralFineTuningJob           ResourceTypeID = "mistral-fine-tuning-job"
	ResourceTypeIDMistralModel                   ResourceTypeID = "mistral-model"
	ResourceTypeIDMistralVoice                   ResourceTypeID = "mistral-voice"
	ResourceTypeIDModel                          ResourceTypeID = "model"
	ResourceTypeIDModelAPIKey                    ResourceTypeID = "model-api-key"
	ResourceTypeIDModelEndpoint                  ResourceTypeID = "model-endpoint"
	ResourceTypeIDMongodbDatabase                ResourceTypeID = "mongodb-database"
	ResourceTypeIDMqBroker                       ResourceTypeID = "mq-broker"
	ResourceTypeIDMskCluster                     ResourceTypeID = "msk-cluster"
	ResourceTypeIDMssqlDatabase                  ResourceTypeID = "mssql-database"
	ResourceTypeIDMysqlDatabase                  ResourceTypeID = "mysql-database"
	ResourceTypeIDNatGateway                     ResourceTypeID = "nat-gateway"
	ResourceTypeIDNeonAiGateway                  ResourceTypeID = "neon-ai-gateway"
	ResourceTypeIDNeonAuth                       ResourceTypeID = "neon-auth"
	ResourceTypeIDNeonAuthDomain                 ResourceTypeID = "neon-auth-domain"
	ResourceTypeIDNeonAuthOAuthProvider          ResourceTypeID = "neon-auth-oauth-provider"
	ResourceTypeIDNeonBranch                     ResourceTypeID = "neon-branch"
	ResourceTypeIDNeonBucket                     ResourceTypeID = "neon-bucket"
	ResourceTypeIDNeonCredential                 ResourceTypeID = "neon-credential"
	ResourceTypeIDNeonDataAPI                    ResourceTypeID = "neon-data-api"
	ResourceTypeIDNeonDatabase                   ResourceTypeID = "neon-database"
	ResourceTypeIDNeonEndpoint                   ResourceTypeID = "neon-endpoint"
	ResourceTypeIDNeonFunction                   ResourceTypeID = "neon-function"
	ResourceTypeIDNeonProject                    ResourceTypeID = "neon-project"
	ResourceTypeIDNeonRole                       ResourceTypeID = "neon-role"
	ResourceTypeIDNeonSnapshot                   ResourceTypeID = "neon-snapshot"
	ResourceTypeIDNeptuneCluster                 ResourceTypeID = "neptune-cluster"
	ResourceTypeIDNetlifyBuildHook               ResourceTypeID = "netlify-build-hook"
	ResourceTypeIDNetlifyDeploy                  ResourceTypeID = "netlify-deploy"
	ResourceTypeIDNetlifyDNSRecord               ResourceTypeID = "netlify-dns-record"
	ResourceTypeIDNetlifyDNSZone                 ResourceTypeID = "netlify-dns-zone"
	ResourceTypeIDNetlifyEnvVar                  ResourceTypeID = "netlify-env-var"
	ResourceTypeIDNetlifyForm                    ResourceTypeID = "netlify-form"
	ResourceTypeIDNetlifySite                    ResourceTypeID = "netlify-site"
	ResourceTypeIDNetwork                        ResourceTypeID = "network"
	ResourceTypeIDNfsShare                       ResourceTypeID = "nfs-share"
	ResourceTypeIDNotificationPolicy             ResourceTypeID = "notification-policy"
	ResourceTypeIDObjectStorageBucket            ResourceTypeID = "object-storage-bucket"
	ResourceTypeIDOpensearchCluster              ResourceTypeID = "opensearch-cluster"
	ResourceTypeIDOpensearchDomain               ResourceTypeID = "opensearch-domain"
	ResourceTypeIDOrganization                   ResourceTypeID = "organization"
	ResourceTypeIDOrganizationMembership         ResourceTypeID = "organization-membership"
	ResourceTypeIDOrganizationUser               ResourceTypeID = "organization-user"
	ResourceTypeIDPageRule                       ResourceTypeID = "page-rule"
	ResourceTypeIDPgDatabase                     ResourceTypeID = "pg-database"
	ResourceTypeIDPgSchema                       ResourceTypeID = "pg-schema"
	ResourceTypeIDPlacementGroup                 ResourceTypeID = "placement-group"
	ResourceTypeIDPrediction                     ResourceTypeID = "prediction"
	ResourceTypeIDPrimaryIP                      ResourceTypeID = "primary-ip"
	ResourceTypeIDPrivateNetwork                 ResourceTypeID = "private-network"
	ResourceTypeIDProject                        ResourceTypeID = "project"
	ResourceTypeIDProjectAPIKey                  ResourceTypeID = "project-api-key"
	ResourceTypeIDPronunciationDict              ResourceTypeID = "pronunciation-dict"
	ResourceTypeIDPronunciationDictionary        ResourceTypeID = "pronunciation-dictionary"
	ResourceTypeIDProvider                       ResourceTypeID = "provider"
	ResourceTypeIDPsBackup                       ResourceTypeID = "ps-backup"
	ResourceTypeIDPsBranch                       ResourceTypeID = "ps-branch"
	ResourceTypeIDPsDatabase                     ResourceTypeID = "ps-database"
	ResourceTypeIDPsDeployRequest                ResourceTypeID = "ps-deploy-request"
	ResourceTypeIDPsPassword                     ResourceTypeID = "ps-password"
	ResourceTypeIDPubsubSubscription             ResourceTypeID = "pubsub-subscription"
	ResourceTypeIDPubsubTopic                    ResourceTypeID = "pubsub-topic"
	ResourceTypeIDQueue                          ResourceTypeID = "queue"
	ResourceTypeIDQuota                          ResourceTypeID = "quota"
	ResourceTypeIDR2Bucket                       ResourceTypeID = "r2-bucket"
	ResourceTypeIDRateLimitRule                  ResourceTypeID = "rate-limit-rule"
	ResourceTypeIDRdbInstance                    ResourceTypeID = "rdb-instance"
	ResourceTypeIDRdsCluster                     ResourceTypeID = "rds-cluster"
	ResourceTypeIDRdsInstance                    ResourceTypeID = "rds-instance"
	ResourceTypeIDRedirectRule                   ResourceTypeID = "redirect-rule"
	ResourceTypeIDRedisInstance                  ResourceTypeID = "redis-instance"
	ResourceTypeIDRedshiftCluster                ResourceTypeID = "redshift-cluster"
	ResourceTypeIDReservedIP                     ResourceTypeID = "reserved-ip"
	ResourceTypeIDRole                           ResourceTypeID = "role"
	ResourceTypeIDRouteTable                     ResourceTypeID = "route-table"
	ResourceTypeIDRoute53HealthCheck             ResourceTypeID = "route53-health-check"
	ResourceTypeIDRoute53HostedZone              ResourceTypeID = "route53-hosted-zone"
	ResourceTypeIDRoute53RecordSet               ResourceTypeID = "route53-record-set"
	ResourceTypeIDS3Bucket                       ResourceTypeID = "s3-bucket"
	ResourceTypeIDSagemakerEndpoint              ResourceTypeID = "sagemaker-endpoint"
	ResourceTypeIDSecret                         ResourceTypeID = "secret"
	ResourceTypeIDSecretManagerSecret            ResourceTypeID = "secret-manager-secret"
	ResourceTypeIDSecretsManagerSecret           ResourceTypeID = "secrets-manager-secret"
	ResourceTypeIDSecurityGroup                  ResourceTypeID = "security-group"
	ResourceTypeIDServer                         ResourceTypeID = "server"
	ResourceTypeIDSnapshot                       ResourceTypeID = "snapshot"
	ResourceTypeIDSnsTopic                       ResourceTypeID = "sns-topic"
	ResourceTypeIDSpacesBucket                   ResourceTypeID = "spaces-bucket"
	ResourceTypeIDSpannerBackup                  ResourceTypeID = "spanner-backup"
	ResourceTypeIDSpannerDatabase                ResourceTypeID = "spanner-database"
	ResourceTypeIDSpannerInstance                ResourceTypeID = "spanner-instance"
	ResourceTypeIDSpectrumApplication            ResourceTypeID = "spectrum-application"
	ResourceTypeIDSqsQueue                       ResourceTypeID = "sqs-queue"
	ResourceTypeIDSSHKey                         ResourceTypeID = "ssh-key"
	ResourceTypeIDSSHTarget                      ResourceTypeID = "ssh-target"
	ResourceTypeIDSSLCertificate                 ResourceTypeID = "ssl-certificate"
	ResourceTypeIDSsmParameter                   ResourceTypeID = "ssm-parameter"
	ResourceTypeIDStaticIP                       ResourceTypeID = "static-ip"
	ResourceTypeIDStepFunction                   ResourceTypeID = "step-function"
	ResourceTypeIDSubnet                         ResourceTypeID = "subnet"
	ResourceTypeIDSupervisedFineTuningJob        ResourceTypeID = "supervised-fine-tuning-job"
	ResourceTypeIDTargetGroup                    ResourceTypeID = "target-group"
	ResourceTypeIDTraining                       ResourceTypeID = "training"
	ResourceTypeIDTranscript                     ResourceTypeID = "transcript"
	ResourceTypeIDTranscription                  ResourceTypeID = "transcription"
	ResourceTypeIDTransformation                 ResourceTypeID = "transformation"
	ResourceTypeIDTunedModel                     ResourceTypeID = "tuned-model"
	ResourceTypeIDTunnel                         ResourceTypeID = "tunnel"
	ResourceTypeIDTurnstileWidget                ResourceTypeID = "turnstile-widget"
	ResourceTypeIDTursoAPIToken                  ResourceTypeID = "turso-api-token"
	ResourceTypeIDTursoDatabase                  ResourceTypeID = "turso-database"
	ResourceTypeIDTursoDatabaseInstance          ResourceTypeID = "turso-database-instance"
	ResourceTypeIDTursoGroup                     ResourceTypeID = "turso-group"
	ResourceTypeIDTursoLocation                  ResourceTypeID = "turso-location"
	ResourceTypeIDTursoOrganizationInvite        ResourceTypeID = "turso-organization-invite"
	ResourceTypeIDTursoOrganizationMember        ResourceTypeID = "turso-organization-member"
	ResourceTypeIDUploadPreset                   ResourceTypeID = "upload-preset"
	ResourceTypeIDUser                           ResourceTypeID = "user"
	ResourceTypeIDUtApp                          ResourceTypeID = "ut-app"
	ResourceTypeIDUtFile                         ResourceTypeID = "ut-file"
	ResourceTypeIDVectorStore                    ResourceTypeID = "vector-store"
	ResourceTypeIDVectorizeIndex                 ResourceTypeID = "vectorize-index"
	ResourceTypeIDVercelDeployment               ResourceTypeID = "vercel-deployment"
	ResourceTypeIDVercelDomain                   ResourceTypeID = "vercel-domain"
	ResourceTypeIDVercelEnvVar                   ResourceTypeID = "vercel-env-var"
	ResourceTypeIDVercelProject                  ResourceTypeID = "vercel-project"
	ResourceTypeIDVercelTeam                     ResourceTypeID = "vercel-team"
	ResourceTypeIDVertexAiEndpoint               ResourceTypeID = "vertex-ai-endpoint"
	ResourceTypeIDVertexGeminiModel              ResourceTypeID = "vertex-gemini-model"
	ResourceTypeIDVocabulary                     ResourceTypeID = "vocabulary"
	ResourceTypeIDVoice                          ResourceTypeID = "voice"
	ResourceTypeIDVolume                         ResourceTypeID = "volume"
	ResourceTypeIDVpc                            ResourceTypeID = "vpc"
	ResourceTypeIDVpcNetwork                     ResourceTypeID = "vpc-network"
	ResourceTypeIDWafWebACL                      ResourceTypeID = "waf-web-acl"
	ResourceTypeIDWaitingRoom                    ResourceTypeID = "waiting-room"
	ResourceTypeIDWebhookEndpoint                ResourceTypeID = "webhook-endpoint"
	ResourceTypeIDWorker                         ResourceTypeID = "worker"
	ResourceTypeIDWorkerRoute                    ResourceTypeID = "worker-route"
	ResourceTypeIDWorkersAiModel                 ResourceTypeID = "workers-ai-model"
	ResourceTypeIDWorkflow                       ResourceTypeID = "workflow"
	ResourceTypeIDWorkspace                      ResourceTypeID = "workspace"
	ResourceTypeIDZone                           ResourceTypeID = "zone"
)

The values ResourceTypeID takes.

type ResourceTypeSummary

type ResourceTypeSummary struct {
	ID                    string                             `json:"id"`
	DisplayName           string                             `json:"displayName"`
	PluralDisplayName     *string                            `json:"pluralDisplayName,omitempty"`
	ParentTypeID          *string                            `json:"parentTypeId,omitempty"`
	SupportsCreate        bool                               `json:"supportsCreate"`
	AttachTargets         []ResourceTypeSummaryAttachTargets `json:"attachTargets,omitempty"`
	IsSSHHost             *bool                              `json:"isSshHost,omitempty"`
	SSHTunnelAttachSource *bool                              `json:"sshTunnelAttachSource,omitempty"`
	ShowInSidebar         *bool                              `json:"showInSidebar,omitempty"`
	AccountRoot           *bool                              `json:"accountRoot,omitempty"`
	// Schedulable: The type declares lifecycle start/stop actions, so its
	// resources can carry a sleep/wake schedule.
	Schedulable *bool `json:"schedulable,omitempty"`
}

ResourceTypeSummary is the `ResourceTypeSummary` schema.

type ResourceTypeSummaryAttachTargets

type ResourceTypeSummaryAttachTargets struct {
	PluginID       string  `json:"pluginId"`
	ResourceTypeID string  `json:"resourceTypeId"`
	MatchField     *string `json:"matchField,omitempty"`
	Verb           *string `json:"verb,omitempty"`
}

ResourceTypeSummaryAttachTargets is an object the spec declares inline.

type ResourcesAttachParams

type ResourcesAttachParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body AttachRequest
}

ResourcesAttachParams holds the parameters for `client.resources.attach`.

type ResourcesCostEstimateParams added in v0.43.0

type ResourcesCostEstimateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CostEstimateRequest
}

ResourcesCostEstimateParams holds the parameters for `client.resources.costEstimate`.

type ResourcesCostEstimateResponse added in v0.43.0

type ResourcesCostEstimateResponse struct {
	Estimate *CostEstimate `json:"estimate"`
}

ResourcesCostEstimateResponse is an object the spec declares inline.

type ResourcesCreateConfigParams

type ResourcesCreateConfigParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreateConfigRequest
}

ResourcesCreateConfigParams holds the parameters for `client.resources.createConfig`.

type ResourcesCreateParams

type ResourcesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreateResourceRequest
}

ResourcesCreateParams holds the parameters for `client.resources.create`.

type ResourcesCreatePricingParams

type ResourcesCreatePricingParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body CreatePricingRequest
}

ResourcesCreatePricingParams holds the parameters for `client.resources.createPricing`.

type ResourcesDeleteParams

type ResourcesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID            *string
	PluginID         PluginID
	TypeID           ResourceTypeID
	ResourceID       ResourceID
	AccountID        string
	ParentResourceID *ResourceID
}

ResourcesDeleteParams holds the parameters for `client.resources.delete`.

type ResourcesDescribeParams

type ResourcesDescribeParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body DescribeRequest
}

ResourcesDescribeParams holds the parameters for `client.resources.describe`.

type ResourcesDetailParams

type ResourcesDetailParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID            *string
	PluginID         PluginID
	TypeID           ResourceTypeID
	ResourceID       ResourceID
	AccountID        *string
	ParentResourceID *ResourceID
	// IncludePeerPanes: Default true. If false, peer panes are returned as
	// stubs.
	//
	// One of "true", "false".
	IncludePeerPanes *string
}

ResourcesDetailParams holds the parameters for `client.resources.detail`.

type ResourcesExportCredentialParams

type ResourcesExportCredentialParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body ExportCredentialRequest
}

ResourcesExportCredentialParams holds the parameters for `client.resources.exportCredential`.

type ResourcesExportTerraformParams added in v1.3.0

type ResourcesExportTerraformParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body ExportTerraformRequest
}

ResourcesExportTerraformParams holds the parameters for `client.resources.exportTerraform`.

type ResourcesFieldActionParams

type ResourcesFieldActionParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body FieldActionRequest
}

ResourcesFieldActionParams holds the parameters for `client.resources.fieldAction`.

type ResourcesImportYAMLParams

type ResourcesImportYAMLParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	// Body: the JSON request body.
	Body ImportYAMLRequest
}

ResourcesImportYAMLParams holds the parameters for `client.resources.importYaml`.

type ResourcesInvokeActionParams

type ResourcesInvokeActionParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body InvokeActionRequest
}

ResourcesInvokeActionParams holds the parameters for `client.resources.invokeAction`.

type ResourcesLogsParams

type ResourcesLogsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body LogsRequest
}

ResourcesLogsParams holds the parameters for `client.resources.logs`.

type ResourcesManifestCreateParams

type ResourcesManifestCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body ApplyManifestRequest
}

ResourcesManifestCreateParams holds the parameters for `client.resources.manifest.create`.

type ResourcesManifestGetParams

type ResourcesManifestGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID            *string
	PluginID         PluginID
	TypeID           ResourceTypeID
	ResourceID       ResourceID
	AccountID        string
	ParentResourceID *ResourceID
}

ResourcesManifestGetParams holds the parameters for `client.resources.manifest.get`.

type ResourcesManifestNamespace

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

ResourcesManifestNamespace is `client.resources.manifest`.

func (*ResourcesManifestNamespace) Create

Create: Apply an edited manifest to a resource

_Requires permission: `resources:write`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/manifest

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesManifestNamespace) Get

Get: Fetch the raw manifest (YAML/JSON) for a resource

_Requires permission: `resources:read`._

GET /api/org/{orgId}/resources/{pluginId}/{typeId}/manifest

Raises on 400: Bad request

Raises on 404: Not found

type ResourcesMetricsParams

type ResourcesMetricsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body MetricsRequest
}

ResourcesMetricsParams holds the parameters for `client.resources.metrics`.

type ResourcesNamespace

type ResourcesNamespace struct {

	// Manifest: `client.resources.manifest`.
	Manifest *ResourcesManifestNamespace
	// SecretVersions: `client.resources.secretVersions`.
	SecretVersions *ResourcesSecretVersionsNamespace
	// contains filtered or unexported fields
}

ResourcesNamespace is `client.resources`.

func (*ResourcesNamespace) Attach

func (n *ResourcesNamespace) Attach(ctx context.Context, params ResourcesAttachParams, opts ...RequestOption) (*OK, error)

Attach: Attach a resource onto another (e.g. disk → VM)

_Requires permission: `resources:write`._

POST /api/org/{orgId}/resources/attach

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) CostEstimate added in v0.43.0

CostEstimate: Estimated monthly cost of a configuration

Calls the plugin's `estimateCost` and returns a monthly total with the line items behind it. Price a proposed resource by passing `fields`, an existing one by passing `resourceId`, or a proposed change to an existing one by passing both — `fields` is merged over the resource's stored fields, so the caller only sends what changed. `estimate` is null when the plugin cannot price the configuration; that is not the same as an estimate of zero, and it should not be rendered as one.

_Requires permission: `resources:read`._

POST /api/org/{orgId}/resources/cost-estimate

Raises on 404: Not found

func (*ResourcesNamespace) Create

Create: Create a new resource via its plugin

_Requires permission: `resources:write`._

POST /api/org/{orgId}/resources/create

Raises on 400: Bad request

Raises on 404: Not found

Raises on 422: Blocked by the organization's tag policy: the submitted fields are missing a required tag (or carry a disallowed value). Retry with the `x-tag-policy-override: true` header if you hold `tag-policy:override`; both blocks and overrides are audit-logged.

func (*ResourcesNamespace) CreateConfig

CreateConfig: Get the dynamic create form for a resource type

Calls the plugin's `getCreateConfig`. The returned `CreateResourceConfig` is plugin-shaped — see `JsonObject`.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/resources/create-config

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) CreatePricing

CreatePricing: Pricing per size for a create form

_Requires permission: `resources:read`._

POST /api/org/{orgId}/resources/create-pricing

func (*ResourcesNamespace) Delete

func (n *ResourcesNamespace) Delete(ctx context.Context, params ResourcesDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete a resource via the plugin

_Requires permission: `resources:delete`._

DELETE /api/org/{orgId}/resources/{pluginId}/{typeId}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

func (*ResourcesNamespace) Describe

Describe: Get human-readable describe text for a resource

_Requires permission: `resources:read`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/describe

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) Detail

Detail: Full resource detail page payload

Performs a live `listResources` against the provider, falls back to DB on failure, and returns the plugin's `renderDetail` schema plus host-derived flags (SQL/KV/SSH availability, child resources, peer panes, etc).

_Requires permission: `resources:read`._

GET /api/org/{orgId}/resources/{pluginId}/{typeId}/detail

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) ExportCredential

ExportCredential: Export a credential file for a resource (one-time reveal)

_Requires permission: `secrets:read`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/export-credential

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) ExportTerraform added in v1.3.0

ExportTerraform: Generate Terraform HCL for a resource (and its direct children) from stored state

_Requires permission: `resources:read`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/export-terraform

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) FieldAction

FieldAction: Execute an in-form field action (e.g. generate an IAM role)

Calls the plugin's `executeFieldAction`. Returns `{ value }` to assign to the field; for `select` fields the optional `option` should be spliced into the options list so the new value can be displayed.

POST /api/org/{orgId}/resources/field-action

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) ImportYAML

ImportYAML: Bulk-import resources from YAML (kubectl apply -f equivalent)

_Requires permission: `resources:write`._

POST /api/org/{orgId}/resources/{pluginId}/import-yaml

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) InvokeAction

func (n *ResourcesNamespace) InvokeAction(ctx context.Context, params ResourcesInvokeActionParams, opts ...RequestOption) (*OK, error)

InvokeAction: Invoke a plugin-defined action on a resource

Actions the plugin marks `destructive: true` in its detail schema are blocked with `423` while an org change freeze is in effect.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/resources/invoke-action

Raises on 400: Bad request

Raises on 404: Not found

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

func (*ResourcesNamespace) Logs

Logs: Fetch logs for a resource

_Requires permission: `resources:read`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/logs

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) Metrics

Metrics: Fetch metric series for a resource

Historical points from the metrics store when the resource has accumulated any (resources pinned to a dashboard are polled continuously); otherwise the series are fetched live from the provider on demand.

_Requires permission: `resources:read`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/metrics

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) NoSQLCommand

NoSQLCommand: Run a NoSQL document-browser command (e.g. MongoDB shell)

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/resources/nosql-command

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesNamespace) PeerPanes

func (n *ResourcesNamespace) PeerPanes(ctx context.Context, params ResourcesPeerPanesParams, opts ...RequestOption) ([]PeerPane, error)

PeerPanes: Lazy-fetch peer-integration panes for a resource

_Requires permission: `resources:read`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/peer-panes

Raises on 404: Not found

func (*ResourcesNamespace) PickerResources

PickerResources: Fetch options for a `resource-picker` field

_Requires permission: `resources:read`._

POST /api/org/{orgId}/resources/picker-resources

func (*ResourcesNamespace) Update

Update: Update a resource via its plugin

Applies the supplied field changes upstream and persists the refreshed fields/display name to the DB. The body's `fields` map only carries the keys the caller actually changed. Blocked with `423` while an org change freeze is in effect (this is also the path that applies right-sizing recommendations); every applied update is audit-logged.

POST /api/org/{orgId}/resources/update

Raises on 400: Bad request

Raises on 404: Not found

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

type ResourcesNoSQLCommandParams

type ResourcesNoSQLCommandParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body NoSQLCommandRequest
}

ResourcesNoSQLCommandParams holds the parameters for `client.resources.nosqlCommand`.

type ResourcesNoSqlcommandResponse

type ResourcesNoSqlcommandResponse struct {
	Result JSONObject `json:"result"`
}

ResourcesNoSqlcommandResponse is an object the spec declares inline.

type ResourcesPeerPanesParams

type ResourcesPeerPanesParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body PeerPanesRequest
}

ResourcesPeerPanesParams holds the parameters for `client.resources.peerPanes`.

type ResourcesPickerResourcesParams

type ResourcesPickerResourcesParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body PickerResourcesRequest
}

ResourcesPickerResourcesParams holds the parameters for `client.resources.pickerResources`.

type ResourcesSecretVersionsAccessParams

type ResourcesSecretVersionsAccessParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body SecretAccessRequest
}

ResourcesSecretVersionsAccessParams holds the parameters for `client.resources.secretVersions.access`.

type ResourcesSecretVersionsAddParams

type ResourcesSecretVersionsAddParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body SecretAddRequest
}

ResourcesSecretVersionsAddParams holds the parameters for `client.resources.secretVersions.add`.

type ResourcesSecretVersionsGetParams

type ResourcesSecretVersionsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID            *string
	PluginID         PluginID
	TypeID           ResourceTypeID
	ResourceID       ResourceID
	AccountID        string
	ParentResourceID *ResourceID
}

ResourcesSecretVersionsGetParams holds the parameters for `client.resources.secretVersions.get`.

type ResourcesSecretVersionsModifyParams

type ResourcesSecretVersionsModifyParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID    *string
	PluginID PluginID
	TypeID   ResourceTypeID
	// Body: the JSON request body.
	Body SecretModifyRequest
}

ResourcesSecretVersionsModifyParams holds the parameters for `client.resources.secretVersions.modify`.

type ResourcesSecretVersionsNamespace

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

ResourcesSecretVersionsNamespace is `client.resources.secretVersions`.

func (*ResourcesSecretVersionsNamespace) Access

Access: Reveal the plaintext value of a specific version (one-time)

_Requires permission: `secrets:read`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/access

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesSecretVersionsNamespace) Add

Add: Add a new secret version

_Requires permission: `secrets:write`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/add

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesSecretVersionsNamespace) Get

Get: List secret versions for a versioned-secret resource

_Requires permission: `secrets:read`._

GET /api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions

Raises on 400: Bad request

Raises on 404: Not found

func (*ResourcesSecretVersionsNamespace) Modify

Modify: Enable/disable/destroy a secret version

_Requires permission: `secrets:write`._

POST /api/org/{orgId}/resources/{pluginId}/{typeId}/secret-versions/modify

Raises on 400: Bad request

Raises on 404: Not found

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

type ResourcesUpdateParams

type ResourcesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body UpdateResourceRequest
}

ResourcesUpdateParams holds the parameters for `client.resources.update`.

type RestoreDrill added in v1.36.0

type RestoreDrill struct {
	ID           string  `json:"id"`
	ResourceID   string  `json:"resourceId"`
	ResourceName *string `json:"resourceName"`
	AccountID    *string `json:"accountId"`
	AccountName  *string `json:"accountName"`
	// PerformedAt: When the drill was performed, which is **not** when it was
	// recorded — people write these up on Monday for a drill they ran on
	// Saturday, and every staleness computation uses this.
	PerformedAt string `json:"performedAt"`
	// Outcome: How the drill ended. Only `verified` counts as evidence the
	// backup works: a restore that produced a running system nobody looked
	// inside is exactly how a team discovers, mid-incident, that the dump had
	// been empty for months. `restored-unverified` is recorded because doing the
	// restore is worth recording, but it does not reset the clock.
	//
	// One of "verified", "restored-unverified", "failed", "blocked".
	Outcome string `json:"outcome"`
	// RtoMinutes: Measured wall-clock minutes. Null when the drill never got
	// that far; a blocked drill has no RTO, and an invented one would be the
	// most dangerous number on the page.
	RtoMinutes *int64 `json:"rtoMinutes"`
	// RestoredFrom: Snapshot id, S3 key, a date — free text.
	RestoredFrom      *string `json:"restoredFrom"`
	Notes             *string `json:"notes"`
	PerformedByUserID *string `json:"performedByUserId"`
	PerformedByName   *string `json:"performedByName"`
	CreatedAt         string  `json:"createdAt"`
}

RestoreDrill is the `RestoreDrill` schema.

type RestoreDrillCreate added in v1.36.0

type RestoreDrillCreate struct {
	ResourceID  string `json:"resourceId"`
	PerformedAt string `json:"performedAt"`
	// Outcome: How the drill ended. Only `verified` counts as evidence the
	// backup works: a restore that produced a running system nobody looked
	// inside is exactly how a team discovers, mid-incident, that the dump had
	// been empty for months. `restored-unverified` is recorded because doing the
	// restore is worth recording, but it does not reset the clock.
	//
	// One of "verified", "restored-unverified", "failed", "blocked".
	Outcome      string  `json:"outcome"`
	RtoMinutes   *int64  `json:"rtoMinutes,omitempty"`
	RestoredFrom *string `json:"restoredFrom,omitempty"`
	Notes        *string `json:"notes,omitempty"`
}

RestoreDrillCreate is the `RestoreDrillCreate` schema.

type RevertApplyResponse added in v1.17.0

type RevertApplyResponse struct {
	ChangeID   string     `json:"changeId"`
	ResourceID ResourceID `json:"resourceId"`
	// AppliedFields: The fields written, in plan order. Empty on a
	// reconciliation.
	AppliedFields []string   `json:"appliedFields"`
	Plan          RevertPlan `json:"plan"`
	RevertedAt    string     `json:"revertedAt"`
	// Reconciled: True when this request wrote nothing and instead recorded an
	// *earlier* interrupted attempt's write — the resource was already back, and
	// the event is now marked reverted. Nothing was sent to the provider by this
	// request.
	Reconciled *bool `json:"reconciled,omitempty"`
	// AuditRecorded: Present and `false` only when the audit entry could not be
	// written. The provider change still happened; its attribution did not reach
	// the audit table and was written to the server log instead. Attribution is
	// best-effort — nothing transactional spans a third-party cloud API and
	// Infrawrench's database.
	AuditRecorded *bool `json:"auditRecorded,omitempty"`
}

RevertApplyResponse is the `RevertApplyResponse` schema.

type RevertFieldPlan added in v1.17.0

type RevertFieldPlan struct {
	Field string `json:"field"`
	// RevertTo: The value a revert would write.
	RevertTo any `json:"revertTo,omitempty"`
	// ChangedTo: The value the recorded change set.
	ChangedTo any `json:"changedTo,omitempty"`
	// Current: The value the resource holds right now, read live.
	Current any               `json:"current,omitempty"`
	Status  RevertFieldStatus `json:"status"`
	// Reason: One sentence explaining the status.
	Reason string `json:"reason"`
}

RevertFieldPlan is the `RevertFieldPlan` schema.

type RevertFieldStatus added in v1.17.0

type RevertFieldStatus = string

RevertFieldStatus: What a revert would do to one field. `revertible` — the field still holds the value the change set, and the plugin's edit form can write the old one back. `already-reverted` — it is already at the old value; nothing to do. `conflict` — it changed again since, so reverting would discard the newer value. `not-writable` — outside the plugin's editable surface, or the old value is not something the edit form can submit. `provider-derived` — an `outputs.*` entry, which the provider computes rather than accepts.

const (
	RevertFieldStatusRevertible      RevertFieldStatus = "revertible"
	RevertFieldStatusAlreadyReverted RevertFieldStatus = "already-reverted"
	RevertFieldStatusConflict        RevertFieldStatus = "conflict"
	RevertFieldStatusNotWritable     RevertFieldStatus = "not-writable"
	RevertFieldStatusProviderDerived RevertFieldStatus = "provider-derived"
)

The values RevertFieldStatus takes.

type RevertPlan added in v1.17.0

type RevertPlan struct {
	// Fields: Every field of the recorded diff, in the order the event recorded
	// them.
	Fields []RevertFieldPlan `json:"fields"`
	// RevertibleFields: The keys that would actually be written.
	RevertibleFields []string `json:"revertibleFields"`
	Revertible       bool     `json:"revertible"`
	// BlockedReason: Why nothing would be written, or null when something would.
	BlockedReason *string `json:"blockedReason"`
}

RevertPlan is the `RevertPlan` schema.

type RevertPreviewResponse added in v1.17.0

type RevertPreviewResponse struct {
	ChangeID       string     `json:"changeId"`
	ResourceID     ResourceID `json:"resourceId"`
	DisplayName    string     `json:"displayName"`
	PluginID       string     `json:"pluginId"`
	ResourceTypeID string     `json:"resourceTypeId"`
	AccountID      string     `json:"accountId"`
	Plan           RevertPlan `json:"plan"`
	RevertedAt     *string    `json:"revertedAt"`
}

RevertPreviewResponse is the `RevertPreviewResponse` schema.

type RightsizingGetParams added in v0.29.0

type RightsizingGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Refresh: Bypass the short server-side cache and recompute now.
	//
	// One of "true", "false".
	Refresh *string
}

RightsizingGetParams holds the parameters for `client.rightsizing.get`.

Every field is optional; pass nil to take the defaults.

type RightsizingListResponse added in v0.29.0

type RightsizingListResponse struct {
	// Accounts: Groups sorted by account name.
	Accounts   []OversizedAccountGroup `json:"accounts"`
	TotalCount int64                   `json:"totalCount"`
	// WindowDays: Days of stored metrics the percentiles cover.
	WindowDays  int64  `json:"windowDays"`
	GeneratedAt string `json:"generatedAt"`
}

RightsizingListResponse is the `RightsizingListResponse` schema.

type RightsizingNamespace added in v0.29.0

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

RightsizingNamespace is `client.rightsizing`.

func (*RightsizingNamespace) Get added in v0.29.0

Get: List oversized resources with resize recommendations

Computes p95 CPU/memory utilisation over the last 14 days of stored metrics for every resource whose plugin declares right-sizing support, and matches under-utilised ones against the plugin's real size catalog (the create form's size options, live-priced). Each recommendation names the cheapest smaller size that still clears a headroom margin and quotes the monthly saving. Apply one by submitting `sizeFieldKey` with the recommended size id through the resource-update endpoint — which enforces change freezes and writes the audit trail. Results are cached for a few minutes; pass `refresh=true` to recompute.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/rightsizing

type Role

type Role struct {
	ID          string       `json:"id"`
	Name        string       `json:"name"`
	Description *string      `json:"description"`
	IsSystem    bool         `json:"isSystem"`
	SystemKey   *string      `json:"systemKey"`
	Permissions []Permission `json:"permissions"`
}

Role is the `Role` schema.

type RoleChangeRequest

type RoleChangeRequest struct {
	Role   *OrganizationRole `json:"role,omitempty"`
	RoleID *string           `json:"roleId,omitempty"`
}

RoleChangeRequest is the `RoleChangeRequest` schema.

type RoleCreateRequest

type RoleCreateRequest struct {
	Name        string       `json:"name"`
	Description *string      `json:"description,omitempty"`
	Permissions []Permission `json:"permissions"`
}

RoleCreateRequest is the `RoleCreateRequest` schema.

type RoleSummary

type RoleSummary struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Description *string `json:"description"`
	IsSystem    bool    `json:"isSystem"`
	SystemKey   *string `json:"systemKey"`
}

RoleSummary is the `RoleSummary` schema.

The API may send null in its place.

type RoleUpdateRequest

type RoleUpdateRequest struct {
	Name        *string      `json:"name,omitempty"`
	Description *string      `json:"description,omitempty"`
	Permissions []Permission `json:"permissions,omitempty"`
}

RoleUpdateRequest is the `RoleUpdateRequest` schema.

type Runbook added in v1.33.0

type Runbook struct {
	ID          string        `json:"id"`
	Name        string        `json:"name"`
	Description *string       `json:"description"`
	Steps       []RunbookStep `json:"steps"`
	// ResourceTypeIDs: Resource types this runbook is about; empty means it is
	// not scoped to a type. Used to answer 'which runbooks apply here',
	// **never** to restrict who may open it — a runbook nobody can find is the
	// failure this feature exists to fix.
	ResourceTypeIDs []string `json:"resourceTypeIds"`
	// TagKey: Optional tag narrowing. Matched case-insensitively.
	TagKey *string `json:"tagKey"`
	// TagValue: Required value of `tagKey`, matched exactly.
	TagValue *string `json:"tagValue"`
	// Enabled: Off keeps the row and hides it from the 'what applies here'
	// lookup. Retiring a runbook must not cost you the history of the runs
	// performed against it.
	Enabled         bool    `json:"enabled"`
	CreatedByUserID *string `json:"createdByUserId"`
	CreatedByName   *string `json:"createdByName"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
	RunCount        int64   `json:"runCount"`
	LastRunAt       *string `json:"lastRunAt"`
}

Runbook is the `Runbook` schema.

type RunbookCreate added in v1.33.0

type RunbookCreate struct {
	Name            string             `json:"name"`
	Description     *string            `json:"description,omitempty"`
	Steps           []RunbookStepInput `json:"steps,omitempty"`
	ResourceTypeIDs []string           `json:"resourceTypeIds,omitempty"`
	TagKey          *string            `json:"tagKey,omitempty"`
	TagValue        *string            `json:"tagValue,omitempty"`
	Enabled         *bool              `json:"enabled,omitempty"`
}

RunbookCreate is the `RunbookCreate` schema.

type RunbookList added in v1.33.0

type RunbookList struct {
	Runbooks []Runbook `json:"runbooks"`
}

RunbookList is the `RunbookList` schema.

type RunbookRun added in v1.33.0

type RunbookRun struct {
	ID        string `json:"id"`
	RunbookID string `json:"runbookId"`
	// RunbookName: The runbook's name when the run started.
	RunbookName string `json:"runbookName"`
	// Status: One of "running", "completed", "abandoned".
	Status string `json:"status"`
	// IncidentID: The incident this was performed under. Not a cascading
	// reference: deleting the incident must not delete the record that somebody
	// followed the failover procedure at 03:14.
	IncidentID      *string          `json:"incidentId"`
	StartedByUserID *string          `json:"startedByUserId"`
	StartedByName   *string          `json:"startedByName"`
	StartedAt       string           `json:"startedAt"`
	CompletedAt     *string          `json:"completedAt"`
	Summary         *string          `json:"summary"`
	Steps           []RunbookRunStep `json:"steps"`
}

RunbookRun is the `RunbookRun` schema.

type RunbookRunClose added in v1.33.0

type RunbookRunClose struct {
	// Status: One of "completed", "abandoned".
	Status  string  `json:"status"`
	Summary *string `json:"summary,omitempty"`
}

RunbookRunClose is the `RunbookRunClose` schema.

type RunbookRunList added in v1.33.0

type RunbookRunList struct {
	Runs []RunbookRun `json:"runs"`
}

RunbookRunList is the `RunbookRunList` schema.

type RunbookRunStart added in v1.33.0

type RunbookRunStart struct {
	IncidentID *string `json:"incidentId,omitempty"`
}

RunbookRunStart is the `RunbookRunStart` schema.

type RunbookRunStep added in v1.33.0

type RunbookRunStep struct {
	StepID string `json:"stepId"`
	// Title: The step's title **when the run started**. Copied rather than
	// joined: a runbook is edited between incidents, and a postmortem showing
	// today's wording against last month's run is not stale, it is quietly
	// wrong.
	Title string `json:"title"`
	// Kind: What the step does. Three kinds and not a scripting language: a
	// runbook is written by whoever is on call for whoever is on call next, and
	// the moment it needs a language it stops being written. `workflow` is the
	// escape hatch — anything genuinely automated belongs in a workflow, which
	// already has a sandbox, approvals, secrets and a history.
	//
	// One of "manual", "workflow", "link".
	Kind string `json:"kind"`
	// Status: One of "pending", "done", "skipped", "failed".
	Status string `json:"status"`
	// Note: What the responder typed — output, or why it was skipped.
	Note *string `json:"note"`
	// WorkflowRunID: The workflow run this step kicked off. Recorded here; the
	// run itself goes through the workflow routes with their own permission,
	// approvals and secrets.
	WorkflowRunID *string `json:"workflowRunId"`
	ActorUserID   *string `json:"actorUserId"`
	ActorName     *string `json:"actorName"`
	UpdatedAt     *string `json:"updatedAt"`
}

RunbookRunStep is the `RunbookRunStep` schema.

type RunbookStep added in v1.33.0

type RunbookStep struct {
	// ID: Stable across edits, because a run's per-step records reference it.
	// Reordering or retitling keeps the same step; deleting one orphans its
	// history, which is why runs keep the title they saw.
	ID string `json:"id"`
	// Kind: What the step does. Three kinds and not a scripting language: a
	// runbook is written by whoever is on call for whoever is on call next, and
	// the moment it needs a language it stops being written. `workflow` is the
	// escape hatch — anything genuinely automated belongs in a workflow, which
	// already has a sandbox, approvals, secrets and a history.
	//
	// One of "manual", "workflow", "link".
	Kind  string `json:"kind"`
	Title string `json:"title"`
	// Body: Markdown — the detail nobody remembers at 03:00.
	Body string `json:"body"`
	// WorkflowID: For `workflow` steps: which workflow the button runs.
	WorkflowID *string `json:"workflowId,omitempty"`
	// URL: For `link` steps. `https:` only.
	URL *string `json:"url,omitempty"`
}

RunbookStep is the `RunbookStep` schema.

type RunbookStepInput added in v1.33.0

type RunbookStepInput struct {
	// ID: Omitted for a new step; the server assigns one.
	ID *string `json:"id,omitempty"`
	// Kind: What the step does. Three kinds and not a scripting language: a
	// runbook is written by whoever is on call for whoever is on call next, and
	// the moment it needs a language it stops being written. `workflow` is the
	// escape hatch — anything genuinely automated belongs in a workflow, which
	// already has a sandbox, approvals, secrets and a history.
	//
	// One of "manual", "workflow", "link".
	Kind       string  `json:"kind"`
	Title      string  `json:"title"`
	Body       *string `json:"body,omitempty"`
	WorkflowID *string `json:"workflowId,omitempty"`
	URL        *string `json:"url,omitempty"`
}

RunbookStepInput is the `RunbookStepInput` schema.

type RunbookStepUpdate added in v1.33.0

type RunbookStepUpdate struct {
	// Status: One of "pending", "done", "skipped", "failed".
	Status string `json:"status"`
	// Note: Omitted leaves the note alone; `null` clears it.
	Note          *string `json:"note,omitempty"`
	WorkflowRunID *string `json:"workflowRunId,omitempty"`
}

RunbookStepUpdate is the `RunbookStepUpdate` schema.

type RunbookUpdate added in v1.33.0

type RunbookUpdate struct {
	Name            *string            `json:"name,omitempty"`
	Description     *string            `json:"description,omitempty"`
	Steps           []RunbookStepInput `json:"steps,omitempty"`
	ResourceTypeIDs []string           `json:"resourceTypeIds,omitempty"`
	TagKey          *string            `json:"tagKey,omitempty"`
	TagValue        *string            `json:"tagValue,omitempty"`
	Enabled         *bool              `json:"enabled,omitempty"`
}

RunbookUpdate is the `RunbookUpdate` schema.

type RunbooksCreateParams added in v1.33.0

type RunbooksCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *RunbookCreate
}

RunbooksCreateParams holds the parameters for `client.runbooks.create`.

Every field is optional; pass nil to take the defaults.

type RunbooksDeleteParams added in v1.33.0

type RunbooksDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	RunbookID string
}

RunbooksDeleteParams holds the parameters for `client.runbooks.delete`.

type RunbooksGetGetOrgOrgIDRunbooksRunbookIDParams added in v1.33.0

type RunbooksGetGetOrgOrgIDRunbooksRunbookIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	RunbookID string
}

RunbooksGetGetOrgOrgIDRunbooksRunbookIDParams holds the parameters for `client.runbooks.get.getOrgOrgIdRunbooksRunbookId`.

type RunbooksGetGetParams added in v1.33.0

type RunbooksGetGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

RunbooksGetGetParams holds the parameters for `client.runbooks.get.get`.

Every field is optional; pass nil to take the defaults.

type RunbooksGetNamespace added in v1.33.0

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

RunbooksGetNamespace is `client.runbooks.get`.

func (*RunbooksGetNamespace) Get added in v1.33.0

Get: List the organization's runbooks

Every runbook, with how many times each has been run and when it was last used. Reading takes `resources:read`: the person who can see the infrastructure is the person who will be woken up about it.

GET /api/org/{orgId}/runbooks

func (*RunbooksGetNamespace) GetOrgOrgIDRunbooksRunbookID added in v1.33.0

func (n *RunbooksGetNamespace) GetOrgOrgIDRunbooksRunbookID(ctx context.Context, params RunbooksGetGetOrgOrgIDRunbooksRunbookIDParams, opts ...RequestOption) (*Runbook, error)

GetOrgOrgIDRunbooksRunbookID: Get one runbook

GET /api/org/{orgId}/runbooks/{runbookId}

Raises on 404: Not found

type RunbooksNamespace added in v1.33.0

type RunbooksNamespace struct {

	// Get: `client.runbooks.get`.
	Get *RunbooksGetNamespace
	// Runs: `client.runbooks.runs`.
	Runs *RunbooksRunsNamespace
	// contains filtered or unexported fields
}

RunbooksNamespace is `client.runbooks`.

func (*RunbooksNamespace) Create added in v1.33.0

func (n *RunbooksNamespace) Create(ctx context.Context, params *RunbooksCreateParams, opts ...RequestOption) (*Runbook, error)

Create: Write a runbook

Editing takes `org:settings:write` — a procedure is an org-wide statement about how something is done, and it is read by strangers under pressure. Names are unique within an organization: two runbooks called "Failover" is how the wrong one gets run.

POST /api/org/{orgId}/runbooks

Raises on 400: Bad request

Raises on 409: Conflict

func (*RunbooksNamespace) Delete added in v1.33.0

func (n *RunbooksNamespace) Delete(ctx context.Context, params RunbooksDeleteParams, opts ...RequestOption) error

Delete: Delete a runbook

Takes its run history with it. To retire a procedure without losing the record of the runs performed against it, set `enabled` to false instead.

DELETE /api/org/{orgId}/runbooks/{runbookId}

Raises on 404: Not found

func (*RunbooksNamespace) Update added in v1.33.0

func (n *RunbooksNamespace) Update(ctx context.Context, params RunbooksUpdateParams, opts ...RequestOption) (*Runbook, error)

Update: Edit a runbook

Omitted fields are left alone. The result is validated **after** merging, so a patch that only changes the steps still has to produce a runbook that is valid as a whole. A step sent with its `id` keeps its identity, so a run in progress still matches it.

PATCH /api/org/{orgId}/runbooks/{runbookId}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

type RunbooksRunsCloseParams added in v1.33.0

type RunbooksRunsCloseParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	RunID string
	// Body: the JSON request body.
	Body *RunbookRunClose
}

RunbooksRunsCloseParams holds the parameters for `client.runbooks.runs.close`.

type RunbooksRunsCreateParams added in v1.33.0

type RunbooksRunsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	RunbookID string
	// Body: the JSON request body.
	Body *RunbookRunStart
}

RunbooksRunsCreateParams holds the parameters for `client.runbooks.runs.create`.

type RunbooksRunsGetOrgOrgIDRunbooksRunsRunIDParams added in v1.33.0

type RunbooksRunsGetOrgOrgIDRunbooksRunsRunIDParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	RunID string
}

RunbooksRunsGetOrgOrgIDRunbooksRunsRunIDParams holds the parameters for `client.runbooks.runs.getOrgOrgIdRunbooksRunsRunId`.

type RunbooksRunsGetParams added in v1.33.0

type RunbooksRunsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	RunbookID  *string
	IncidentID *string
	Limit      *int64
}

RunbooksRunsGetParams holds the parameters for `client.runbooks.runs.get`.

Every field is optional; pass nil to take the defaults.

type RunbooksRunsNamespace added in v1.33.0

type RunbooksRunsNamespace struct {

	// Steps: `client.runbooks.runs.steps`.
	Steps *RunbooksRunsStepsNamespace
	// contains filtered or unexported fields
}

RunbooksRunsNamespace is `client.runbooks.runs`.

func (*RunbooksRunsNamespace) Close added in v1.33.0

Close: Close a run out

Closing does **not** settle outstanding steps. A run completed with three steps still pending is a true and useful record — it says the incident ended before the checklist did — and quietly marking them done would erase the one thing a postmortem wants to know.

POST /api/org/{orgId}/runbooks/runs/{runId}/close

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

func (*RunbooksRunsNamespace) Create added in v1.33.0

Create: Start performing a runbook

Copies every step's title and kind into the run, so the record of what somebody was asked to do survives the runbook being rewritten next week.

Takes `resources:read`, like ticking a step: performing a checklist is not an act of configuration, and requiring an admin mid-incident is how a team stops using it. Deliberately not deduplicated against a run already in progress — performing the failover twice in one incident is a real thing, and refusing the second would mean it goes unrecorded rather than not happening.

POST /api/org/{orgId}/runbooks/{runbookId}/runs

Raises on 400: Bad request

Raises on 404: Not found

func (*RunbooksRunsNamespace) Get added in v1.33.0

Get: List runbook runs

Newest first, optionally narrowed to one runbook or one incident.

GET /api/org/{orgId}/runbooks/runs

Raises on 400: Bad request

func (*RunbooksRunsNamespace) GetOrgOrgIDRunbooksRunsRunID added in v1.33.0

func (n *RunbooksRunsNamespace) GetOrgOrgIDRunbooksRunsRunID(ctx context.Context, params RunbooksRunsGetOrgOrgIDRunbooksRunsRunIDParams, opts ...RequestOption) (*RunbookRun, error)

GetOrgOrgIDRunbooksRunsRunID: Get one runbook run

GET /api/org/{orgId}/runbooks/runs/{runId}

Raises on 404: Not found

type RunbooksRunsStepsNamespace added in v1.33.0

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

RunbooksRunsStepsNamespace is `client.runbooks.runs.steps`.

func (*RunbooksRunsStepsNamespace) Update added in v1.33.0

Update: Tick a step

One targeted update on one row, so two responders working the same incident can tick different steps at the same moment without either losing the other's work.

A closed run refuses updates, and reopening is not offered: a run is a record of what happened. Start another run to record another attempt.

PATCH /api/org/{orgId}/runbooks/runs/{runId}/steps/{stepId}

Raises on 400: Bad request

Raises on 404: Not found

type RunbooksRunsStepsUpdateParams added in v1.33.0

type RunbooksRunsStepsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID  *string
	RunID  string
	StepID string
	// Body: the JSON request body.
	Body *RunbookStepUpdate
}

RunbooksRunsStepsUpdateParams holds the parameters for `client.runbooks.runs.steps.update`.

type RunbooksUpdateParams added in v1.33.0

type RunbooksUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	RunbookID string
	// Body: the JSON request body.
	Body *RunbookUpdate
}

RunbooksUpdateParams holds the parameters for `client.runbooks.update`.

type SFTPDeleteParams

type SFTPDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SFTPDeleteRequest
}

SFTPDeleteParams holds the parameters for `client.sftp.delete`.

type SFTPDeleteRequest

type SFTPDeleteRequest struct {
	AccountID   string  `json:"accountId"`
	Path        string  `json:"path"`
	SSHKeyID    *string `json:"sshKeyId,omitempty"`
	SSHHost     *string `json:"sshHost,omitempty"`
	SSHUsername *string `json:"sshUsername,omitempty"`
	IsDir       bool    `json:"isDir"`
}

SFTPDeleteRequest is the `SftpDeleteRequest` schema.

Spec schema: `SftpDeleteRequest`.

type SFTPDownloadParams

type SFTPDownloadParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	AccountID string
	// Paths: JSON-encoded array of remote paths
	Paths       string
	BasePath    *string
	SSHKeyID    *string
	SSHHost     *string
	SSHUsername *string
}

SFTPDownloadParams holds the parameters for `client.sftp.download`.

type SFTPEntry

type SFTPEntry struct {
	// Key: Absolute remote path.
	Key          string  `json:"key"`
	Name         string  `json:"name"`
	Size         float64 `json:"size"`
	LastModified string  `json:"lastModified"`
	IsDirectory  bool    `json:"isDirectory"`
	ContentType  *string `json:"contentType,omitempty"`
}

SFTPEntry is the `SftpEntry` schema.

Spec schema: `SftpEntry`.

type SFTPListParams

type SFTPListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SFTPListRequest
}

SFTPListParams holds the parameters for `client.sftp.list`.

type SFTPListRequest

type SFTPListRequest struct {
	AccountID   string  `json:"accountId"`
	Path        string  `json:"path"`
	SSHKeyID    *string `json:"sshKeyId,omitempty"`
	SSHHost     *string `json:"sshHost,omitempty"`
	SSHUsername *string `json:"sshUsername,omitempty"`
}

SFTPListRequest is the `SftpListRequest` schema.

Spec schema: `SftpListRequest`.

type SFTPMkdirParams

type SFTPMkdirParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SFTPPathRequest
}

SFTPMkdirParams holds the parameters for `client.sftp.mkdir`.

type SFTPNamespace

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

SFTPNamespace is `client.sftp`.

func (*SFTPNamespace) Delete

func (n *SFTPNamespace) Delete(ctx context.Context, params SFTPDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete a file or directory over SFTP

_Requires permission: `storage:write`._

POST /api/org/{orgId}/sftp/delete

Raises on 404: Not found

Raises on 500: Server error

func (*SFTPNamespace) Download

func (n *SFTPNamespace) Download(ctx context.Context, params SFTPDownloadParams, opts ...RequestOption) (io.ReadCloser, error)

Download: Download one or many files via SFTP (zipped if more than one)

_Requires permission: `storage:read`._

GET /api/org/{orgId}/v1/sftp/download

Raises on 400: Bad request

Raises on 404: Not found

Raises on 500: Server error

func (*SFTPNamespace) List

func (n *SFTPNamespace) List(ctx context.Context, params SFTPListParams, opts ...RequestOption) ([]SFTPEntry, error)

List: List a directory over SFTP

_Requires permission: `storage:read`._

POST /api/org/{orgId}/sftp/list

Raises on 404: Not found

Raises on 500: Server error

func (*SFTPNamespace) Mkdir

func (n *SFTPNamespace) Mkdir(ctx context.Context, params SFTPMkdirParams, opts ...RequestOption) (*OK, error)

Mkdir: Create a directory over SFTP

_Requires permission: `storage:write`._

POST /api/org/{orgId}/sftp/mkdir

Raises on 404: Not found

Raises on 500: Server error

func (*SFTPNamespace) Upload

func (n *SFTPNamespace) Upload(ctx context.Context, params SFTPUploadParams, opts ...RequestOption) (*OK, error)

Upload: Upload a file via SFTP

_Requires permission: `storage:write`._

POST /api/org/{orgId}/v1/sftp/upload

Raises on 400: Bad request

Raises on 404: Not found

type SFTPPathRequest

type SFTPPathRequest struct {
	AccountID   string  `json:"accountId"`
	Path        string  `json:"path"`
	SSHKeyID    *string `json:"sshKeyId,omitempty"`
	SSHHost     *string `json:"sshHost,omitempty"`
	SSHUsername *string `json:"sshUsername,omitempty"`
}

SFTPPathRequest is the `SftpPathRequest` schema.

Spec schema: `SftpPathRequest`.

type SFTPUploadForm

type SFTPUploadForm struct {
	AccountID   string    `json:"accountId"`
	RemotePath  string    `json:"remotePath"`
	File        io.Reader `json:"file"`
	SSHKeyID    *string   `json:"sshKeyId,omitempty"`
	SSHHost     *string   `json:"sshHost,omitempty"`
	SSHUsername *string   `json:"sshUsername,omitempty"`
}

SFTPUploadForm is the `SftpUploadForm` schema.

Spec schema: `SftpUploadForm`.

type SFTPUploadParams

type SFTPUploadParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: sent as `multipart/form-data`; the `io.Reader` field is the file.
	Body SFTPUploadForm
}

SFTPUploadParams holds the parameters for `client.sftp.upload`.

type SQLEstimateParams

type SQLEstimateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SQLEstimateRequest
}

SQLEstimateParams holds the parameters for `client.sql.estimate`.

type SQLEstimateRequest

type SQLEstimateRequest struct {
	AccountID  string     `json:"accountId"`
	ResourceID ResourceID `json:"resourceId"`
	SQL        string     `json:"sql"`
}

SQLEstimateRequest is the `SqlEstimateRequest` schema.

Spec schema: `SqlEstimateRequest`.

type SQLExecuteParams

type SQLExecuteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SQLExecuteRequest
}

SQLExecuteParams holds the parameters for `client.sql.execute`.

type SQLExecuteRequest

type SQLExecuteRequest struct {
	AccountID      string      `json:"accountId"`
	ResourceID     *ResourceID `json:"resourceId,omitempty"`
	ResourceTypeID *string     `json:"resourceTypeId,omitempty"`
	SQL            string      `json:"sql"`
	Params         []any       `json:"params,omitempty"`
}

SQLExecuteRequest is the `SqlExecuteRequest` schema.

Spec schema: `SqlExecuteRequest`.

type SQLExecuteResponse

type SQLExecuteResponse struct {
	AffectedRows int64 `json:"affectedRows"`
}

SQLExecuteResponse is the `SqlExecuteResponse` schema.

Spec schema: `SqlExecuteResponse`.

type SQLNamespace

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

SQLNamespace is `client.sql`.

func (*SQLNamespace) Estimate

func (n *SQLNamespace) Estimate(ctx context.Context, params SQLEstimateParams, opts ...RequestOption) (JSONObject, error)

Estimate: Dry-run cost estimate (e.g. BigQuery byte scan)

_Requires permission: `resources:read`._

POST /api/org/{orgId}/sql/estimate

Raises on 400: Bad request

Raises on 404: Not found

func (*SQLNamespace) Execute

func (n *SQLNamespace) Execute(ctx context.Context, params SQLExecuteParams, opts ...RequestOption) (*SQLExecuteResponse, error)

Execute: Run an INSERT/UPDATE/DELETE/DDL statement

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/sql/execute

Raises on 400: Bad request

Raises on 404: Not found

func (*SQLNamespace) Query

func (n *SQLNamespace) Query(ctx context.Context, params SQLQueryParams, opts ...RequestOption) (any, error)

Query: Run a read-only SQL query

Routes to the right driver: REST `executeQuery` (BigQuery, Databricks), per-resource SQL driver (Neon, Turso) or account-level SQL driver (Postgres, MySQL).

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/sql/query

Raises on 400: Bad request

Raises on 404: Not found

type SQLQueryParams

type SQLQueryParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SQLQueryRequest
}

SQLQueryParams holds the parameters for `client.sql.query`.

type SQLQueryRequest

type SQLQueryRequest struct {
	AccountID      string      `json:"accountId"`
	ResourceID     *ResourceID `json:"resourceId,omitempty"`
	ResourceTypeID *string     `json:"resourceTypeId,omitempty"`
	SQL            string      `json:"sql"`
}

SQLQueryRequest is the `SqlQueryRequest` schema.

Spec schema: `SqlQueryRequest`.

type SQLQueryResponse

type SQLQueryResponse struct {
	Rows       []JSONObject `json:"rows"`
	DurationMs *int64       `json:"durationMs,omitempty"`
}

SQLQueryResponse is the `SqlQueryResponse` schema.

Spec schema: `SqlQueryResponse`.

type SSHExecRequest

type SSHExecRequest struct {
	SSHHost  string `json:"sshHost"`
	SSHPort  int64  `json:"sshPort"`
	SSHUser  string `json:"sshUser"`
	SSHKeyID string `json:"sshKeyId"`
	Command  string `json:"command"`
}

SSHExecRequest is the `SshExecRequest` schema.

Spec schema: `SshExecRequest`.

type SSHExecResponse

type SSHExecResponse struct {
	Stdout string  `json:"stdout"`
	Stderr *string `json:"stderr,omitempty"`
	Code   int64   `json:"code"`
}

SSHExecResponse is the `SshExecResponse` schema.

Spec schema: `SshExecResponse`.

type SSHFanoutHostResult added in v0.30.0

type SSHFanoutHostResult struct {
	// Kind: One of "account", "resource".
	Kind     string `json:"kind"`
	TargetID string `json:"targetId"`
	Label    string `json:"label"`
	// Status: One of "done", "error", "blocked".
	Status       string                           `json:"status"`
	ExitCode     *int64                           `json:"exitCode"`
	Stdout       string                           `json:"stdout"`
	Stderr       string                           `json:"stderr"`
	Error        *string                          `json:"error,omitempty"`
	DurationMs   float64                          `json:"durationMs"`
	HostKeyTrust *SshfanoutHostResultHostKeyTrust `json:"hostKeyTrust,omitempty"`
}

SSHFanoutHostResult is the `SshFanoutHostResult` schema.

Spec schema: `SshFanoutHostResult`.

type SSHFanoutNamespace added in v0.30.0

type SSHFanoutNamespace struct {

	// Snippets: `client.sshFanout.snippets`.
	Snippets *SSHFanoutSnippetsNamespace
	// contains filtered or unexported fields
}

SSHFanoutNamespace is `client.sshFanout`.

func (*SSHFanoutNamespace) Run added in v0.30.0

Run: Run one command across many SSH hosts

Executes the command on every selected target under a concurrency cap (default 8, max 16). Per-host results carry stdout, stderr, and exit code; transport failures (unreachable, untrusted host key, blocked internal host) are per-host too. Resource targets need `sshKeyId` (an org SSH key owned by the caller). Blocked with HTTP 423 while a change freeze is in effect; audit-logged.

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/ssh-fanout/run

Raises on 400: Bad request

Raises on 423: Blocked by an active change freeze. Retry with the `x-change-freeze-override: true` header if you hold `freezes:override`; both blocks and overrides are audit-logged.

func (*SSHFanoutNamespace) Targets added in v0.30.0

Targets: List SSH-capable fan-out targets

Every SSH-capable target in the org: `ssh` plugin accounts (native credentials) plus resources whose type declares an sshEndpoint with a resolvable host (EC2 instances, droplets, Hetzner servers, …).

_Requires permission: `resources:read`._

GET /api/org/{orgId}/ssh-fanout/targets

type SSHFanoutRunParams added in v0.30.0

type SSHFanoutRunParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SSHFanoutRunRequest
}

SSHFanoutRunParams holds the parameters for `client.sshFanout.run`.

type SSHFanoutRunRequest added in v0.30.0

type SSHFanoutRunRequest struct {
	Command     string                       `json:"command"`
	Targets     []SshfanoutRunRequestTargets `json:"targets"`
	SSHKeyID    *string                      `json:"sshKeyId,omitempty"`
	Username    *string                      `json:"username,omitempty"`
	Concurrency *int64                       `json:"concurrency,omitempty"`
}

SSHFanoutRunRequest is the `SshFanoutRunRequest` schema.

Spec schema: `SshFanoutRunRequest`.

type SSHFanoutRunResponse added in v0.30.0

type SSHFanoutRunResponse struct {
	Results []SSHFanoutHostResult `json:"results"`
}

SSHFanoutRunResponse is the `SshFanoutRunResponse` schema.

Spec schema: `SshFanoutRunResponse`.

type SSHFanoutSnippetsCreateParams added in v0.30.0

type SSHFanoutSnippetsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SSHSnippetInput
}

SSHFanoutSnippetsCreateParams holds the parameters for `client.sshFanout.snippets.create`.

type SSHFanoutSnippetsDeleteParams added in v0.30.0

type SSHFanoutSnippetsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

SSHFanoutSnippetsDeleteParams holds the parameters for `client.sshFanout.snippets.delete`.

type SSHFanoutSnippetsGetParams added in v0.30.0

type SSHFanoutSnippetsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SSHFanoutSnippetsGetParams holds the parameters for `client.sshFanout.snippets.get`.

Every field is optional; pass nil to take the defaults.

type SSHFanoutSnippetsNamespace added in v0.30.0

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

SSHFanoutSnippetsNamespace is `client.sshFanout.snippets`.

func (*SSHFanoutSnippetsNamespace) Create added in v0.30.0

Create: Save a command snippet

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/ssh-fanout/snippets

Raises on 400: Bad request

Raises on 409: Conflict

func (*SSHFanoutSnippetsNamespace) Delete added in v0.30.0

Delete: Delete a saved command snippet

_Requires permission: `resources:execute`._

DELETE /api/org/{orgId}/ssh-fanout/snippets/{id}

Raises on 404: Not found

func (*SSHFanoutSnippetsNamespace) Get added in v0.30.0

Get: List saved command snippets

Org-shared saved commands for reuse from the fan-out screen and CLI.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/ssh-fanout/snippets

func (*SSHFanoutSnippetsNamespace) Update added in v0.30.0

Update: Update a saved command snippet

_Requires permission: `resources:execute`._

PUT /api/org/{orgId}/ssh-fanout/snippets/{id}

Raises on 400: Bad request

Raises on 404: Not found

type SSHFanoutSnippetsUpdateParams added in v0.30.0

type SSHFanoutSnippetsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body SSHSnippetInput
}

SSHFanoutSnippetsUpdateParams holds the parameters for `client.sshFanout.snippets.update`.

type SSHFanoutTarget added in v0.30.0

type SSHFanoutTarget struct {
	// Kind: One of "account", "resource".
	Kind            string   `json:"kind"`
	ID              string   `json:"id"`
	AccountID       string   `json:"accountId"`
	Label           string   `json:"label"`
	PluginID        string   `json:"pluginId"`
	ResourceTypeID  *string  `json:"resourceTypeId,omitempty"`
	Host            *string  `json:"host,omitempty"`
	DefaultUsername *string  `json:"defaultUsername,omitempty"`
	Running         bool     `json:"running"`
	NeedsKey        bool     `json:"needsKey"`
	Tags            []string `json:"tags"`
}

SSHFanoutTarget is the `SshFanoutTarget` schema.

Spec schema: `SshFanoutTarget`.

type SSHFanoutTargetsParams added in v0.30.0

type SSHFanoutTargetsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SSHFanoutTargetsParams holds the parameters for `client.sshFanout.targets`.

Every field is optional; pass nil to take the defaults.

type SSHFanoutTargetsResponse added in v0.30.0

type SSHFanoutTargetsResponse struct {
	Targets []SSHFanoutTarget `json:"targets"`
}

SSHFanoutTargetsResponse is the `SshFanoutTargetsResponse` schema.

Spec schema: `SshFanoutTargetsResponse`.

type SSHKey

type SSHKey struct {
	ID          string     `json:"id"`
	Name        string     `json:"name"`
	KeyType     SSHKeyType `json:"keyType"`
	IsImported  bool       `json:"isImported"`
	Fingerprint *string    `json:"fingerprint"`
	PublicKey   string     `json:"publicKey"`
	UserID      string     `json:"userId"`
	OwnerEmail  string     `json:"ownerEmail"`
	OwnerName   string     `json:"ownerName"`
	CreatedAt   string     `json:"createdAt"`
}

SSHKey is the `SshKey` schema.

Spec schema: `SshKey`.

type SSHKeyType

type SSHKeyType = string

SSHKeyType is the `SshKeyType` schema.

Spec schema: `SshKeyType`.

const (
	SSHKeyTypeSSHRsa                        SSHKeyType = "ssh-rsa"
	SSHKeyTypeSSHEd25519                    SSHKeyType = "ssh-ed25519"
	SSHKeyTypeSSHDss                        SSHKeyType = "ssh-dss"
	SSHKeyTypeEcdsaSha2Nistp256             SSHKeyType = "ecdsa-sha2-nistp256"
	SSHKeyTypeEcdsaSha2Nistp384             SSHKeyType = "ecdsa-sha2-nistp384"
	SSHKeyTypeEcdsaSha2Nistp521             SSHKeyType = "ecdsa-sha2-nistp521"
	SSHKeyTypeSkSSHEd25519OpensshCom        SSHKeyType = "sk-ssh-ed25519@openssh.com"
	SSHKeyTypeSkEcdsaSha2Nistp256OpensshCom SSHKeyType = "sk-ecdsa-sha2-nistp256@openssh.com"
)

The values SSHKeyType takes.

type SSHKeysCreateParams

type SSHKeysCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body GenerateSSHKeyRequest
}

SSHKeysCreateParams holds the parameters for `client.sshKeys.create`.

type SSHKeysDeleteParams

type SSHKeysDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

SSHKeysDeleteParams holds the parameters for `client.sshKeys.delete`.

type SSHKeysImportParams

type SSHKeysImportParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body ImportSSHKeyRequest
}

SSHKeysImportParams holds the parameters for `client.sshKeys.import`.

type SSHKeysListParams

type SSHKeysListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SSHKeysListParams holds the parameters for `client.sshKeys.list`.

Every field is optional; pass nil to take the defaults.

type SSHKeysNamespace

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

SSHKeysNamespace is `client.sshKeys`.

func (*SSHKeysNamespace) Create

Create: Generate a new Ed25519 keypair (private key returned once)

_Requires permission: `ssh-keys:write`._

POST /api/org/{orgId}/ssh-keys

Raises on 400: Bad request

func (*SSHKeysNamespace) Delete

func (n *SSHKeysNamespace) Delete(ctx context.Context, params SSHKeysDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete an SSH key (owner only)

_Requires permission: `ssh-keys:write`._

DELETE /api/org/{orgId}/ssh-keys/{id}

func (*SSHKeysNamespace) Import

Import: Import an existing public key

_Requires permission: `ssh-keys:write`._

POST /api/org/{orgId}/ssh-keys/import

Raises on 400: Bad request

func (*SSHKeysNamespace) List

func (n *SSHKeysNamespace) List(ctx context.Context, params *SSHKeysListParams, opts ...RequestOption) ([]SSHKey, error)

List: List org SSH keys

_Requires permission: `ssh-keys:read`._

GET /api/org/{orgId}/ssh-keys

func (*SSHKeysNamespace) Sign added in v1.30.0

Sign: Sign an SSH auth challenge with a cloud-held key (the cloud as an SSH agent)

Signs one publickey-authentication challenge with a server-generated org key whose private half never leaves Infrawrench Cloud. Requires the `resources:execute` permission — producing an auth signature is the same authority as opening a shell. Imported keys cannot sign (only their public half is stored). Every call is audited.

POST /api/org/{orgId}/ssh-keys/{id}/sign

Raises on 400: Bad request

Raises on 404: Not found

type SSHKeysSignParams added in v1.30.0

type SSHKeysSignParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body SignSSHKeyRequest
}

SSHKeysSignParams holds the parameters for `client.sshKeys.sign`.

type SSHSignAlgorithm added in v1.30.0

type SSHSignAlgorithm = string

SSHSignAlgorithm is the `SshSignAlgorithm` schema.

Spec schema: `SshSignAlgorithm`.

const (
	SSHSignAlgorithmSSHEd25519        SSHSignAlgorithm = "ssh-ed25519"
	SSHSignAlgorithmSSHRsa            SSHSignAlgorithm = "ssh-rsa"
	SSHSignAlgorithmRsaSha2256        SSHSignAlgorithm = "rsa-sha2-256"
	SSHSignAlgorithmRsaSha2512        SSHSignAlgorithm = "rsa-sha2-512"
	SSHSignAlgorithmEcdsaSha2Nistp256 SSHSignAlgorithm = "ecdsa-sha2-nistp256"
	SSHSignAlgorithmEcdsaSha2Nistp384 SSHSignAlgorithm = "ecdsa-sha2-nistp384"
	SSHSignAlgorithmEcdsaSha2Nistp521 SSHSignAlgorithm = "ecdsa-sha2-nistp521"
)

The values SSHSignAlgorithm takes.

type SSHSnippet added in v0.30.0

type SSHSnippet struct {
	ID          string  `json:"id"`
	Name        string  `json:"name"`
	Command     string  `json:"command"`
	Description *string `json:"description"`
	CreatedAt   string  `json:"createdAt"`
	UpdatedAt   string  `json:"updatedAt"`
}

SSHSnippet is the `SshSnippet` schema.

Spec schema: `SshSnippet`.

type SSHSnippetInput added in v0.30.0

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

SSHSnippetInput is the `SshSnippetInput` schema.

Spec schema: `SshSnippetInput`.

type SSHTunnelCreateAccountRequest

type SSHTunnelCreateAccountRequest struct {
	SSHHost     string            `json:"sshHost"`
	SSHPort     int64             `json:"sshPort"`
	SSHUser     string            `json:"sshUser"`
	SSHKeyID    string            `json:"sshKeyId"`
	RemoteHost  string            `json:"remoteHost"`
	RemotePort  int64             `json:"remotePort"`
	PluginID    string            `json:"pluginId"`
	DisplayName string            `json:"displayName"`
	Credentials map[string]string `json:"credentials"`
}

SSHTunnelCreateAccountRequest is the `SshTunnelCreateAccountRequest` schema.

Spec schema: `SshTunnelCreateAccountRequest`.

type SSHTunnelCreateAccountResponse

type SSHTunnelCreateAccountResponse struct {
	AccountID string `json:"accountId"`
}

SSHTunnelCreateAccountResponse is the `SshTunnelCreateAccountResponse` schema.

Spec schema: `SshTunnelCreateAccountResponse`.

type SSHTunnelsActiveParams

type SSHTunnelsActiveParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SSHTunnelsActiveParams holds the parameters for `client.sshTunnels.active`.

Every field is optional; pass nil to take the defaults.

type SSHTunnelsCloseParams

type SSHTunnelsCloseParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SshtunnelsCloseRequest
}

SSHTunnelsCloseParams holds the parameters for `client.sshTunnels.close`.

type SSHTunnelsCreateAccountParams

type SSHTunnelsCreateAccountParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SSHTunnelCreateAccountRequest
}

SSHTunnelsCreateAccountParams holds the parameters for `client.sshTunnels.createAccount`.

type SSHTunnelsExecParams

type SSHTunnelsExecParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SSHExecRequest
}

SSHTunnelsExecParams holds the parameters for `client.sshTunnels.exec`.

type SSHTunnelsNamespace

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

SSHTunnelsNamespace is `client.sshTunnels`.

func (*SSHTunnelsNamespace) Active

Active: List active tunnels for this org

_Requires permission: `resources:execute`._

GET /api/org/{orgId}/ssh-tunnels/active

func (*SSHTunnelsNamespace) Close

func (n *SSHTunnelsNamespace) Close(ctx context.Context, params SSHTunnelsCloseParams, opts ...RequestOption) (*OK, error)

Close: Close a tunnel by id

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/ssh-tunnels/close

func (*SSHTunnelsNamespace) CreateAccount

CreateAccount: Create an account whose traffic is tunneled over SSH

Verifies the SSH connection works before persisting.

_Requires permission: `accounts:write`._

POST /api/org/{orgId}/ssh-tunnels/create-account

Raises on 400: Bad request

Raises on 404: Not found

func (*SSHTunnelsNamespace) Exec

Exec: Run a command over SSH using an org SSH key

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/ssh-tunnels/exec

Raises on 400: Bad request

Raises on 404: Not found

func (*SSHTunnelsNamespace) Open

Open: Re-open the tunnel for an existing account

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/ssh-tunnels/open

Raises on 404: Not found

type SSHTunnelsOpenParams

type SSHTunnelsOpenParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SshtunnelsOpenRequest
}

SSHTunnelsOpenParams holds the parameters for `client.sshTunnels.open`.

type SavedCostFilter added in v1.6.0

type SavedCostFilter struct {
	ID          string                `json:"id"`
	Name        string                `json:"name"`
	Description *string               `json:"description"`
	Filters     []SavedCostFilterTerm `json:"filters"`
	// Query: The canonical cost-query-language rendering of `filters`, derived
	// server-side.
	Query           string  `json:"query"`
	CreatedByUserID *string `json:"createdByUserId"`
	CreatedAt       string  `json:"createdAt"`
	UpdatedAt       string  `json:"updatedAt"`
}

SavedCostFilter is the `SavedCostFilter` schema.

type SavedCostFilterInput added in v1.6.0

type SavedCostFilterInput struct {
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
	// Filters: The structured filter. May be omitted only when `query` is sent
	// instead.
	Filters []SavedCostFilterTerm `json:"filters,omitempty"`
	// Query: The same filter written in the cost query language — an alternative
	// spelling of `filters`, compiled server-side into exactly that structure.
	// Sending both a query and a non-empty `filters` is a 400, not a precedence
	// rule. Whichever spelling is used, the result must be non-empty (an empty
	// saved filter matches everything, which is the same as no filter wearing a
	// name) and every tag term must carry its key.
	Query *string `json:"query,omitempty"`
}

SavedCostFilterInput is the `SavedCostFilterInput` schema.

type SavedCostFilterReferent added in v1.6.0

type SavedCostFilterReferent struct {
	// Kind: One of "budget", "cost_report", "cost_graph_widget".
	Kind string `json:"kind"`
	// ID: Budget id, report id, or dashboard-widget id.
	ID string `json:"id"`
	// Name: Budget name, report name, or the widget's title.
	Name string `json:"name"`
	// DashboardID: Set for `cost_graph_widget` referents.
	DashboardID   *string `json:"dashboardId,omitempty"`
	DashboardName *string `json:"dashboardName,omitempty"`
}

SavedCostFilterReferent is the `SavedCostFilterReferent` schema.

type SavedCostFilterTerm added in v1.6.0

type SavedCostFilterTerm struct {
	// Dimension: One of "provider", "account", "service", "region", "resource",
	// "tag", "charge_type", "commitment".
	Dimension string `json:"dimension"`
	// Op: One of "in", "not_in".
	Op     string   `json:"op"`
	Values []string `json:"values"`
	TagKey *string  `json:"tagKey,omitempty"`
}

SavedCostFilterTerm is the `SavedCostFilterTerm` schema.

type SavedCostFiltersCreateParams added in v1.6.0

type SavedCostFiltersCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body SavedCostFilterInput
}

SavedCostFiltersCreateParams holds the parameters for `client.savedCostFilters.create`.

type SavedCostFiltersDeleteParams added in v1.6.0

type SavedCostFiltersDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

SavedCostFiltersDeleteParams holds the parameters for `client.savedCostFilters.delete`.

type SavedCostFiltersGetParams added in v1.6.0

type SavedCostFiltersGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

SavedCostFiltersGetParams holds the parameters for `client.savedCostFilters.get`.

type SavedCostFiltersListParams added in v1.6.0

type SavedCostFiltersListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SavedCostFiltersListParams holds the parameters for `client.savedCostFilters.list`.

Every field is optional; pass nil to take the defaults.

type SavedCostFiltersNamespace added in v1.6.0

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

SavedCostFiltersNamespace is `client.savedCostFilters`.

func (*SavedCostFiltersNamespace) Create added in v1.6.0

Create: Create a saved cost filter

Names must be unique per organization (case-insensitively) — they are how the CLI's `--filter <name>` and humans address the filter. A name collision is a 409.

_Requires permission: `costs:write`._

POST /api/org/{orgId}/saved-cost-filters

Raises on 400: Bad request

Raises on 409: A live saved filter already uses this name.

func (*SavedCostFiltersNamespace) Delete added in v1.6.0

Delete: Delete a saved cost filter

Soft delete — **refused with a 409 while anything references the filter**, with the referents in the body. Deleting a referenced filter would silently widen every referent's scope to all spend; for a budget that can fire or suppress alerts, so detaching the referents is a deliberate step, never a side effect of deletion.

_Requires permission: `costs:write`._

DELETE /api/org/{orgId}/saved-cost-filters/{id}

Raises on 404: Not found

Raises on 409: Still referenced — the body lists every referent.

func (*SavedCostFiltersNamespace) Get added in v1.6.0

Get: Get a saved cost filter

_Requires permission: `costs:read`._

GET /api/org/{orgId}/saved-cost-filters/{id}

Raises on 404: Not found

func (*SavedCostFiltersNamespace) List added in v1.6.0

List: List saved cost filters

Named, reusable cost filter sets. Graphs, reports and budgets reference one **by id** (`savedFilterId` in their configs and in `POST /costs/query`), and the server resolves the reference at query time — so editing a saved filter changes every referent at once, and nothing ever holds a copy.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/saved-cost-filters

func (*SavedCostFiltersNamespace) Referents added in v1.6.0

Referents: List a saved filter's referents

Every budget, cost report and dashboard cost graph referencing this filter — what an edit will re-scope, and what a delete would be refused over.

_Requires permission: `costs:read`._

GET /api/org/{orgId}/saved-cost-filters/{id}/referents

Raises on 404: Not found

func (*SavedCostFiltersNamespace) Update added in v1.6.0

Update: Update a saved cost filter

Replaces the filter's name, description and terms. This is the high-leverage write: every graph, report and budget referencing the filter runs the new terms on its next query — re-scoping a referenced budget can change which alerts fire. `GET /{id}/referents` names what a change will touch.

_Requires permission: `costs:write`._

PUT /api/org/{orgId}/saved-cost-filters/{id}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: A live saved filter already uses this name.

type SavedCostFiltersReferentsParams added in v1.6.0

type SavedCostFiltersReferentsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

SavedCostFiltersReferentsParams holds the parameters for `client.savedCostFilters.referents`.

type SavedCostFiltersReferentsResponse added in v1.6.0

type SavedCostFiltersReferentsResponse struct {
	Referents []SavedCostFilterReferent `json:"referents"`
}

SavedCostFiltersReferentsResponse is an object the spec declares inline.

type SavedCostFiltersUpdateParams added in v1.6.0

type SavedCostFiltersUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body SavedCostFilterInput
}

SavedCostFiltersUpdateParams holds the parameters for `client.savedCostFilters.update`.

type ScheduleConflict added in v0.29.0

type ScheduleConflict struct {
	Error string `json:"error"`
}

ScheduleConflict is the `ScheduleConflict` schema.

type ScheduleTransition added in v0.29.0

type ScheduleTransition struct {
	At string `json:"at"`
	// Action: A schedule transition: `stop` powers the resource off, `start`
	// powers it on.
	//
	// One of "stop", "start".
	Action string `json:"action"`
}

ScheduleTransition is the `ScheduleTransition` schema.

type SchedulesCreateParams added in v0.29.0

type SchedulesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *SleepScheduleCreate
}

SchedulesCreateParams holds the parameters for `client.schedules.create`.

Every field is optional; pass nil to take the defaults.

type SchedulesDeleteParams added in v0.29.0

type SchedulesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ScheduleID string
}

SchedulesDeleteParams holds the parameters for `client.schedules.delete`.

type SchedulesGetParams added in v0.29.0

type SchedulesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SchedulesGetParams holds the parameters for `client.schedules.get`.

Every field is optional; pass nil to take the defaults.

type SchedulesNamespace added in v0.29.0

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

SchedulesNamespace is `client.schedules`.

func (*SchedulesNamespace) Create added in v0.29.0

Create: Create a sleep/wake schedule

Attach an off-at/on-at weekly window to a resource. The resource's type must declare lifecycle start/stop actions (see the resource type metadata); one schedule per resource. Times are wall-clock in the given IANA timezone and remain correct across DST. Audit-logged.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/schedules

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: The resource already has a schedule

func (*SchedulesNamespace) Delete added in v0.29.0

Delete: Delete a schedule

Remove the schedule. The resource is left in whatever state it is in. Audit-logged.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/schedules/{scheduleId}

Raises on 404: Not found

func (*SchedulesNamespace) Get added in v0.29.0

Get: List sleep/wake schedules

Every schedule in the organization with its next transition, last run outcome and a projected monthly saving computed from trailing per-resource spend and the weekly off-hours fraction. Schedules attach to resources whose plugin declares lifecycle start/stop actions; the poller executes due transitions server-side.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/schedules

func (*SchedulesNamespace) Preview added in v0.29.0

Preview: Preview a schedule's projected saving

Quote a timing against a resource before saving: the weekly off-hours fraction, the resource's trailing spend normalized to a month, the projected monthly saving, and the next few transitions. Makes no provider API calls and changes nothing.

_Requires permission: `resources:read`._

POST /api/org/{orgId}/schedules/preview

Raises on 400: Bad request

Raises on 404: Not found

func (*SchedulesNamespace) Update added in v0.29.0

Update: Update or pause a schedule

Edit the timing and/or toggle `paused`. Any change recomputes the next transition; pausing clears it. Audit-logged.

_Requires permission: `resources:write`._

PUT /api/org/{orgId}/schedules/{scheduleId}

Raises on 400: Bad request

Raises on 404: Not found

type SchedulesPreviewParams added in v0.29.0

type SchedulesPreviewParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *SleepSchedulePreviewRequest
}

SchedulesPreviewParams holds the parameters for `client.schedules.preview`.

Every field is optional; pass nil to take the defaults.

type SchedulesUpdateParams added in v0.29.0

type SchedulesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	ScheduleID string
	// Body: the JSON request body.
	Body *SleepScheduleUpdate
}

SchedulesUpdateParams holds the parameters for `client.schedules.update`.

type SearchHit

type SearchHit struct {
	ID                ResourceID `json:"id"`
	PluginID          string     `json:"pluginId"`
	PluginDisplayName string     `json:"pluginDisplayName"`
	PluginLogoSvg     string     `json:"pluginLogoSvg"`
	ResourceTypeID    string     `json:"resourceTypeId"`
	ResourceTypeLabel string     `json:"resourceTypeLabel"`
	AccountID         string     `json:"accountId"`
	AccountName       string     `json:"accountName"`
	DisplayName       string     `json:"displayName"`
	Subtitle          *string    `json:"subtitle,omitempty"`
}

SearchHit is the `SearchHit` schema.

type SearchListParams

type SearchListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	Q     *string
}

SearchListParams holds the parameters for `client.search.list`.

Every field is optional; pass nil to take the defaults.

type SearchNamespace

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

SearchNamespace is `client.search`.

func (*SearchNamespace) List

func (n *SearchNamespace) List(ctx context.Context, params *SearchListParams, opts ...RequestOption) ([]SearchHit, error)

List: Search resources (capped at 50 hits) and workflows across the org

_Requires permission: `resources:read`._

GET /api/org/{orgId}/search

type SeatLimitResponse added in v0.12.0

type SeatLimitResponse struct {
	Error string `json:"error"`
	// Code: One of "seat_limit_reached".
	Code string `json:"code"`
	// SeatCount: Total capacity: monthly subscription seats plus prepaid
	// capacity-slot seats
	SeatCount int64 `json:"seatCount"`
	// SeatsUsed: Members plus pending unexpired invitations
	SeatsUsed int64 `json:"seatsUsed"`
	// CanAddSeat: Whether retrying with `addSeat: true` can succeed. False when
	// the org's capacity is entirely prepaid capacity slots: there is no monthly
	// seat to buy, so the only remedy is another capacity slot.
	CanAddSeat bool `json:"canAddSeat"`
}

SeatLimitResponse is the `SeatLimitResponse` schema.

type SecretAccessRequest

type SecretAccessRequest struct {
	AccountID        string      `json:"accountId"`
	ResourceID       ResourceID  `json:"resourceId"`
	VersionID        string      `json:"versionId"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

SecretAccessRequest is the `SecretAccessRequest` schema.

type SecretAccessResponse

type SecretAccessResponse struct {
	Value string `json:"value"`
}

SecretAccessResponse is the `SecretAccessResponse` schema.

type SecretAddRequest

type SecretAddRequest struct {
	AccountID        string      `json:"accountId"`
	ResourceID       ResourceID  `json:"resourceId"`
	Value            string      `json:"value"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

SecretAddRequest is the `SecretAddRequest` schema.

type SecretExportTemplate

type SecretExportTemplate struct {
	ID          string                        `json:"id"`
	Label       string                        `json:"label"`
	Description *string                       `json:"description,omitempty"`
	Entries     []SecretExportTemplateEntries `json:"entries"`
}

SecretExportTemplate is the `SecretExportTemplate` schema.

type SecretExportTemplateEntries

type SecretExportTemplateEntries struct {
	OutputKey string `json:"outputKey"`
	EnvKey    string `json:"envKey"`
}

SecretExportTemplateEntries is an object the spec declares inline.

type SecretModifyRequest

type SecretModifyRequest struct {
	AccountID  string     `json:"accountId"`
	ResourceID ResourceID `json:"resourceId"`
	VersionID  string     `json:"versionId"`
	// Action: One of "enable", "disable", "destroy".
	Action           string      `json:"action"`
	ParentResourceID *ResourceID `json:"parentResourceId,omitempty"`
}

SecretModifyRequest is the `SecretModifyRequest` schema.

type SecretVersion

type SecretVersion struct {
	ID string `json:"id"`
	// State: One of "enabled", "disabled", "destroyed".
	State string `json:"state"`
	// CreatedAt: ISO-8601.
	CreatedAt string `json:"createdAt"`
	// DestroyedAt: Set only when destroyed.
	DestroyedAt *string `json:"destroyedAt,omitempty"`
	IsLatest    *bool   `json:"isLatest,omitempty"`
}

SecretVersion is the `SecretVersion` schema.

type SecretVersionResponse

type SecretVersionResponse struct {
	Version SecretVersion `json:"version"`
}

SecretVersionResponse is the `SecretVersionResponse` schema.

type SecretVersionsResponse

type SecretVersionsResponse struct {
	Versions []SecretVersion `json:"versions"`
}

SecretVersionsResponse is the `SecretVersionsResponse` schema.

type Session

type Session struct {
	UserID          string  `json:"userId"`
	Email           *string `json:"email"`
	NeedsOnboarding bool    `json:"needsOnboarding"`
}

Session is the `Session` schema.

type SessionRecording added in v0.43.0

type SessionRecording struct {
	ID string `json:"id"`
	// UserID: Who opened the session; null when the socket authenticated with an
	// API key.
	UserID *string `json:"userId"`
	// UserName: Display-name snapshot taken at record time, so a departed member
	// still reads as one.
	UserName   *string `json:"userName"`
	AccountID  *string `json:"accountId"`
	ResourceID *string `json:"resourceId"`
	// Host: Final hop, as dialled.
	Host     string `json:"host"`
	Port     int64  `json:"port"`
	Username string `json:"username"`
	// HopCount: 1 for a direct session; higher when it jumped through bastions.
	HopCount int64 `json:"hopCount"`
	Cols     int64 `json:"cols"`
	Rows     int64 `json:"rows"`
	// HasInput: True when the cast also contains keystrokes (the org opted into
	// input capture).
	HasInput bool `json:"hasInput"`
	// SharedConsoleID: Set when this session was shared with colleagues while it
	// ran.
	SharedConsoleID *string `json:"sharedConsoleId,omitempty"`
	// Participants: Everyone who was attached to this session and in what role —
	// the **highest** role they held, not their role at the end. Null or empty
	// for an ordinary solo session. Once a session can be shared, `userId` alone
	// stops answering 'whose hands were on this box'; this does. The cast
	// carries the same facts in-band as asciicast `"m"` marker events, so a
	// viewer sees *when* the keyboard moved.
	Participants []SessionRecordingParticipants `json:"participants,omitempty"`
	// Status: `recording` (live), `complete` (closed cleanly), `truncated` (hit
	// the per-session capture ceiling — the tape is a genuine partial and says
	// so), or `abandoned` (the server handling the session went away before it
	// could close the row).
	//
	// One of "recording", "complete", "truncated", "abandoned".
	Status string `json:"status"`
	// OutputBytes: Terminal bytes captured, before compression.
	OutputBytes int64   `json:"outputBytes"`
	EventCount  int64   `json:"eventCount"`
	StartedAt   string  `json:"startedAt"`
	EndedAt     *string `json:"endedAt"`
	DurationMs  *int64  `json:"durationMs"`
}

SessionRecording is the `SessionRecording` schema.

type SessionRecordingParticipants added in v1.14.0

type SessionRecordingParticipants struct {
	UserID   *string `json:"userId"`
	UserName *string `json:"userName"`
	// Role: One of "observer", "driver".
	Role     string  `json:"role"`
	JoinedAt string  `json:"joinedAt"`
	LeftAt   *string `json:"leftAt"`
}

SessionRecordingParticipants is an object the spec declares inline.

type SessionRecordingSettings added in v0.43.0

type SessionRecordingSettings struct {
	Enabled bool `json:"enabled"`
	// CaptureInput: Also record keystrokes. Separate from `enabled` because it
	// captures input at prompts the remote host chose not to echo — a sudo
	// password, a pasted token — which is a materially different promise to the
	// people being recorded.
	CaptureInput  bool                  `json:"captureInput"`
	RetentionDays int64                 `json:"retentionDays"`
	Usage         SessionRecordingUsage `json:"usage"`
}

SessionRecordingSettings is the `SessionRecordingSettings` schema.

type SessionRecordingSettingsUpdate added in v0.43.0

type SessionRecordingSettingsUpdate struct {
	Enabled       *bool  `json:"enabled,omitempty"`
	CaptureInput  *bool  `json:"captureInput,omitempty"`
	RetentionDays *int64 `json:"retentionDays,omitempty"`
}

SessionRecordingSettingsUpdate is the `SessionRecordingSettingsUpdate` schema.

type SessionRecordingUsage added in v0.43.0

type SessionRecordingUsage struct {
	RecordingCount int64 `json:"recordingCount"`
	// StoredBytes: Compressed size actually stored.
	StoredBytes     int64   `json:"storedBytes"`
	CapturedBytes   int64   `json:"capturedBytes"`
	OldestStartedAt *string `json:"oldestStartedAt"`
}

SessionRecordingUsage is the `SessionRecordingUsage` schema.

type SessionRecordingsCastParams added in v0.43.0

type SessionRecordingsCastParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID       *string
	RecordingID string
	// Download: Force an attachment disposition.
	//
	// One of "1".
	Download *string
}

SessionRecordingsCastParams holds the parameters for `client.sessionRecordings.cast`.

type SessionRecordingsDeleteParams added in v0.43.0

type SessionRecordingsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID       *string
	RecordingID string
}

SessionRecordingsDeleteParams holds the parameters for `client.sessionRecordings.delete`.

type SessionRecordingsGetParams added in v0.43.0

type SessionRecordingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID       *string
	RecordingID string
}

SessionRecordingsGetParams holds the parameters for `client.sessionRecordings.get`.

type SessionRecordingsListParams added in v0.43.0

type SessionRecordingsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Status: `recording` (live), `complete` (closed cleanly), `truncated` (hit
	// the per-session capture ceiling — the tape is a genuine partial and says
	// so), or `abandoned` (the server handling the session went away before it
	// could close the row).
	//
	// One of "recording", "complete", "truncated", "abandoned".
	Status     *string
	UserID     *string
	ResourceID *string
	AccountID  *string
	// Since: Inclusive lower bound on `startedAt`.
	Since *string
	// Until: Exclusive upper bound on `startedAt`.
	Until *string
	Limit *int64
}

SessionRecordingsListParams holds the parameters for `client.sessionRecordings.list`.

Every field is optional; pass nil to take the defaults.

type SessionRecordingsNamespace added in v0.43.0

type SessionRecordingsNamespace struct {

	// Settings: `client.sessionRecordings.settings`.
	Settings *SessionRecordingsSettingsNamespace
	// contains filtered or unexported fields
}

SessionRecordingsNamespace is `client.sessionRecordings`.

func (*SessionRecordingsNamespace) Cast added in v0.43.0

Cast: Download a recording as an asciicast

The session as an [asciicast v2](https://docs.asciinema.org/manual/asciicast/v2/) document: a JSON header line followed by one `[time, code, data]` event per line. Deliberately somebody else's format — the same bytes play in `asciinema play` and in the reference web player, so a recording is useful to an auditor who has never seen this product. `?download=1` returns it as an attachment. **Every fetch is audit-logged**, including this one: an investigator has to be able to answer who has watched a given tape.

_Requires permission: `session-recordings:read`._

GET /api/org/{orgId}/session-recordings/{recordingId}/cast

Raises on 404: Not found

func (*SessionRecordingsNamespace) Delete added in v0.43.0

Delete: Delete a recording

Removes the recording and its stored chunks. Audit-logged.

_Requires permission: `session-recordings:write`._

DELETE /api/org/{orgId}/session-recordings/{recordingId}

Raises on 404: Not found

func (*SessionRecordingsNamespace) Get added in v0.43.0

Get: Get one recording's metadata

_Requires permission: `session-recordings:read`._

GET /api/org/{orgId}/session-recordings/{recordingId}

Raises on 404: Not found

func (*SessionRecordingsNamespace) List added in v0.43.0

List: List recorded SSH sessions

Recorded sessions, newest first. Only SSH opened through the cloud is recorded — those sessions are already proxied by the server, so recording tees a stream it holds rather than requiring an agent on the host. A desktop session that dials a host directly never reaches the server and cannot appear here.

_Requires permission: `session-recordings:read`._

GET /api/org/{orgId}/session-recordings

Raises on 400: Bad request

type SessionRecordingsSettingsGetParams added in v0.43.0

type SessionRecordingsSettingsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SessionRecordingsSettingsGetParams holds the parameters for `client.sessionRecordings.settings.get`.

Every field is optional; pass nil to take the defaults.

type SessionRecordingsSettingsNamespace added in v0.43.0

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

SessionRecordingsSettingsNamespace is `client.sessionRecordings.settings`.

func (*SessionRecordingsSettingsNamespace) Get added in v0.43.0

Get: Get the recording policy

The organization's recording policy plus what it currently stores. Usage rides along with the policy because the only question anyone asks about retention is what it costs.

_Requires permission: `session-recordings:read`._

GET /api/org/{orgId}/session-recordings/settings

func (*SessionRecordingsSettingsNamespace) Update added in v0.43.0

Update: Update the recording policy

Partial update — omitted fields keep their current value. Recording is opt-in and off by default. Audit-logged with the before/after policy.

_Requires permission: `session-recordings:write`._

PUT /api/org/{orgId}/session-recordings/settings

Raises on 400: Bad request

type SessionRecordingsSettingsUpdateParams added in v0.43.0

type SessionRecordingsSettingsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *SessionRecordingSettingsUpdate
}

SessionRecordingsSettingsUpdateParams holds the parameters for `client.sessionRecordings.settings.update`.

Every field is optional; pass nil to take the defaults.

type SharedConsole added in v1.14.0

type SharedConsole struct {
	ID string `json:"id"`
	// RoutingKey: Load-balancer affinity hint. A guest's WebSocket must carry it
	// as `?sid=` so the upgrade lands on the replica holding the pty. Not a
	// secret and not authorisation.
	RoutingKey  string  `json:"routingKey"`
	OwnerUserID *string `json:"ownerUserId"`
	OwnerName   *string `json:"ownerName"`
	AccountID   *string `json:"accountId"`
	ResourceID  *string `json:"resourceId"`
	// Host: Final hop, as the proxy dialled it — never as a client asserted it.
	Host     string `json:"host"`
	Port     int64  `json:"port"`
	Username string `json:"username"`
	// AllowHandover: False makes the share strictly read-only: nobody but the
	// sharer can ever type. This is the one hard safety property the feature
	// offers, as opposed to inferring intent from command text.
	AllowHandover bool `json:"allowHandover"`
	// Status: `revoked` — somebody ended the share; `ended` — the underlying SSH
	// session closed. Either way the fan-out stops and attached guests are
	// disconnected.
	//
	// One of "active", "revoked", "ended".
	Status            string  `json:"status"`
	InviteTokenPrefix *string `json:"inviteTokenPrefix"`
	InviteExpiresAt   *string `json:"inviteExpiresAt"`
	// InviteConsumedAt: Set once an invite admitted somebody new. The link stops
	// working for anyone else at that moment; the sharer mints a replacement for
	// the next guest.
	InviteConsumedAt *string `json:"inviteConsumedAt"`
	// RecordingID: The session recording this console is being taped into, when
	// the org records. Participants are attributed in that recording's own
	// metadata and as asciicast markers on its timeline.
	RecordingID *string `json:"recordingId"`
	PtyCols     int64   `json:"ptyCols"`
	// PtyRows: The pty's geometry, which is the **driver's** geometry. One pty
	// has one size, so everyone else letterboxes rather than reflowing.
	PtyRows   int64  `json:"ptyRows"`
	CreatedAt string `json:"createdAt"`
}

SharedConsole is the `SharedConsole` schema.

type SharedConsoleCreated added in v1.14.0

type SharedConsoleCreated struct {
	Share        SharedConsole              `json:"share"`
	Participants []SharedConsoleParticipant `json:"participants"`
	// InviteToken: The invite, returned exactly once. Only its sha256 is stored,
	// so it cannot be shown again — mint a replacement instead.
	InviteToken string `json:"inviteToken"`
}

SharedConsoleCreated is the `SharedConsoleCreated` schema.

type SharedConsoleInvitePreview added in v1.14.0

type SharedConsoleInvitePreview struct {
	Share    SharedConsole `json:"share"`
	Joinable bool          `json:"joinable"`
	// Rejoin: You are already on this console and would resume.
	Rejoin *bool   `json:"rejoin,omitempty"`
	Error  *string `json:"error,omitempty"`
	Code   *string `json:"code,omitempty"`
}

SharedConsoleInvitePreview is the `SharedConsoleInvitePreview` schema.

type SharedConsoleJoined added in v1.14.0

type SharedConsoleJoined struct {
	Share        SharedConsole              `json:"share"`
	Participants []SharedConsoleParticipant `json:"participants"`
	You          SharedConsoleParticipant   `json:"you"`
	RoutingKey   string                     `json:"routingKey"`
}

SharedConsoleJoined is the `SharedConsoleJoined` schema.

type SharedConsoleParticipant added in v1.14.0

type SharedConsoleParticipant struct {
	ID     string `json:"id"`
	UserID string `json:"userId"`
	// UserName: Display-name snapshot taken when they joined.
	UserName *string `json:"userName"`
	// Role: `driver` holds the keyboard; `observer` sees the terminal and cannot
	// type into it. Exactly one participant per console is a driver at any
	// moment, enforced by a partial unique index rather than by the application
	// — two simultaneous handovers cannot both win.
	//
	// One of "observer", "driver".
	Role string `json:"role"`
	// Status: `left` walked away and may resume on the same row without a new
	// invite; `removed` was ejected or lost the permission mid-session and needs
	// a fresh one.
	//
	// One of "joined", "left", "removed".
	Status string `json:"status"`
	// DriverRequestedAt: Set when this participant has asked for the keyboard
	// and nobody has answered yet. Asking grants nothing — only the current
	// driver or the sharer can move it.
	DriverRequestedAt *string `json:"driverRequestedAt"`
	JoinedAt          string  `json:"joinedAt"`
}

SharedConsoleParticipant is the `SharedConsoleParticipant` schema.

type SharedConsoleState added in v1.14.0

type SharedConsoleState struct {
	Share        SharedConsole              `json:"share"`
	Participants []SharedConsoleParticipant `json:"participants"`
}

SharedConsoleState is the `SharedConsoleState` schema.

type SharedConsoleSummary added in v1.14.0

type SharedConsoleSummary struct {
	ID string `json:"id"`
	// RoutingKey: Load-balancer affinity hint. A guest's WebSocket must carry it
	// as `?sid=` so the upgrade lands on the replica holding the pty. Not a
	// secret and not authorisation.
	RoutingKey  string  `json:"routingKey"`
	OwnerUserID *string `json:"ownerUserId"`
	OwnerName   *string `json:"ownerName"`
	AccountID   *string `json:"accountId"`
	ResourceID  *string `json:"resourceId"`
	// Host: Final hop, as the proxy dialled it — never as a client asserted it.
	Host     string `json:"host"`
	Port     int64  `json:"port"`
	Username string `json:"username"`
	// AllowHandover: False makes the share strictly read-only: nobody but the
	// sharer can ever type. This is the one hard safety property the feature
	// offers, as opposed to inferring intent from command text.
	AllowHandover bool `json:"allowHandover"`
	// Status: `revoked` — somebody ended the share; `ended` — the underlying SSH
	// session closed. Either way the fan-out stops and attached guests are
	// disconnected.
	//
	// One of "active", "revoked", "ended".
	Status            string  `json:"status"`
	InviteTokenPrefix *string `json:"inviteTokenPrefix"`
	InviteExpiresAt   *string `json:"inviteExpiresAt"`
	// InviteConsumedAt: Set once an invite admitted somebody new. The link stops
	// working for anyone else at that moment; the sharer mints a replacement for
	// the next guest.
	InviteConsumedAt *string `json:"inviteConsumedAt"`
	// RecordingID: The session recording this console is being taped into, when
	// the org records. Participants are attributed in that recording's own
	// metadata and as asciicast markers on its timeline.
	RecordingID *string `json:"recordingId"`
	PtyCols     int64   `json:"ptyCols"`
	// PtyRows: The pty's geometry, which is the **driver's** geometry. One pty
	// has one size, so everyone else letterboxes rather than reflowing.
	PtyRows      int64                      `json:"ptyRows"`
	CreatedAt    string                     `json:"createdAt"`
	Participants []SharedConsoleParticipant `json:"participants"`
}

SharedConsoleSummary is the `SharedConsoleSummary` schema.

type SharedConsolesCreateParams added in v1.14.0

type SharedConsolesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *CreateSharedConsole
}

SharedConsolesCreateParams holds the parameters for `client.sharedConsoles.create`.

Every field is optional; pass nil to take the defaults.

type SharedConsolesDeleteParams added in v1.14.0

type SharedConsolesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	ConsoleID string
}

SharedConsolesDeleteParams holds the parameters for `client.sharedConsoles.delete`.

type SharedConsolesGetParams added in v1.14.0

type SharedConsolesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	ConsoleID string
}

SharedConsolesGetParams holds the parameters for `client.sharedConsoles.get`.

type SharedConsolesHandoverParams added in v1.14.0

type SharedConsolesHandoverParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	ConsoleID string
	// Body: the JSON request body.
	Body *SharedConsolesHandoverRequest
}

SharedConsolesHandoverParams holds the parameters for `client.sharedConsoles.handover`.

type SharedConsolesHandoverRequest added in v1.14.0

type SharedConsolesHandoverRequest struct {
	ParticipantID string `json:"participantId"`
}

SharedConsolesHandoverRequest is an object the spec declares inline.

type SharedConsolesInvitesCreateParams added in v1.14.0

type SharedConsolesInvitesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	ConsoleID string
	// Body: the JSON request body.
	Body *SharedConsolesInvitesCreateRequest
}

SharedConsolesInvitesCreateParams holds the parameters for `client.sharedConsoles.invites.create`.

type SharedConsolesInvitesCreateRequest added in v1.14.0

type SharedConsolesInvitesCreateRequest struct {
	InviteTTLMinutes *int64 `json:"inviteTtlMinutes,omitempty"`
}

SharedConsolesInvitesCreateRequest is an object the spec declares inline.

type SharedConsolesInvitesDeleteParams added in v1.14.0

type SharedConsolesInvitesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	ConsoleID string
}

SharedConsolesInvitesDeleteParams holds the parameters for `client.sharedConsoles.invites.delete`.

type SharedConsolesInvitesGetParams added in v1.14.0

type SharedConsolesInvitesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	Token string
}

SharedConsolesInvitesGetParams holds the parameters for `client.sharedConsoles.invites.get`.

type SharedConsolesInvitesNamespace added in v1.14.0

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

SharedConsolesInvitesNamespace is `client.sharedConsoles.invites`.

func (*SharedConsolesInvitesNamespace) Create added in v1.14.0

Create: Mint a replacement invite

An invite is spent by the first person it admits, so inviting a second guest means minting a second link. Replaces any outstanding one. Sharer or `org:settings:write`.

POST /api/org/{orgId}/shared-consoles/{consoleId}/invites

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

func (*SharedConsolesInvitesNamespace) Delete added in v1.14.0

Delete: Withdraw the outstanding invite

Kills the link without touching the session or anyone already on it.

DELETE /api/org/{orgId}/shared-consoles/{consoleId}/invites

Raises on 403: Forbidden

Raises on 404: Not found

func (*SharedConsolesInvitesNamespace) Get added in v1.14.0

Get: Preview what an invite link points at

What the join screen shows before anyone commits: which host, whose session, and whether you may join it. Reachable with a valid token by a signed-in member who already holds `resources:execute` — the token says *which* session, never *whether*. Returns nothing from the session itself.

_Requires permission: `resources:execute`._

GET /api/org/{orgId}/shared-consoles/invites/{token}

Raises on 404: Not found

type SharedConsolesJoinParams added in v1.14.0

type SharedConsolesJoinParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	ConsoleID string
	// Body: the JSON request body.
	Body *SharedConsolesJoinRequest
}

SharedConsolesJoinParams holds the parameters for `client.sharedConsoles.join`.

type SharedConsolesJoinRequest added in v1.14.0

type SharedConsolesJoinRequest struct {
	Token string `json:"token"`
}

SharedConsolesJoinRequest is an object the spec declares inline.

type SharedConsolesLeaveParams added in v1.14.0

type SharedConsolesLeaveParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	ConsoleID string
}

SharedConsolesLeaveParams holds the parameters for `client.sharedConsoles.leave`.

type SharedConsolesListParams added in v1.14.0

type SharedConsolesListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SharedConsolesListParams holds the parameters for `client.sharedConsoles.list`.

Every field is optional; pass nil to take the defaults.

type SharedConsolesNamespace added in v1.14.0

type SharedConsolesNamespace struct {

	// Invites: `client.sharedConsoles.invites`.
	Invites *SharedConsolesInvitesNamespace
	// Participants: `client.sharedConsoles.participants`.
	Participants *SharedConsolesParticipantsNamespace
	// contains filtered or unexported fields
}

SharedConsolesNamespace is `client.sharedConsoles`.

func (*SharedConsolesNamespace) Create added in v1.14.0

Create: Share a live SSH session

Opens a share on a session you already have running and mints its first invite. You become the driver.

Returns 409 `console_not_here` when the pty is held by a different server replica than the one answering this call — reopen the terminal and share again. Writing the share anyway would produce a link that authorises correctly and then finds nothing to attach to.

Requires `resources:execute` — the same permission as opening the terminal. Closed to API keys: sharing a shell is an act a person performs.

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/shared-consoles

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

func (*SharedConsolesNamespace) Delete added in v1.14.0

Delete: Revoke a share

Disconnects every guest and stops the fan-out. The sharer's own SSH session carries on — revoking a share is not killing a terminal.

The sharer or a holder of `org:settings:write`. Deliberately does **not** require `resources:execute`: ending access must never be gated on still holding the access, or an owner whose role was narrowed mid-incident could not close the session they opened.

DELETE /api/org/{orgId}/shared-consoles/{consoleId}

Raises on 403: Forbidden

Raises on 404: Not found

func (*SharedConsolesNamespace) Get added in v1.14.0

Get: Get one shared console

Visible to participants and to anyone who could revoke it (the sharer, or a holder of `org:settings:write`). Others get 404 — that a named colleague has a root shell open on a named production host right now is operational information.

_Requires permission: `resources:execute`._

GET /api/org/{orgId}/shared-consoles/{consoleId}

Raises on 404: Not found

func (*SharedConsolesNamespace) Handover added in v1.14.0

Handover: Move the keyboard to another participant

Authorised by the **current driver** (the keyboard is theirs to give) or by the **sharer** (it is their box, and asking permission from somebody who has stopped responding is not a control). An observer cannot promote themselves — that is `/request-driver`.

Two simultaneous grants cannot both win: the database's partial unique index decides the order, and the loser gets 409 `driver-race-lost`.

The pty resizes to the new driver's viewport; everyone else letterboxes.

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/shared-consoles/{consoleId}/handover

Raises on 400: Bad request

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

func (*SharedConsolesNamespace) Join added in v1.14.0

Join: Redeem an invite and join

Admission needs live org membership **and** `resources:execute` — the invite is a locator, never a capability, so a leaked link admits nobody who could not have opened the shell themselves.

The invite is consumed by the first person it admits. Somebody already on the console resumes their own row without a token, so a reload costs them nothing and obliges the sharer to mint nothing. New joiners always start as observers whatever the link said.

Audit-logged as `shared_console.join`, and written onto the recording's timeline as an asciicast marker.

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/shared-consoles/{consoleId}/join

Raises on 400: Bad request

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

func (*SharedConsolesNamespace) Leave added in v1.14.0

Leave: Leave a shared console

Steps you off without ending the session. Your row survives, so the same invite is not needed again. Deliberately does not require `resources:execute`: giving access up must never be gated on still holding it.

POST /api/org/{orgId}/shared-consoles/{consoleId}/leave

Raises on 404: Not found

func (*SharedConsolesNamespace) List added in v1.14.0

List: List sessions currently shared

Live shared SSH sessions in this organization, with who is on each. Only cloud SSH can be shared: those sessions are already proxied by the server, so fanning the pty out to a second socket is a consumer of a stream it holds. A desktop session dialling a host directly never reaches the server and cannot be shared.

_Requires permission: `resources:execute`._

GET /api/org/{orgId}/shared-consoles

func (*SharedConsolesNamespace) RequestDriver added in v1.14.0

RequestDriver: Ask for the keyboard

Raises a flag the driver and the sharer can see. Grants nothing on its own — that is the point.

_Requires permission: `resources:execute`._

POST /api/org/{orgId}/shared-consoles/{consoleId}/request-driver

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

type SharedConsolesParticipantsDeleteParams added in v1.14.0

type SharedConsolesParticipantsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID         *string
	ConsoleID     string
	ParticipantID string
}

SharedConsolesParticipantsDeleteParams holds the parameters for `client.sharedConsoles.participants.delete`.

type SharedConsolesParticipantsNamespace added in v1.14.0

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

SharedConsolesParticipantsNamespace is `client.sharedConsoles.participants`.

func (*SharedConsolesParticipantsNamespace) Delete added in v1.14.0

Delete: Remove somebody from a shared console

Their socket is closed immediately on the replica holding the pty, and within one two-second sweep on any other. They are marked `removed` rather than `left`, so they cannot resume without a fresh invite. The sharer cannot be removed — revoke the share.

DELETE /api/org/{orgId}/shared-consoles/{consoleId}/participants/{participantId}

Raises on 403: Forbidden

Raises on 404: Not found

Raises on 409: Conflict

type SharedConsolesRequestDriverParams added in v1.14.0

type SharedConsolesRequestDriverParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	ConsoleID string
}

SharedConsolesRequestDriverParams holds the parameters for `client.sharedConsoles.requestDriver`.

type ShowbackReport added in v0.29.0

type ShowbackReport struct {
	From       string                 `json:"from"`
	To         string                 `json:"to"`
	Currencies []string               `json:"currencies"`
	Adjustment *CostAdjustmentSummary `json:"adjustment,omitempty"`
	// Centres: Depth-first: each centre immediately followed by its children,
	// siblings name-sorted, with the "Unallocated" bucket last.
	Centres []ShowbackReportCentres `json:"centres"`
}

ShowbackReport is the `ShowbackReport` schema.

type ShowbackReportCentres added in v0.29.0

type ShowbackReportCentres struct {
	// CostCentreID: Null for the synthetic "Unallocated" bucket.
	CostCentreID *string `json:"costCentreId"`
	Name         string  `json:"name"`
	// Totals: Spend allocated directly to this centre. A cost row is allocated
	// exactly once, so summing this across every entry equals the organization's
	// spend for the period.
	Totals map[string]float64 `json:"totals"`
	// SubtreeTotals: This centre's own spend plus every descendant's. Equal to
	// `totals` for a leaf and for every centre in an organization that does not
	// nest. Do not sum this across entries — parents already contain their
	// children.
	SubtreeTotals map[string]float64 `json:"subtreeTotals"`
	// ParentID: The centre this one sits under; null for a root and for
	// Unallocated.
	ParentID *string `json:"parentId"`
	// Depth: 0 for a root; the indentation level.
	Depth int64 `json:"depth"`
}

ShowbackReportCentres is an object the spec declares inline.

type SignSSHKeyRequest added in v1.30.0

type SignSSHKeyRequest struct {
	// Data: The exact bytes SSH wants signed (a publickey-auth challenge),
	// base64-encoded.
	Data      string           `json:"data"`
	Algorithm SSHSignAlgorithm `json:"algorithm"`
	// Context: Recorded in the audit log entry for this signature.
	Context *SignSshkeyRequestContext `json:"context,omitempty"`
}

SignSSHKeyRequest is the `SignSshKeyRequest` schema.

Spec schema: `SignSshKeyRequest`.

type SignSSHKeyResponse added in v1.30.0

type SignSSHKeyResponse struct {
	// Signature: Raw signature bytes, base64-encoded — Ed25519/RSA as-is, ECDSA
	// in DER as node produces it.
	Signature string           `json:"signature"`
	Algorithm SSHSignAlgorithm `json:"algorithm"`
}

SignSSHKeyResponse is the `SignSshKeyResponse` schema.

Spec schema: `SignSshKeyResponse`.

type SignSshkeyRequestContext added in v1.30.0

type SignSshkeyRequestContext struct {
	Host     *string `json:"host,omitempty"`
	Username *string `json:"username,omitempty"`
}

SignSshkeyRequestContext is an object the spec declares inline.

type SlackAvailableChannel added in v0.3.0

type SlackAvailableChannel struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	IsPrivate bool   `json:"isPrivate"`
}

SlackAvailableChannel is the `SlackAvailableChannel` schema.

type SlackChannel added in v0.3.0

type SlackChannel struct {
	ID             string `json:"id"`
	InstallationID string `json:"installationId"`
	// ChannelID: Slack channel id (C…/G…)
	ChannelID string `json:"channelId"`
	// ChannelName: Channel name without the leading #
	ChannelName string `json:"channelName"`
	IsPrivate   bool   `json:"isPrivate"`
}

SlackChannel is the `SlackChannel` schema.

type SlackChannelCreate added in v0.3.0

type SlackChannelCreate struct {
	InstallationID string `json:"installationId"`
	ChannelID      string `json:"channelId"`
	ChannelName    string `json:"channelName"`
	IsPrivate      *bool  `json:"isPrivate,omitempty"`
}

SlackChannelCreate is the `SlackChannelCreate` schema.

type SlackChannelUpdate added in v0.3.0

type SlackChannelUpdate struct {
	ChannelName string `json:"channelName"`
}

SlackChannelUpdate is the `SlackChannelUpdate` schema.

type SlackChannelsCreateParams added in v0.3.0

type SlackChannelsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *SlackChannelCreate
}

SlackChannelsCreateParams holds the parameters for `client.slack.channels.create`.

Every field is optional; pass nil to take the defaults.

type SlackChannelsDeleteParams added in v0.3.0

type SlackChannelsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

SlackChannelsDeleteParams holds the parameters for `client.slack.channels.delete`.

type SlackChannelsNamespace added in v0.3.0

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

SlackChannelsNamespace is `client.slack.channels`.

func (*SlackChannelsNamespace) Create added in v0.3.0

Create: Connect a Slack channel as an alert destination

Adds a channel as a possible destination, or refreshes the cached name of one already added. Which alerts reach it is decided by /alert-rules; an organization with no rules falls back to the default (everything except drift, everywhere), so a freshly added channel starts receiving alerts without a second step.

POST /api/org/{orgId}/slack/channels

Raises on 400: Bad request

Raises on 404: Not found

func (*SlackChannelsNamespace) Delete added in v0.3.0

Delete: Disconnect a channel

DELETE /api/org/{orgId}/slack/channels/{id}

Raises on 404: Not found

func (*SlackChannelsNamespace) Update added in v0.3.0

Update: Refresh a channel's cached name

PATCH /api/org/{orgId}/slack/channels/{id}

Raises on 404: Not found

type SlackChannelsUpdateParams added in v0.3.0

type SlackChannelsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body *SlackChannelUpdate
}

SlackChannelsUpdateParams holds the parameters for `client.slack.channels.update`.

type SlackInstallURLParams added in v0.3.0

type SlackInstallURLParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SlackInstallURLParams holds the parameters for `client.slack.installUrl`.

Every field is optional; pass nil to take the defaults.

type SlackInstallUrlresponse added in v0.3.0

type SlackInstallUrlresponse struct {
	URL string `json:"url"`
}

SlackInstallUrlresponse is an object the spec declares inline.

type SlackInstallation added in v0.3.0

type SlackInstallation struct {
	// ID: Infrawrench id for this workspace connection
	ID string `json:"id"`
	// TeamID: Slack workspace id (T…)
	TeamID   string  `json:"teamId"`
	TeamName *string `json:"teamName"`
}

SlackInstallation is the `SlackInstallation` schema.

type SlackInstallationsAvailableChannelsParams added in v0.3.0

type SlackInstallationsAvailableChannelsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID          *string
	InstallationID string
}

SlackInstallationsAvailableChannelsParams holds the parameters for `client.slack.installations.availableChannels`.

type SlackInstallationsAvailableChannelsResponse added in v0.3.0

type SlackInstallationsAvailableChannelsResponse struct {
	Channels []SlackAvailableChannel `json:"channels"`
}

SlackInstallationsAvailableChannelsResponse is an object the spec declares inline.

type SlackInstallationsDeleteParams added in v0.3.0

type SlackInstallationsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID          *string
	InstallationID string
}

SlackInstallationsDeleteParams holds the parameters for `client.slack.installations.delete`.

type SlackInstallationsNamespace added in v0.3.0

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

SlackInstallationsNamespace is `client.slack.installations`.

func (*SlackInstallationsNamespace) AvailableChannels added in v0.3.0

AvailableChannels: List channels the connected workspace can see

Live call to Slack's conversations.list, for populating a channel picker. Returns non-archived public and private channels visible to the bot.

GET /api/org/{orgId}/slack/installations/{installationId}/available-channels

Raises on 400: Bad request

func (*SlackInstallationsNamespace) Delete added in v0.3.0

Delete: Disconnect a Slack workspace

Stops all delivery to this workspace. The channel routing is retained, so re-installing restores it.

DELETE /api/org/{orgId}/slack/installations/{installationId}

Raises on 404: Not found

type SlackNamespace added in v0.3.0

type SlackNamespace struct {

	// Channels: `client.slack.channels`.
	Channels *SlackChannelsNamespace
	// Installations: `client.slack.installations`.
	Installations *SlackInstallationsNamespace
	// contains filtered or unexported fields
}

SlackNamespace is `client.slack`.

func (*SlackNamespace) InstallURL added in v0.3.0

InstallURL: Get the Add to Slack URL

Returns a slack.com/oauth/v2/authorize URL carrying a signed `state` that binds the resulting install to this organization. Send the user's browser there; Slack redirects back to /api/slack/oauth/callback.

GET /api/org/{orgId}/slack/install-url

Raises on 400: Bad request

func (*SlackNamespace) Status added in v0.3.0

func (n *SlackNamespace) Status(ctx context.Context, params *SlackStatusParams, opts ...RequestOption) (*SlackStatus, error)

Status: Get the organization's Slack connection

Reports whether the server has a Slack app registered, which workspaces this organization has connected, and which channels alerts are routed to.

GET /api/org/{orgId}/slack/status

func (*SlackNamespace) Test added in v0.3.0

Test: Post a test message to every configured channel

Ignores routing rules — every channel gets the test. Fails with the Slack error when nothing could be delivered (`not_in_channel` means the bot needs inviting to a private channel).

POST /api/org/{orgId}/slack/test

Raises on 400: Bad request

type SlackStatus added in v0.3.0

type SlackStatus struct {
	// Configured: True when this deployment has a Slack app registered
	Configured    bool                `json:"configured"`
	Installations []SlackInstallation `json:"installations"`
	Channels      []SlackChannel      `json:"channels"`
}

SlackStatus is the `SlackStatus` schema.

type SlackStatusParams added in v0.3.0

type SlackStatusParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SlackStatusParams holds the parameters for `client.slack.status`.

Every field is optional; pass nil to take the defaults.

type SlackTestParams added in v0.3.0

type SlackTestParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

SlackTestParams holds the parameters for `client.slack.test`.

Every field is optional; pass nil to take the defaults.

type SlackTestResponse added in v0.3.0

type SlackTestResponse struct {
	OK           bool  `json:"ok"`
	ChannelCount int64 `json:"channelCount"`
	Attempted    int64 `json:"attempted"`
	Succeeded    int64 `json:"succeeded"`
}

SlackTestResponse is an object the spec declares inline.

type SleepSchedule added in v0.29.0

type SleepSchedule struct {
	ID string `json:"id"`
	// ResourceID: Infrawrench resource id the schedule powers on and off.
	ResourceID     string   `json:"resourceId"`
	AccountID      string   `json:"accountId"`
	PluginID       PluginID `json:"pluginId"`
	ResourceTypeID string   `json:"resourceTypeId"`
	// ResourceName: Resource display name at read time.
	ResourceName string `json:"resourceName"`
	AccountName  string `json:"accountName"`
	// DaysOfWeek: ISO weekdays the resource is worked on: 1 = Monday … 7 =
	// Sunday.
	DaysOfWeek []int64 `json:"daysOfWeek"`
	// StopTime: Wall-clock time of day, 24-hour `"HH:MM"`, in the schedule's
	// timezone.
	StopTime string `json:"stopTime"`
	// StartTime: Wall-clock time of day, 24-hour `"HH:MM"`, in the schedule's
	// timezone.
	StartTime string `json:"startTime"`
	// Timezone: IANA timezone the wall-clock times are computed in (DST-safe).
	Timezone string `json:"timezone"`
	// Paused: Paused schedules keep their timing but never fire.
	Paused bool `json:"paused"`
	// NextTransitionAt: Next due transition; null while paused.
	NextTransitionAt *string `json:"nextTransitionAt"`
	// NextTransitionAction: A schedule transition: `stop` powers the resource
	// off, `start` powers it on.
	//
	// One of "stop", "start".
	NextTransitionAction *string `json:"nextTransitionAction"`
	LastRunAt            *string `json:"lastRunAt"`
	// LastRunAction: A schedule transition: `stop` powers the resource off,
	// `start` powers it on.
	//
	// One of "stop", "start".
	LastRunAction *string `json:"lastRunAction"`
	// LastRunStatus: Outcome of the last executed transition: `ok`, `failed`
	// (see `lastRunError`), or `skipped_freeze` (an org change freeze was in
	// effect, so the transition was skipped).
	//
	// One of "ok", "failed", "skipped_freeze".
	LastRunStatus *string `json:"lastRunStatus"`
	// LastRunError: Failure detail for a failed run.
	LastRunError *string `json:"lastRunError"`
	// ProjectedMonthlySaving: Projected monthly saving from trailing
	// per-resource spend × the weekly off-hours fraction; null when billing
	// holds no rows for the resource.
	ProjectedMonthlySaving *float64 `json:"projectedMonthlySaving"`
	// Currency: Currency of the projection, when present.
	Currency  *string `json:"currency"`
	CreatedAt string  `json:"createdAt"`
	UpdatedAt string  `json:"updatedAt"`
}

SleepSchedule is the `SleepSchedule` schema.

type SleepScheduleCreate added in v0.29.0

type SleepScheduleCreate struct {
	ResourceID string `json:"resourceId"`
	AccountID  string `json:"accountId"`
	// DaysOfWeek: ISO weekdays the resource is worked on: 1 = Monday … 7 =
	// Sunday.
	DaysOfWeek []int64 `json:"daysOfWeek"`
	// StopTime: Wall-clock time of day, 24-hour `"HH:MM"`, in the schedule's
	// timezone.
	StopTime string `json:"stopTime"`
	// StartTime: Wall-clock time of day, 24-hour `"HH:MM"`, in the schedule's
	// timezone.
	StartTime string `json:"startTime"`
	// Timezone: IANA timezone the wall-clock times are computed in (DST-safe).
	Timezone string `json:"timezone"`
}

SleepScheduleCreate is the `SleepScheduleCreate` schema.

type SleepScheduleList added in v0.29.0

type SleepScheduleList struct {
	Schedules []SleepSchedule `json:"schedules"`
}

SleepScheduleList is the `SleepScheduleList` schema.

type SleepSchedulePreview added in v0.29.0

type SleepSchedulePreview struct {
	// OffFraction: Fraction of the week (0–1) the schedule keeps the resource
	// stopped.
	OffFraction float64 `json:"offFraction"`
	// MonthlyCost: Trailing spend normalized to a month; null when billing holds
	// no rows.
	MonthlyCost            *float64 `json:"monthlyCost"`
	ProjectedMonthlySaving *float64 `json:"projectedMonthlySaving"`
	Currency               *string  `json:"currency"`
	// CostWindowDays: Days of billing data the estimate was computed over (0 =
	// none found).
	CostWindowDays int64 `json:"costWindowDays"`
	// NextTransitions: The next few transitions, soonest first — a timezone
	// sanity check.
	NextTransitions []ScheduleTransition `json:"nextTransitions"`
}

SleepSchedulePreview is the `SleepSchedulePreview` schema.

type SleepSchedulePreviewRequest added in v0.29.0

type SleepSchedulePreviewRequest struct {
	ResourceID string `json:"resourceId"`
	AccountID  string `json:"accountId"`
	// DaysOfWeek: ISO weekdays the resource is worked on: 1 = Monday … 7 =
	// Sunday.
	DaysOfWeek []int64 `json:"daysOfWeek"`
	// StopTime: Wall-clock time of day, 24-hour `"HH:MM"`, in the schedule's
	// timezone.
	StopTime string `json:"stopTime"`
	// StartTime: Wall-clock time of day, 24-hour `"HH:MM"`, in the schedule's
	// timezone.
	StartTime string `json:"startTime"`
	// Timezone: IANA timezone the wall-clock times are computed in (DST-safe).
	Timezone string `json:"timezone"`
}

SleepSchedulePreviewRequest is the `SleepSchedulePreviewRequest` schema.

type SleepScheduleUpdate added in v0.29.0

type SleepScheduleUpdate struct {
	// DaysOfWeek: ISO weekdays the resource is worked on: 1 = Monday … 7 =
	// Sunday.
	DaysOfWeek []int64 `json:"daysOfWeek,omitempty"`
	// StopTime: Wall-clock time of day, 24-hour `"HH:MM"`, in the schedule's
	// timezone.
	StopTime *string `json:"stopTime,omitempty"`
	// StartTime: Wall-clock time of day, 24-hour `"HH:MM"`, in the schedule's
	// timezone.
	StartTime *string `json:"startTime,omitempty"`
	// Timezone: IANA timezone the wall-clock times are computed in (DST-safe).
	Timezone *string `json:"timezone,omitempty"`
	Paused   *bool   `json:"paused,omitempty"`
}

SleepScheduleUpdate is the `SleepScheduleUpdate` schema.

type SshfanoutHostResultHostKeyTrust added in v0.30.0

type SshfanoutHostResultHostKeyTrust struct {
	// Kind: One of "unknown", "mismatch".
	Kind                 string  `json:"kind"`
	Host                 string  `json:"host"`
	Port                 int64   `json:"port"`
	PresentedFingerprint string  `json:"presentedFingerprint"`
	StoredFingerprint    *string `json:"storedFingerprint"`
}

SshfanoutHostResultHostKeyTrust is an object the spec declares inline.

type SshfanoutRunRequestTargets added in v0.30.0

type SshfanoutRunRequestTargets struct {
	// Kind: One of "account", "resource".
	Kind string `json:"kind"`
	ID   string `json:"id"`
}

SshfanoutRunRequestTargets is an object the spec declares inline.

type SshfanoutSnippetsCreateResponse added in v0.30.0

type SshfanoutSnippetsCreateResponse struct {
	ID string `json:"id"`
}

SshfanoutSnippetsCreateResponse is an object the spec declares inline.

type SshfanoutSnippetsGetResponse added in v0.30.0

type SshfanoutSnippetsGetResponse struct {
	Snippets []SSHSnippet `json:"snippets"`
}

SshfanoutSnippetsGetResponse is an object the spec declares inline.

type SshtunnelsCloseRequest

type SshtunnelsCloseRequest struct {
	TunnelID string `json:"tunnelId"`
}

SshtunnelsCloseRequest is an object the spec declares inline.

type SshtunnelsOpenRequest

type SshtunnelsOpenRequest struct {
	AccountID string `json:"accountId"`
}

SshtunnelsOpenRequest is an object the spec declares inline.

type SshtunnelsOpenResponse

type SshtunnelsOpenResponse struct {
	TunnelID  string `json:"tunnelId"`
	LocalPort int64  `json:"localPort"`
}

SshtunnelsOpenResponse is an object the spec declares inline.

type StatusDot

type StatusDot struct {
	// Kind: One of "status-dot".
	Kind   string         `json:"kind"`
	Status ResourceStatus `json:"status"`
	Label  *string        `json:"label,omitempty"`
}

StatusDot is the `StatusDot` schema.

type StatusGetParams added in v0.44.0

type StatusGetParams struct {
	Slug string
}

StatusGetParams holds the parameters for `client.status.get`.

type StatusHistoryDay added in v0.44.0

type StatusHistoryDay struct {
	// Day: `YYYY-MM-DD`, UTC.
	Day string `json:"day"`
	// Uptime: Fraction of the day the endpoint was up (0–1), or null when
	// nothing was recorded.
	Uptime *float64 `json:"uptime"`
}

StatusHistoryDay is the `StatusHistoryDay` schema.

type StatusIncidentsGetParams added in v0.29.0

type StatusIncidentsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

StatusIncidentsGetParams holds the parameters for `client.statusIncidents.get`.

Every field is optional; pass nil to take the defaults.

type StatusIncidentsNamespace added in v0.29.0

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

StatusIncidentsNamespace is `client.statusIncidents`.

func (*StatusIncidentsNamespace) Get added in v0.29.0

Get: Provider incidents overlapping your resources

The "is it me or is it them?" feed. The poller watches each provider plugin's public status feed (declared on its manifest — zero credentials, zero rate-limit risk), caches active incidents, and this endpoint correlates them against the resources the organization holds: an incident matches a resource when it is provider-wide, names the resource's region, or names its resource type. Includes incidents resolved within the last 24 hours so recent drift can still be correlated. Active incidents first, most severe first.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/status-incidents

Raises on 400: Bad request

type StatusNamespace added in v0.44.0

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

StatusNamespace is `client.status`.

func (*StatusNamespace) Get added in v0.44.0

Get: Read a public status page

**Unauthenticated.** The only endpoint in this API that takes no credentials — a status page exists for people with no account. The payload carries labels, states and uptime history only: probe URLs, resource and account ids, the organization id and error detail are never included. An unpublished page and an unknown slug both answer 404, so the endpoint cannot be used to confirm that a slug is real.

GET /api/status/{slug}

Raises on 404: Not found

type StatusPage added in v0.44.0

type StatusPage struct {
	ID string `json:"id"`
	// Slug: The public URL segment, and the page's only access credential.
	// Generated with real entropy rather than derived from the title.
	Slug        string  `json:"slug"`
	Title       string  `json:"title"`
	Description *string `json:"description"`
	// Published: False until deliberately published; a fresh page is never
	// reachable.
	Published   bool                  `json:"published"`
	ShowHistory bool                  `json:"showHistory"`
	ShowUptime  bool                  `json:"showUptime"`
	SupportURL  *string               `json:"supportUrl"`
	Components  []StatusPageComponent `json:"components"`
	CreatedAt   string                `json:"createdAt"`
	UpdatedAt   string                `json:"updatedAt"`
}

StatusPage is the `StatusPage` schema.

type StatusPageComponent added in v0.44.0

type StatusPageComponent struct {
	ID      string `json:"id"`
	ProbeID string `json:"probeId"`
	// Label: Public name; null falls back to the probe's own name.
	Label     *string `json:"label"`
	GroupName *string `json:"groupName"`
	// Position: Ascending display order.
	Position int64 `json:"position"`
	// ProbeName: The probe's internal name — editor-only.
	ProbeName string `json:"probeName"`
	// ProbeStatus: One of "up", "down", "unknown".
	ProbeStatus string `json:"probeStatus"`
	// ProbeEnabled: False when the probe is paused.
	ProbeEnabled bool `json:"probeEnabled"`
}

StatusPageComponent is the `StatusPageComponent` schema.

type StatusPageComponentInput added in v0.44.0

type StatusPageComponentInput struct {
	ProbeID   string  `json:"probeId"`
	Label     *string `json:"label,omitempty"`
	GroupName *string `json:"groupName,omitempty"`
}

StatusPageComponentInput is the `StatusPageComponentInput` schema.

type StatusPageCreate added in v0.44.0

type StatusPageCreate struct {
	Title       string  `json:"title"`
	Description *string `json:"description,omitempty"`
	// Published: Defaults to false.
	Published   *bool   `json:"published,omitempty"`
	ShowHistory *bool   `json:"showHistory,omitempty"`
	ShowUptime  *bool   `json:"showUptime,omitempty"`
	SupportURL  *string `json:"supportUrl,omitempty"`
	// Components: Order is significant — it is the public render order.
	Components []StatusPageComponentInput `json:"components,omitempty"`
}

StatusPageCreate is the `StatusPageCreate` schema.

type StatusPageListResponse added in v0.44.0

type StatusPageListResponse struct {
	Pages []StatusPage `json:"pages"`
}

StatusPageListResponse is the `StatusPageListResponse` schema.

type StatusPagePatch added in v0.44.0

type StatusPagePatch struct {
	Title       *string `json:"title,omitempty"`
	Description *string `json:"description,omitempty"`
	Published   *bool   `json:"published,omitempty"`
	ShowHistory *bool   `json:"showHistory,omitempty"`
	ShowUptime  *bool   `json:"showUptime,omitempty"`
	SupportURL  *string `json:"supportUrl,omitempty"`
	// Components: When present, replaces the whole set.
	Components []StatusPageComponentInput `json:"components,omitempty"`
}

StatusPagePatch is the `StatusPagePatch` schema.

type StatusPagesCreateParams added in v0.44.0

type StatusPagesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body *StatusPageCreate
}

StatusPagesCreateParams holds the parameters for `client.statusPages.create`.

Every field is optional; pass nil to take the defaults.

type StatusPagesDeleteParams added in v0.44.0

type StatusPagesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

StatusPagesDeleteParams holds the parameters for `client.statusPages.delete`.

type StatusPagesGetParams added in v0.44.0

type StatusPagesGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

StatusPagesGetParams holds the parameters for `client.statusPages.get`.

Every field is optional; pass nil to take the defaults.

type StatusPagesNamespace added in v0.44.0

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

StatusPagesNamespace is `client.statusPages`.

func (*StatusPagesNamespace) Create added in v0.44.0

Create: Create a status page

Creates a page with a freshly generated slug. `published` defaults to false, so creating a page never exposes anything — publish it as a separate, deliberate step.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/status-pages

Raises on 400: Bad request

Raises on 404: Not found

func (*StatusPagesNamespace) Delete added in v0.44.0

Delete: Delete a status page

The page's link stops working. The probes it published are untouched.

_Requires permission: `resources:write`._

DELETE /api/org/{orgId}/status-pages/{id}

Raises on 404: Not found

func (*StatusPagesNamespace) Get added in v0.44.0

Get: List status pages

Every status page in the organization, with the probes each publishes and whether it is currently reachable.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/status-pages

func (*StatusPagesNamespace) RotateSlug added in v0.44.0

RotateSlug: Issue a new public link

Replaces the slug, revoking the current public URL immediately — the reroll for a link that ended up somewhere unintended. The page stays published.

_Requires permission: `resources:write`._

POST /api/org/{orgId}/status-pages/{id}/rotate-slug

Raises on 404: Not found

func (*StatusPagesNamespace) Update added in v0.44.0

Update: Update a status page

Omitted fields keep their value. `components`, when present, replaces the whole ordered set — which is also how a reorder is expressed.

_Requires permission: `resources:write`._

PUT /api/org/{orgId}/status-pages/{id}

Raises on 400: Bad request

Raises on 404: Not found

type StatusPagesRotateSlugParams added in v0.44.0

type StatusPagesRotateSlugParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

StatusPagesRotateSlugParams holds the parameters for `client.statusPages.rotateSlug`.

type StatusPagesUpdateParams added in v0.44.0

type StatusPagesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body *StatusPagePatch
}

StatusPagesUpdateParams holds the parameters for `client.statusPages.update`.

type StorageDeleteParams

type StorageDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body StoragePathRequest
}

StorageDeleteParams holds the parameters for `client.storage.delete`.

type StorageDownloadParams

type StorageDownloadParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID     *string
	AccountID string
	Bucket    string
	// Keys: JSON-encoded array of object keys, e.g. `["a.txt","b.txt"]`
	Keys string
}

StorageDownloadParams holds the parameters for `client.storage.download`.

type StorageListParams

type StorageListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body StorageListRequest
}

StorageListParams holds the parameters for `client.storage.list`.

type StorageListRequest

type StorageListRequest struct {
	AccountID string `json:"accountId"`
	Bucket    string `json:"bucket"`
	Prefix    string `json:"prefix"`
}

StorageListRequest is the `StorageListRequest` schema.

type StorageMkdirParams

type StorageMkdirParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body StoragePathRequest
}

StorageMkdirParams holds the parameters for `client.storage.mkdir`.

type StorageNamespace

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

StorageNamespace is `client.storage`.

func (*StorageNamespace) Delete

func (n *StorageNamespace) Delete(ctx context.Context, params StorageDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete a storage object

_Requires permission: `storage:write`._

POST /api/org/{orgId}/storage/delete

Raises on 400: Bad request

Raises on 404: Not found

func (*StorageNamespace) Download

Download: Download one or many objects (zipped if more than one)

_Requires permission: `storage:read`._

GET /api/org/{orgId}/v1/storage/download

Raises on 400: Bad request

Raises on 404: Not found

Raises on 500: Server error

func (*StorageNamespace) List

List: List objects in a bucket / prefix

_Requires permission: `storage:read`._

POST /api/org/{orgId}/storage/list

Raises on 400: Bad request

Raises on 404: Not found

func (*StorageNamespace) Mkdir

func (n *StorageNamespace) Mkdir(ctx context.Context, params StorageMkdirParams, opts ...RequestOption) (*OK, error)

Mkdir: Create a folder marker in a bucket

_Requires permission: `storage:write`._

POST /api/org/{orgId}/storage/mkdir

Raises on 400: Bad request

Raises on 404: Not found

func (*StorageNamespace) Upload

func (n *StorageNamespace) Upload(ctx context.Context, params StorageUploadParams, opts ...RequestOption) (*OK, error)

Upload: Upload a file to object storage

Multipart/form-data. Plugin must implement `uploadStorageObject`.

_Requires permission: `storage:write`._

POST /api/org/{orgId}/v1/storage/upload

Raises on 400: Bad request

Raises on 404: Not found

type StorageObject

type StorageObject struct {
	// Key: Full path within the bucket.
	Key string `json:"key"`
	// Name: Last path segment — what the browser renders.
	Name         string  `json:"name"`
	Size         float64 `json:"size"`
	LastModified string  `json:"lastModified"`
	IsDirectory  bool    `json:"isDirectory"`
	ContentType  *string `json:"contentType,omitempty"`
}

StorageObject is the `StorageObject` schema.

type StoragePathRequest

type StoragePathRequest struct {
	AccountID string `json:"accountId"`
	Bucket    string `json:"bucket"`
	Key       string `json:"key"`
}

StoragePathRequest is the `StoragePathRequest` schema.

type StorageUploadForm

type StorageUploadForm struct {
	AccountID string `json:"accountId"`
	Bucket    string `json:"bucket"`
	Key       string `json:"key"`
	// File: Raw file bytes
	File io.Reader `json:"file"`
}

StorageUploadForm is the `StorageUploadForm` schema.

type StorageUploadParams

type StorageUploadParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: sent as `multipart/form-data`; the `io.Reader` field is the file.
	Body StorageUploadForm
}

StorageUploadParams holds the parameters for `client.storage.upload`.

type StripeRedirectURL

type StripeRedirectURL struct {
	URL string `json:"url"`
}

StripeRedirectURL is the `StripeRedirectUrl` schema.

Spec schema: `StripeRedirectUrl`.

type Subscription

type Subscription struct {
	// Status: One of "trialing", "active", "past_due", "canceled", "unpaid".
	Status           string  `json:"status"`
	SeatCount        int64   `json:"seatCount"`
	CurrentPeriodEnd *string `json:"currentPeriodEnd"`
	StripeCustomerID string  `json:"stripeCustomerId"`
}

Subscription is the `Subscription` schema.

The API may send null in its place.

type SwapAllocationRulesBody added in v0.29.0

type SwapAllocationRulesBody struct {
	AID string `json:"aId"`
	BID string `json:"bId"`
}

SwapAllocationRulesBody: Two allocation rule ids in the same org whose priorities should be swapped.

type SyncResponse

type SyncResponse struct {
	Synced int64 `json:"synced"`
}

SyncResponse is the `SyncResponse` schema.

type SyncedResource added in v0.7.0

type SyncedResource struct {
	ID               ResourceID  `json:"id"`
	PluginID         string      `json:"pluginId"`
	ResourceTypeID   string      `json:"resourceTypeId"`
	DisplayName      string      `json:"displayName"`
	ExternalID       *string     `json:"externalId"`
	FieldsJSON       JSONObject  `json:"fieldsJson"`
	OutputsJSON      JSONObject  `json:"outputsJson"`
	ParentResourceID *ResourceID `json:"parentResourceId"`
}

SyncedResource is the `SyncedResource` schema.

type SyntheticProbe added in v0.33.0

type SyntheticProbe struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	// URL: Absolute http(s) URL the check hits from the edge proxy.
	URL string `json:"url"`
	// Method: HTTP method the probe uses — GET, HEAD or OPTIONS. Unknown values
	// become GET.
	Method string `json:"method"`
	// IntervalSeconds: Seconds between checks. Clamped server-side to 60–86400.
	IntervalSeconds int64 `json:"intervalSeconds"`
	// TimeoutMs: Per-check timeout in milliseconds. Clamped server-side to
	// 1000–60000.
	TimeoutMs int64 `json:"timeoutMs"`
	// FailureThreshold: Consecutive failures before the probe flips to `down`
	// and notifies. Clamped 1–20.
	FailureThreshold int64 `json:"failureThreshold"`
	Enabled          bool  `json:"enabled"`
	// AccountID: Account of the linked resource, when the URL came from one.
	AccountID *string `json:"accountId"`
	// ResourceID: Linked resource id; advisory, not a foreign key.
	ResourceID     *string   `json:"resourceId"`
	PluginID       *PluginID `json:"pluginId"`
	ResourceTypeID *string   `json:"resourceTypeId"`
	// OutputKey: The resource output/field key the URL was suggested from.
	OutputKey *string `json:"outputKey"`
	// Status: The probe's state machine: `unknown` until the first result,
	// `down` after `failureThreshold` consecutive failures, `up` on any success.
	//
	// One of "up", "down", "unknown".
	Status              string  `json:"status"`
	ConsecutiveFailures int64   `json:"consecutiveFailures"`
	LastProbeAt         *string `json:"lastProbeAt"`
	LastStatusCode      *int64  `json:"lastStatusCode"`
	LastLatencyMs       *int64  `json:"lastLatencyMs"`
	// LastError: Failure detail; null after a success.
	LastError *string `json:"lastError"`
	// LastStateChangeAt: When status last flipped up/down.
	LastStateChangeAt *string `json:"lastStateChangeAt"`
	// Uptime24h: Fraction (0–1) of the trailing 24h the endpoint was up, from
	// the recorded series; null before the first result lands in the metric
	// store.
	Uptime24h *float64 `json:"uptime24h"`
	CreatedAt string   `json:"createdAt"`
	UpdatedAt string   `json:"updatedAt"`
}

SyntheticProbe is the `SyntheticProbe` schema.

type SyntheticProbeCreate added in v0.33.0

type SyntheticProbeCreate struct {
	Name string `json:"name"`
	URL  string `json:"url"`
	// Method: HTTP method the probe uses — GET, HEAD or OPTIONS. Unknown values
	// become GET.
	Method *string `json:"method,omitempty"`
	// IntervalSeconds: Seconds between checks. Clamped server-side to 60–86400.
	IntervalSeconds *int64 `json:"intervalSeconds,omitempty"`
	// TimeoutMs: Per-check timeout in milliseconds. Clamped server-side to
	// 1000–60000.
	TimeoutMs *int64 `json:"timeoutMs,omitempty"`
	// FailureThreshold: Consecutive failures before the probe flips to `down`
	// and notifies. Clamped 1–20.
	FailureThreshold *int64 `json:"failureThreshold,omitempty"`
	Enabled          *bool  `json:"enabled,omitempty"`
	// ResourceID: Link the probe to the resource whose output suggested the URL.
	ResourceID *string `json:"resourceId,omitempty"`
	OutputKey  *string `json:"outputKey,omitempty"`
}

SyntheticProbeCreate is the `SyntheticProbeCreate` schema.

type SyntheticProbeList added in v0.33.0

type SyntheticProbeList struct {
	Probes []SyntheticProbe `json:"probes"`
}

SyntheticProbeList is the `SyntheticProbeList` schema.

type SyntheticProbeUpdate added in v0.33.0

type SyntheticProbeUpdate struct {
	Name *string `json:"name,omitempty"`
	URL  *string `json:"url,omitempty"`
	// Method: HTTP method the probe uses — GET, HEAD or OPTIONS. Unknown values
	// become GET.
	Method *string `json:"method,omitempty"`
	// IntervalSeconds: Seconds between checks. Clamped server-side to 60–86400.
	IntervalSeconds *int64 `json:"intervalSeconds,omitempty"`
	// TimeoutMs: Per-check timeout in milliseconds. Clamped server-side to
	// 1000–60000.
	TimeoutMs *int64 `json:"timeoutMs,omitempty"`
	// FailureThreshold: Consecutive failures before the probe flips to `down`
	// and notifies. Clamped 1–20.
	FailureThreshold *int64 `json:"failureThreshold,omitempty"`
	Enabled          *bool  `json:"enabled,omitempty"`
}

SyntheticProbeUpdate is the `SyntheticProbeUpdate` schema.

type TOTPEnrollment

type TOTPEnrollment struct {
	FactorID    string `json:"factorId"`
	ChallengeID string `json:"challengeId"`
	// QrCode: Data-URI image of the enrolment QR code
	QrCode *string `json:"qrCode"`
	// Secret: Base32 secret, for manual entry
	Secret *string `json:"secret"`
	// URI: `otpauth://` URI
	URI *string `json:"uri"`
}

TOTPEnrollment is the `TotpEnrollment` schema.

Spec schema: `TotpEnrollment`.

type TabTarget

type TabTarget struct {
	// Kind: One of "dashboard", "account", "resource", "agents", "costs",
	// "savings", "cost-reports", "invoices", "graph", "logs", "changes",
	// "expiring", "posture", "access-review", "backups", "wallboard",
	// "calendar", "runbooks", "query-monitors", "dns", "iac",
	// "environment-diff", "environments", "ssh-fanout", "metric-alerts",
	// "probes", "status-pages", "quotas", "incidents", "workflows",
	// "deployments", "settings", "chat", "linux-app".
	Kind           string      `json:"kind"`
	DashboardID    *string     `json:"dashboardId,omitempty"`
	AccountID      *string     `json:"accountId,omitempty"`
	ResourceID     *ResourceID `json:"resourceId,omitempty"`
	ConversationID *string     `json:"conversationId,omitempty"`
	ReportID       *string     `json:"reportId,omitempty"`
	InvoiceID      *string     `json:"invoiceId,omitempty"`
	SessionID      *string     `json:"sessionId,omitempty"`
	WindowID       *int64      `json:"windowId,omitempty"`
	AppID          *string     `json:"appId,omitempty"`
}

TabTarget is the `TabTarget` schema.

type TagComplianceReport added in v0.29.0

type TagComplianceReport struct {
	Policy   TagPolicy              `json:"policy"`
	Accounts []AccountTagCompliance `json:"accounts"`
}

TagComplianceReport is the `TagComplianceReport` schema.

type TagPolicy added in v0.29.0

type TagPolicy struct {
	RequiredTags []RequiredTag `json:"requiredTags"`
	// EnforceOnCreate: When true, resource creation is rejected with a 422
	// (`tag_policy_unmet`) if the submitted fields carry a tag map missing a
	// required tag. Types whose create form has no `tags`/`labels` field are
	// exempt.
	EnforceOnCreate bool `json:"enforceOnCreate"`
}

TagPolicy is the `TagPolicy` schema.

type TagPolicyBlocked added in v0.29.0

type TagPolicyBlocked struct {
	Error string `json:"error"`
	// Code: One of "tag_policy_unmet".
	Code         string               `json:"code"`
	Violations   []TagPolicyViolation `json:"violations"`
	RequiredTags []RequiredTag        `json:"requiredTags"`
}

TagPolicyBlocked is the `TagPolicyBlocked` schema.

type TagPolicyComplianceParams added in v0.29.0

type TagPolicyComplianceParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

TagPolicyComplianceParams holds the parameters for `client.tagPolicy.compliance`.

Every field is optional; pass nil to take the defaults.

type TagPolicyGetParams added in v0.29.0

type TagPolicyGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

TagPolicyGetParams holds the parameters for `client.tagPolicy.get`.

Every field is optional; pass nil to take the defaults.

type TagPolicyNamespace added in v0.29.0

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

TagPolicyNamespace is `client.tagPolicy`.

func (*TagPolicyNamespace) Compliance added in v0.29.0

Compliance: Per-account tag compliance scores

For each account: how many of its resources expose tags and how many of those carry every required tag with an allowed value. `score` is over the evaluated (tag-capable) set so untaggable resource types don't drag it.

_Requires permission: `resources:read`._

GET /api/org/{orgId}/tag-policy/compliance

func (*TagPolicyNamespace) Get added in v0.29.0

Get: The org's required-tag policy

_Requires permission: `resources:read`._

GET /api/org/{orgId}/tag-policy

func (*TagPolicyNamespace) Update added in v0.29.0

Update: Replace the org's tag policy

Sets the required tag keys (each optionally restricted to allowed values) and whether resource creation is blocked when they are missing. Keys are matched case-insensitively against the generic `tags`/`labels` field convention.

_Requires permission: `org:settings:write`._

PUT /api/org/{orgId}/tag-policy

Raises on 400: Bad request

type TagPolicyUpdateParams added in v0.29.0

type TagPolicyUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body TagPolicy
}

TagPolicyUpdateParams holds the parameters for `client.tagPolicy.update`.

type TagPolicyViolation added in v0.29.0

type TagPolicyViolation struct {
	Key string `json:"key"`
	// Reason: One of "missing", "value_not_allowed".
	Reason        string   `json:"reason"`
	Value         *string  `json:"value,omitempty"`
	AllowedValues []string `json:"allowedValues,omitempty"`
}

TagPolicyViolation is the `TagPolicyViolation` schema.

type TeamInvitationsCreateParams

type TeamInvitationsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body InviteRequest
}

TeamInvitationsCreateParams holds the parameters for `client.team.invitations.create`.

type TeamInvitationsDeleteParams

type TeamInvitationsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

TeamInvitationsDeleteParams holds the parameters for `client.team.invitations.delete`.

type TeamInvitationsListParams

type TeamInvitationsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

TeamInvitationsListParams holds the parameters for `client.team.invitations.list`.

Every field is optional; pass nil to take the defaults.

type TeamInvitationsNamespace

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

TeamInvitationsNamespace is `client.team.invitations`.

func (*TeamInvitationsNamespace) Create

Create: Create an invitation (token valid for 7 days)

_Requires permission: `team:invite`._

POST /api/org/{orgId}/team/invitations

Raises on 402: Payment required — the organization's plan does not include this

Raises on 403: The role would grant permissions the caller does not hold, or the caller is not an owner and tried to invite an owner

Raises on 409: All seats are in use; retry with addSeat to buy one more

Raises on 502: Buying the extra seat failed; the invitation was not sent

func (*TeamInvitationsNamespace) Delete

Delete: Revoke a pending invitation

_Requires permission: `team:invite`._

DELETE /api/org/{orgId}/team/invitations/{id}

Raises on 404: Not found

func (*TeamInvitationsNamespace) List

List: List pending and historical invitations

_Requires permission: `team:read`._

GET /api/org/{orgId}/team/invitations

type TeamMeParams

type TeamMeParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

TeamMeParams holds the parameters for `client.team.me`.

Every field is optional; pass nil to take the defaults.

type TeamMembersDeleteParams

type TeamMembersDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

TeamMembersDeleteParams holds the parameters for `client.team.members.delete`.

type TeamMembersListParams

type TeamMembersListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

TeamMembersListParams holds the parameters for `client.team.members.list`.

Every field is optional; pass nil to take the defaults.

type TeamMembersNamespace

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

TeamMembersNamespace is `client.team.members`.

func (*TeamMembersNamespace) Delete

Delete: Remove a member from the org

_Requires permission: `team:remove`._

DELETE /api/org/{orgId}/team/members/{id}

func (*TeamMembersNamespace) List

List: List org members

_Requires permission: `team:read`._

GET /api/org/{orgId}/team/members

func (*TeamMembersNamespace) Role

Role: Change a member's role

_Requires permission: `team:role:write`._

PATCH /api/org/{orgId}/team/members/{id}/role

type TeamMembersRoleParams

type TeamMembersRoleParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body RoleChangeRequest
}

TeamMembersRoleParams holds the parameters for `client.team.members.role`.

type TeamNamespace

type TeamNamespace struct {

	// Invitations: `client.team.invitations`.
	Invitations *TeamInvitationsNamespace
	// Members: `client.team.members`.
	Members *TeamMembersNamespace
	// Roles: `client.team.roles`.
	Roles *TeamRolesNamespace
	// contains filtered or unexported fields
}

TeamNamespace is `client.team`.

func (*TeamNamespace) Me

func (n *TeamNamespace) Me(ctx context.Context, params *TeamMeParams, opts ...RequestOption) (*MeResponse, error)

Me: Current user's effective permissions and role

GET /api/org/{orgId}/team/me

func (*TeamNamespace) Permissions

func (n *TeamNamespace) Permissions(ctx context.Context, params *TeamPermissionsParams, opts ...RequestOption) (*PermissionCatalog, error)

Permissions: List all permission strings the server recognises

_Requires permission: `team:read`._

GET /api/org/{orgId}/team/permissions

type TeamPermissionsParams

type TeamPermissionsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

TeamPermissionsParams holds the parameters for `client.team.permissions`.

Every field is optional; pass nil to take the defaults.

type TeamRolesCreateParams

type TeamRolesCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body RoleCreateRequest
}

TeamRolesCreateParams holds the parameters for `client.team.roles.create`.

type TeamRolesDeleteParams

type TeamRolesDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

TeamRolesDeleteParams holds the parameters for `client.team.roles.delete`.

type TeamRolesListParams

type TeamRolesListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

TeamRolesListParams holds the parameters for `client.team.roles.list`.

Every field is optional; pass nil to take the defaults.

type TeamRolesNamespace

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

TeamRolesNamespace is `client.team.roles`.

func (*TeamRolesNamespace) Create

func (n *TeamRolesNamespace) Create(ctx context.Context, params TeamRolesCreateParams, opts ...RequestOption) (*Role, error)

Create: Create a custom role

_Requires permission: `team:role:write`._

POST /api/org/{orgId}/team/roles

func (*TeamRolesNamespace) Delete

func (n *TeamRolesNamespace) Delete(ctx context.Context, params TeamRolesDeleteParams, opts ...RequestOption) (*OK, error)

Delete: Delete a custom role (must have no members or pending invitations)

_Requires permission: `team:role:write`._

DELETE /api/org/{orgId}/team/roles/{id}

Raises on 404: Not found

Raises on 409: Conflict

Raises on 422: Bad request

func (*TeamRolesNamespace) List

func (n *TeamRolesNamespace) List(ctx context.Context, params *TeamRolesListParams, opts ...RequestOption) ([]Role, error)

List: List roles (system + custom)

_Requires permission: `team:read`._

GET /api/org/{orgId}/team/roles

func (*TeamRolesNamespace) Update

func (n *TeamRolesNamespace) Update(ctx context.Context, params TeamRolesUpdateParams, opts ...RequestOption) (*Role, error)

Update: Edit a custom role

_Requires permission: `team:role:write`._

PATCH /api/org/{orgId}/team/roles/{id}

Raises on 404: Not found

Raises on 422: Bad request

type TeamRolesUpdateParams

type TeamRolesUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
	// Body: the JSON request body.
	Body RoleUpdateRequest
}

TeamRolesUpdateParams holds the parameters for `client.team.roles.update`.

type TerraformExport added in v1.3.0

type TerraformExport struct {
	Hcl         string                       `json:"hcl"`
	Exported    []TerraformExportExported    `json:"exported"`
	Unsupported []TerraformExportUnsupported `json:"unsupported"`
}

TerraformExport is the `TerraformExport` schema.

type TerraformExportExported added in v1.3.0

type TerraformExportExported struct {
	ID             ResourceID `json:"id"`
	DisplayName    string     `json:"displayName"`
	PluginID       string     `json:"pluginId"`
	ResourceTypeID string     `json:"resourceTypeId"`
	Address        string     `json:"address"`
	ImportID       *string    `json:"importId,omitempty"`
}

TerraformExportExported is an object the spec declares inline.

type TerraformExportUnsupported added in v1.3.0

type TerraformExportUnsupported struct {
	ID             ResourceID `json:"id"`
	DisplayName    string     `json:"displayName"`
	PluginID       string     `json:"pluginId"`
	ResourceTypeID string     `json:"resourceTypeId"`
	Reason         string     `json:"reason"`
}

TerraformExportUnsupported is an object the spec declares inline.

type UnitCostPoint added in v1.9.0

type UnitCostPoint struct {
	// Bucket: Bucket start date, YYYY-MM-DD.
	Bucket string `json:"bucket"`
	// Value: The ratio, or **null for a gap**. Never 0 and never infinite: a
	// bucket with no reported metric value is unknown, not free, and rendering
	// it as 0 would say the opposite of the truth. A zero numerator over a
	// positive denominator is a real 0 and is returned as one.
	Value *float64 `json:"value"`
	// Cost: Spend summed over the bucket, in the series' currency.
	Cost float64 `json:"cost"`
	// MetricValue: Metric value summed over the bucket, or null when nothing was
	// reported.
	MetricValue *float64 `json:"metricValue"`
	// Gap: Set exactly when `value` is null.
	//
	// One of "no_metric_value", "non_positive_metric_value",
	// "unconvertible_currency".
	Gap *string `json:"gap,omitempty"`
	// ReportedDays: Days in the bucket carrying a reported value, out of
	// `bucketDays`. When it is smaller, the denominator covers only part of the
	// bucket and the ratio there reads high.
	ReportedDays int64 `json:"reportedDays"`
	BucketDays   int64 `json:"bucketDays"`
}

UnitCostPoint is the `UnitCostPoint` schema.

type UnitCostQueryRequest added in v1.9.0

type UnitCostQueryRequest struct {
	// From: Inclusive, YYYY-MM-DD.
	From string `json:"from"`
	To   string `json:"to"`
	// Binning: One of "daily", "weekly", "monthly", "cumulative".
	Binning string `json:"binning"`
	// Mode: Absent is `unit_cost` (spend ÷ metric value). `margin` is `(revenue
	// − spend) ÷ revenue` as a fraction, and is a 400 for a metric whose `kind`
	// is not `currency`.
	//
	// One of "unit_cost", "margin".
	Mode *string `json:"mode,omitempty"`
	// Filters: Narrowing on top of the metric's own `costScope` — AND-composed,
	// never a replacement.
	Filters []BusinessMetricScopeTerm `json:"filters,omitempty"`
	// Query: The same narrowing as cost-query-language text.
	Query         *string `json:"query,omitempty"`
	SavedFilterID *string `json:"savedFilterId,omitempty"`
	// CostBasis: One of "cash", "amortized".
	CostBasis   *string  `json:"costBasis,omitempty"`
	ChargeTypes []string `json:"chargeTypes,omitempty"`
	// DisplayCurrency: Fold spend currencies the organization holds a rate for
	// into this one before dividing. Ignored for `margin`, which always converts
	// to the metric's own currency.
	DisplayCurrency *string `json:"displayCurrency,omitempty"`
}

UnitCostQueryRequest is the `UnitCostQueryRequest` schema.

type UnitCostQueryResponse added in v1.9.0

type UnitCostQueryResponse struct {
	Metric UnitCostQueryResponseMetric `json:"metric"`
	// Mode: One of "unit_cost", "margin".
	Mode string `json:"mode"`
	// Binning: One of "daily", "weekly", "monthly", "cumulative".
	Binning string `json:"binning"`
	// Series: One series per currency the numerator ended up in — usually one.
	// More than one means the organization has spend in a currency it holds no
	// rate for; rather than dropping that spend (understating every unit cost)
	// or adding it to another currency (inventing a number), each currency
	// divides the same denominator on its own.
	Series []UnitCostSeries `json:"series"`
	// Conversion: Set only when spend currencies were folded together; absent
	// means untouched.
	Conversion *UnitCostQueryResponseConversion `json:"conversion,omitempty"`
	// GapBuckets: Buckets on the axis that produced no ratio at all.
	GapBuckets int64 `json:"gapBuckets"`
	// PartialBuckets: Buckets whose denominator covers only part of the bucket.
	PartialBuckets int64 `json:"partialBuckets"`
}

UnitCostQueryResponse is the `UnitCostQueryResponse` schema.

type UnitCostQueryResponseConversion added in v1.9.0

type UnitCostQueryResponseConversion struct {
	DisplayCurrency string                                     `json:"displayCurrency"`
	Converted       []UnitCostQueryResponseConversionConverted `json:"converted"`
	Unconverted     []string                                   `json:"unconverted"`
}

UnitCostQueryResponseConversion is an object the spec declares inline.

type UnitCostQueryResponseConversionConverted added in v1.9.0

type UnitCostQueryResponseConversionConverted struct {
	Currency string                                          `json:"currency"`
	Rates    []UnitCostQueryResponseConversionConvertedRates `json:"rates"`
}

UnitCostQueryResponseConversionConverted is an object the spec declares inline.

type UnitCostQueryResponseConversionConvertedRates added in v1.9.0

type UnitCostQueryResponseConversionConvertedRates struct {
	EffectiveFrom string  `json:"effectiveFrom"`
	Rate          float64 `json:"rate"`
}

UnitCostQueryResponseConversionConvertedRates is an object the spec declares inline.

type UnitCostQueryResponseMetric added in v1.9.0

type UnitCostQueryResponseMetric struct {
	ID       string             `json:"id"`
	Key      string             `json:"key"`
	Name     string             `json:"name"`
	Unit     string             `json:"unit"`
	Kind     BusinessMetricKind `json:"kind"`
	Currency *string            `json:"currency"`
}

UnitCostQueryResponseMetric is an object the spec declares inline.

type UnitCostSeries added in v1.9.0

type UnitCostSeries struct {
	Currency string          `json:"currency"`
	Points   []UnitCostPoint `json:"points"`
	// OverallValue: The period ratio: **summed numerator ÷ summed denominator**,
	// not the mean of the per-bucket ratios — the mean weights a quiet Sunday
	// exactly as heavily as a peak Monday. Only buckets that produced a ratio
	// contribute, on both sides.
	OverallValue       *float64 `json:"overallValue"`
	OverallCost        float64  `json:"overallCost"`
	OverallMetricValue *float64 `json:"overallMetricValue"`
}

UnitCostSeries is the `UnitCostSeries` schema.

type UnpinRequest

type UnpinRequest struct {
	DashboardID string     `json:"dashboardId"`
	ResourceID  ResourceID `json:"resourceId"`
}

UnpinRequest is the `UnpinRequest` schema.

type UntaggedSpendReport added in v0.29.0

type UntaggedSpendReport struct {
	From         string   `json:"from"`
	To           string   `json:"to"`
	RequiredKeys []string `json:"requiredKeys"`
	Currencies   []string `json:"currencies"`
	// Totals: Currency code → amount in the currency's major unit.
	Totals map[string]float64 `json:"totals"`
	// UntaggedTotals: Spend on rows missing at least one required tag key, per
	// currency.
	UntaggedTotals map[string]float64               `json:"untaggedTotals"`
	ByKey          []UntaggedSpendReportByKey       `json:"byKey"`
	TopUntagged    []UntaggedSpendReportTopUntagged `json:"topUntagged"`
}

UntaggedSpendReport is the `UntaggedSpendReport` schema.

type UntaggedSpendReportByKey added in v0.29.0

type UntaggedSpendReportByKey struct {
	Key string `json:"key"`
	// Untagged: Currency code → amount in the currency's major unit.
	Untagged map[string]float64 `json:"untagged"`
}

UntaggedSpendReportByKey is an object the spec declares inline.

type UntaggedSpendReportTopUntagged added in v0.29.0

type UntaggedSpendReportTopUntagged struct {
	AccountID    string  `json:"accountId"`
	AccountLabel string  `json:"accountLabel"`
	Service      string  `json:"service"`
	Currency     string  `json:"currency"`
	Amount       float64 `json:"amount"`
}

UntaggedSpendReportTopUntagged is an object the spec declares inline.

type UpdateAccountRequest

type UpdateAccountRequest struct {
	DisplayName *string `json:"displayName,omitempty"`
	// BastionID: Pass `null` to unbind, a uuid to bind, or omit the field to
	// leave the binding unchanged.
	BastionID *string `json:"bastionId,omitempty"`
}

UpdateAccountRequest is the `UpdateAccountRequest` schema.

type UpdateResourceRequest

type UpdateResourceRequest struct {
	AccountID        string            `json:"accountId"`
	PluginID         string            `json:"pluginId"`
	ResourceTypeID   string            `json:"resourceTypeId"`
	ResourceID       ResourceID        `json:"resourceId"`
	Fields           map[string]string `json:"fields"`
	ParentResourceID *ResourceID       `json:"parentResourceId,omitempty"`
}

UpdateResourceRequest is the `UpdateResourceRequest` schema.

type UpdateResourceResponse

type UpdateResourceResponse struct {
	ID          ResourceID        `json:"id"`
	DisplayName string            `json:"displayName"`
	Fields      map[string]string `json:"fields"`
}

UpdateResourceResponse is the `UpdateResourceResponse` schema.

type UpdateWidgetRequest

type UpdateWidgetRequest struct {
	Title  *string    `json:"title,omitempty"`
	Config JSONObject `json:"config,omitempty"`
	GridX  *int64     `json:"gridX,omitempty"`
	GridY  *int64     `json:"gridY,omitempty"`
	GridW  *int64     `json:"gridW,omitempty"`
	GridH  *int64     `json:"gridH,omitempty"`
}

UpdateWidgetRequest is the `UpdateWidgetRequest` schema.

type UpdatedAccount

type UpdatedAccount struct {
	ID          string  `json:"id"`
	DisplayName string  `json:"displayName"`
	BastionID   *string `json:"bastionId"`
}

UpdatedAccount is the `UpdatedAccount` schema.

type UserSession

type UserSession struct {
	ID         string  `json:"id"`
	IPAddress  *string `json:"ipAddress"`
	UserAgent  *string `json:"userAgent"`
	AuthMethod string  `json:"authMethod"`
	Status     string  `json:"status"`
	ExpiresAt  string  `json:"expiresAt"`
	CreatedAt  string  `json:"createdAt"`
	UpdatedAt  string  `json:"updatedAt"`
	// Current: True for the session making this request
	Current bool `json:"current"`
}

UserSession is the `UserSession` schema.

type ValidateTabsRequest

type ValidateTabsRequest struct {
	Tabs []ValidateTabsRequestTabs `json:"tabs"`
}

ValidateTabsRequest is the `ValidateTabsRequest` schema.

type ValidateTabsRequestTabs

type ValidateTabsRequestTabs struct {
	ID     string    `json:"id"`
	Target TabTarget `json:"target"`
}

ValidateTabsRequestTabs is an object the spec declares inline.

type ValidateTabsResponse

type ValidateTabsResponse struct {
	ValidTabIDs []string `json:"validTabIds"`
}

ValidateTabsResponse is the `ValidateTabsResponse` schema.

type WallboardFailureLine added in v1.28.0

type WallboardFailureLine struct {
	ID     string  `json:"id"`
	Label  string  `json:"label"`
	Detail string  `json:"detail"`
	Since  *string `json:"since"`
}

WallboardFailureLine is the `WallboardFailureLine` schema.

type WallboardGetParams added in v1.28.0

type WallboardGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

WallboardGetParams holds the parameters for `client.wallboard.get`.

Every field is optional; pass nil to take the defaults.

type WallboardIncidentLine added in v1.28.0

type WallboardIncidentLine struct {
	ID        string `json:"id"`
	Title     string `json:"title"`
	Severity  string `json:"severity"`
	StartedAt string `json:"startedAt"`
	Status    string `json:"status"`
}

WallboardIncidentLine is the `WallboardIncidentLine` schema.

type WallboardNamespace added in v1.28.0

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

WallboardNamespace is `client.wallboard`.

func (*WallboardNamespace) Get added in v1.28.0

Get: Everything that is wrong right now, for a screen on a wall

A different reading of data the product already holds, built on one rule: a wallboard may only show things that are true **right now** and that somebody would cross a room to look at. There is deliberately no history, no trend and no breakdown — those belong on the page you open when you do walk over.

Four sources — declared incidents, synthetic probes, query monitors and account sync health — each guarded independently, because a television that goes blank because one query threw is showing nothing to a room that was relying on it.

Session-authenticated on purpose: unlike the calendar feed or a public status page, this carries incident titles, probe names and account names, and a screen in an office is exactly what a visitor photographs. The machine driving the wall signs in once.

GET /api/org/{orgId}/wallboard

type WallboardResponse added in v1.28.0

type WallboardResponse struct {
	// Status: Three states rather than five, because at four metres a person
	// distinguishes three colours reliably and nothing more. `down` is reserved
	// for the two things that mean customers are affected now — a sev1 incident
	// or a probe that is down; everything else that is wrong is `degraded`. A
	// source that could not be read is `degraded` and never `ok`.
	//
	// One of "ok", "degraded", "down".
	Status string          `json:"status"`
	Tiles  []WallboardTile `json:"tiles"`
	// Incidents: Unresolved incidents, newest first.
	Incidents []WallboardIncidentLine `json:"incidents"`
	// Failures: Probes that are down, query monitors breaching or unable to run,
	// accounts that stopped syncing.
	Failures []WallboardFailureLine `json:"failures"`
	// FailedSources: Sources that could not be read, **named on the screen**. A
	// wallboard showing green because a query failed is worse than a blank one —
	// it is actively telling the room the wrong thing.
	FailedSources []string `json:"failedSources"`
	GeneratedAt   string   `json:"generatedAt"`
}

WallboardResponse is the `WallboardResponse` schema.

type WallboardTile added in v1.28.0

type WallboardTile struct {
	ID    string `json:"id"`
	Label string `json:"label"`
	// Value: The number or short phrase, rendered in large type.
	Value  string  `json:"value"`
	Detail *string `json:"detail"`
	// Status: Three states rather than five, because at four metres a person
	// distinguishes three colours reliably and nothing more. `down` is reserved
	// for the two things that mean customers are affected now — a sev1 incident
	// or a probe that is down; everything else that is wrong is `degraded`. A
	// source that could not be read is `degraded` and never `ok`.
	//
	// One of "ok", "degraded", "down".
	Status string `json:"status"`
}

WallboardTile is the `WallboardTile` schema.

type WorkflowApproval added in v0.21.0

type WorkflowApproval struct {
	ID            string                 `json:"id"`
	WorkflowID    string                 `json:"workflowId"`
	WorkflowName  *string                `json:"workflowName"`
	RunID         string                 `json:"runId"`
	Title         string                 `json:"title"`
	Message       string                 `json:"message"`
	Status        WorkflowApprovalStatus `json:"status"`
	ExpiresAt     string                 `json:"expiresAt"`
	DecidedAt     *string                `json:"decidedAt"`
	DecidedByName *string                `json:"decidedByName"`
	CreatedAt     string                 `json:"createdAt"`
}

WorkflowApproval is the `WorkflowApproval` schema.

type WorkflowApprovalStatus added in v0.21.0

type WorkflowApprovalStatus = string

WorkflowApprovalStatus is the `WorkflowApprovalStatus` schema.

const (
	WorkflowApprovalStatusPending  WorkflowApprovalStatus = "pending"
	WorkflowApprovalStatusApproved WorkflowApprovalStatus = "approved"
	WorkflowApprovalStatusDenied   WorkflowApprovalStatus = "denied"
	WorkflowApprovalStatusExpired  WorkflowApprovalStatus = "expired"
)

The values WorkflowApprovalStatus takes.

type WorkflowApprovalsApproveParams added in v0.21.0

type WorkflowApprovalsApproveParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

WorkflowApprovalsApproveParams holds the parameters for `client.workflowApprovals.approve`.

type WorkflowApprovalsDenyParams added in v0.21.0

type WorkflowApprovalsDenyParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	ID    string
}

WorkflowApprovalsDenyParams holds the parameters for `client.workflowApprovals.deny`.

type WorkflowApprovalsListParams added in v0.21.0

type WorkflowApprovalsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID      *string
	Status     *WorkflowApprovalStatus
	WorkflowID *string
	RunID      *string
}

WorkflowApprovalsListParams holds the parameters for `client.workflowApprovals.list`.

Every field is optional; pass nil to take the defaults.

type WorkflowApprovalsNamespace added in v0.21.0

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

WorkflowApprovalsNamespace is `client.workflowApprovals`.

func (*WorkflowApprovalsNamespace) Approve added in v0.21.0

Approve: Approve a pending workflow approval request

The suspended run resumes within a few seconds of the decision landing.

_Requires permission: `workflows:approve`._

POST /api/org/{orgId}/workflow-approvals/{id}/approve

Raises on 404: Not found

Raises on 409: Conflict

func (*WorkflowApprovalsNamespace) Deny added in v0.21.0

Deny: Deny a pending workflow approval request

Denial fails the waiting `infra.waitForApproval(...)` call in the run.

_Requires permission: `workflows:approve`._

POST /api/org/{orgId}/workflow-approvals/{id}/deny

Raises on 404: Not found

Raises on 409: Conflict

func (*WorkflowApprovalsNamespace) List added in v0.21.0

List: List workflow approval requests

Approval requests raised by `infra.waitForApproval(...)` inside workflow runs, newest first. Filter with `status=pending` to build an approvals inbox.

_Requires permission: `workflows:read`._

GET /api/org/{orgId}/workflow-approvals

Raises on 400: Bad request

type WorkflowPinRequest

type WorkflowPinRequest struct {
	DashboardID string `json:"dashboardId"`
	WorkflowID  string `json:"workflowId"`
}

WorkflowPinRequest is the `WorkflowPinRequest` schema.

type WorkflowSchedule added in v0.28.0

type WorkflowSchedule struct {
	// Expression: Standard 5-field cron expression (minute hour day-of-month
	// month day-of-week). Supports `*`, lists, ranges, and steps; 3-letter
	// month/weekday names; `7` as Sunday. When both day fields are restricted, a
	// date matches if either does (POSIX).
	Expression string `json:"expression"`
	// Timezone: IANA timezone the expression's wall times are evaluated in. Omit
	// or null for UTC.
	Timezone *string `json:"timezone"`
	// Enabled: Mirrors the workflow's enabled flag — a disabled workflow's
	// schedule never fires.
	Enabled bool `json:"enabled"`
	// LastRunAt: When the workflow last finished a run (any trigger source).
	LastRunAt *string `json:"lastRunAt"`
	// NextRunAt: The persisted next fire time the scheduler will claim. Null
	// while disabled, or when the expression never matches.
	NextRunAt *string `json:"nextRunAt"`
	// NextRuns: Preview of the next few fire times, computed at read time.
	NextRuns []string `json:"nextRuns"`
}

WorkflowSchedule is the `WorkflowSchedule` schema.

type WorkflowScheduleInput added in v0.28.0

type WorkflowScheduleInput struct {
	// Expression: Standard 5-field cron expression (minute hour day-of-month
	// month day-of-week). Supports `*`, lists, ranges, and steps; 3-letter
	// month/weekday names; `7` as Sunday. When both day fields are restricted, a
	// date matches if either does (POSIX).
	Expression string `json:"expression"`
	// Timezone: IANA timezone the expression's wall times are evaluated in. Omit
	// or null for UTC.
	Timezone *string `json:"timezone,omitempty"`
	// Enabled: Also set the workflow's enabled flag. Omit to leave it unchanged.
	Enabled *bool `json:"enabled,omitempty"`
}

WorkflowScheduleInput is the `WorkflowScheduleInput` schema.

type WorkflowScheduleResponse added in v0.28.0

type WorkflowScheduleResponse struct {
	// Schedule: Null when the workflow's trigger is not cron.
	Schedule *WorkflowSchedule `json:"schedule"`
}

WorkflowScheduleResponse is the `WorkflowScheduleResponse` schema.

type WorkflowSecret added in v1.24.0

type WorkflowSecret struct {
	ID string `json:"id"`
	// Name: JavaScript dot identifier used to expose the value to workflow code,
	// for example `API_TOKEN` or `stripe.apiKey`.
	Name        string  `json:"name"`
	Description *string `json:"description"`
	// HasValue: Whether an encrypted value is stored. The value is never
	// returned.
	HasValue  bool   `json:"hasValue"`
	CreatedAt string `json:"createdAt"`
	UpdatedAt string `json:"updatedAt"`
}

WorkflowSecret is the `WorkflowSecret` schema.

type WorkflowSecretAssignment added in v1.24.0

type WorkflowSecretAssignment struct {
	SecretIDs []string         `json:"secretIds"`
	Secrets   []WorkflowSecret `json:"secrets"`
}

WorkflowSecretAssignment is the `WorkflowSecretAssignment` schema.

type WorkflowSecretAssignmentInput added in v1.24.0

type WorkflowSecretAssignmentInput struct {
	SecretIDs []string `json:"secretIds"`
}

WorkflowSecretAssignmentInput is the `WorkflowSecretAssignmentInput` schema.

type WorkflowSecretCreate added in v1.24.0

type WorkflowSecretCreate struct {
	// Name: JavaScript dot identifier used to expose the value to workflow code,
	// for example `API_TOKEN` or `stripe.apiKey`.
	Name        string  `json:"name"`
	Description *string `json:"description,omitempty"`
}

WorkflowSecretCreate is the `WorkflowSecretCreate` schema.

type WorkflowSecretUpdate added in v1.24.0

type WorkflowSecretUpdate struct {
	// Name: JavaScript dot identifier used to expose the value to workflow code,
	// for example `API_TOKEN` or `stripe.apiKey`.
	Name        *string `json:"name,omitempty"`
	Description *string `json:"description,omitempty"`
}

WorkflowSecretUpdate is the `WorkflowSecretUpdate` schema.

type WorkflowSecretValueWrite added in v1.24.0

type WorkflowSecretValueWrite struct {
	// Value: Write-only plaintext. It is AES-256-GCM encrypted before storage
	// and is never returned.
	Value string `json:"value"`
}

WorkflowSecretValueWrite is the `WorkflowSecretValueWrite` schema.

type WorkflowSecretsCreateParams added in v1.24.0

type WorkflowSecretsCreateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// Body: the JSON request body.
	Body WorkflowSecretCreate
}

WorkflowSecretsCreateParams holds the parameters for `client.workflowSecrets.create`.

type WorkflowSecretsDeleteParams added in v1.24.0

type WorkflowSecretsDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow secret id
	ID string
}

WorkflowSecretsDeleteParams holds the parameters for `client.workflowSecrets.delete`.

type WorkflowSecretsListParams added in v1.24.0

type WorkflowSecretsListParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
}

WorkflowSecretsListParams holds the parameters for `client.workflowSecrets.list`.

Every field is optional; pass nil to take the defaults.

type WorkflowSecretsNamespace added in v1.24.0

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

WorkflowSecretsNamespace is `client.workflowSecrets`.

func (*WorkflowSecretsNamespace) Create added in v1.24.0

Create: Create workflow secret metadata

Creates metadata without a value. Write the value separately through the write-only value endpoint.

_Requires permission: `secrets:write`._

POST /api/org/{orgId}/workflow-secrets

Raises on 400: Bad request

Raises on 409: Conflict

func (*WorkflowSecretsNamespace) Delete added in v1.24.0

Delete: Delete a workflow secret

Also removes every workflow assignment through database cascades.

_Requires permission: `secrets:write`._

DELETE /api/org/{orgId}/workflow-secrets/{id}

Raises on 404: Not found

func (*WorkflowSecretsNamespace) List added in v1.24.0

List: List reusable workflow secrets

Returns metadata and hasValue only; plaintext values are never returned.

_Requires permission: `secrets:read`._

GET /api/org/{orgId}/workflow-secrets

func (*WorkflowSecretsNamespace) Update added in v1.24.0

Update: Update workflow secret metadata

_Requires permission: `secrets:write`._

PATCH /api/org/{orgId}/workflow-secrets/{id}

Raises on 400: Bad request

Raises on 404: Not found

Raises on 409: Conflict

func (*WorkflowSecretsNamespace) Value added in v1.24.0

Value: Write a workflow secret value

Write-only. The response contains metadata and hasValue, never the supplied plaintext.

_Requires permission: `secrets:write`._

PUT /api/org/{orgId}/workflow-secrets/{id}/value

Raises on 400: Bad request

Raises on 404: Not found

type WorkflowSecretsUpdateParams added in v1.24.0

type WorkflowSecretsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow secret id
	ID string
	// Body: the JSON request body.
	Body WorkflowSecretUpdate
}

WorkflowSecretsUpdateParams holds the parameters for `client.workflowSecrets.update`.

type WorkflowSecretsValueParams added in v1.24.0

type WorkflowSecretsValueParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow secret id
	ID string
	// Body: the JSON request body.
	Body WorkflowSecretValueWrite
}

WorkflowSecretsValueParams holds the parameters for `client.workflowSecrets.value`.

type WorkflowTypingsResponse added in v1.23.0

type WorkflowTypingsResponse struct {
	// Dts: Ambient TypeScript declarations for this workflow's `infra` API — the
	// same file the Monaco editor and `check` endpoint type against.
	Dts string `json:"dts"`
}

WorkflowTypingsResponse is the `WorkflowTypingsResponse` schema.

type WorkflowsNamespace added in v0.28.0

type WorkflowsNamespace struct {

	// Schedule: `client.workflows.schedule`.
	Schedule *WorkflowsScheduleNamespace
	// Secrets: `client.workflows.secrets`.
	Secrets *WorkflowsSecretsNamespace
	// contains filtered or unexported fields
}

WorkflowsNamespace is `client.workflows`.

func (*WorkflowsNamespace) Typings added in v1.23.0

Typings: Generated infra.d.ts for a workflow

The ambient TypeScript declarations workflow source is written against, specialized with this organization's connected accounts, resource types, SSH key names, and the workflow's trigger + metrics. Default is the fast static surface (`create` fields are `Record<string, string>`). Pass `enrich=1` for a second pass that hits provider APIs for precise create() field unions and live sidecar capability flags — the editor loads static first and upgrades when that finishes.

_Requires permission: `workflows:read`._

GET /api/org/{orgId}/workflows/{id}/typings

Raises on 404: Not found

type WorkflowsScheduleDeleteParams added in v0.28.0

type WorkflowsScheduleDeleteParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow id
	ID string
}

WorkflowsScheduleDeleteParams holds the parameters for `client.workflows.schedule.delete`.

type WorkflowsScheduleGetParams added in v0.28.0

type WorkflowsScheduleGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow id
	ID string
}

WorkflowsScheduleGetParams holds the parameters for `client.workflows.schedule.get`.

type WorkflowsScheduleNamespace added in v0.28.0

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

WorkflowsScheduleNamespace is `client.workflows.schedule`.

func (*WorkflowsScheduleNamespace) Delete added in v0.28.0

Delete: Remove a workflow's cron schedule

Reverts the workflow's trigger to manual and clears the pending fire time. A no-op when the trigger is not cron.

_Requires permission: `dashboards:write`._

DELETE /api/org/{orgId}/workflows/{id}/schedule

Raises on 404: Not found

func (*WorkflowsScheduleNamespace) Get added in v0.28.0

Get: Get a workflow's cron schedule

The schedule view of the workflow's trigger, with the next few computed fire times. `schedule` is null when the workflow is triggered some other way (manual, git, budget).

_Requires permission: `dashboards:read`._

GET /api/org/{orgId}/workflows/{id}/schedule

Raises on 404: Not found

func (*WorkflowsScheduleNamespace) Update added in v0.28.0

Update: Create or replace a workflow's cron schedule

Sets the workflow's trigger to cron with the given expression and timezone, validating both, and computes the next fire time. The workflow fires at the schedule's next occurrence — never immediately on save.

_Requires permission: `dashboards:write`._

PUT /api/org/{orgId}/workflows/{id}/schedule

Raises on 400: Bad request

Raises on 404: Not found

type WorkflowsScheduleUpdateParams added in v0.28.0

type WorkflowsScheduleUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow id
	ID string
	// Body: the JSON request body.
	Body WorkflowScheduleInput
}

WorkflowsScheduleUpdateParams holds the parameters for `client.workflows.schedule.update`.

type WorkflowsSecretsGetParams added in v1.24.0

type WorkflowsSecretsGetParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow id
	ID string
}

WorkflowsSecretsGetParams holds the parameters for `client.workflows.secrets.get`.

type WorkflowsSecretsNamespace added in v1.24.0

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

WorkflowsSecretsNamespace is `client.workflows.secrets`.

func (*WorkflowsSecretsNamespace) Get added in v1.24.0

Get: List a workflow's assigned secrets

Returns assigned ids and metadata only, never values.

_Requires permission: `secrets:read`._

GET /api/org/{orgId}/workflows/{id}/secrets

Raises on 404: Not found

func (*WorkflowsSecretsNamespace) Update added in v1.24.0

Update: Replace a workflow's secret assignments

_Requires permission: `workflows:write`._

PUT /api/org/{orgId}/workflows/{id}/secrets

Raises on 400: Bad request

Raises on 404: Not found

type WorkflowsSecretsUpdateParams added in v1.24.0

type WorkflowsSecretsUpdateParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow id
	ID string
	// Body: the JSON request body.
	Body WorkflowSecretAssignmentInput
}

WorkflowsSecretsUpdateParams holds the parameters for `client.workflows.secrets.update`.

type WorkflowsTypingsParams added in v1.23.0

type WorkflowsTypingsParams struct {
	// OrgID: Organization id
	//
	// Falls back to the client's `orgId` when omitted.
	OrgID *string
	// ID: Workflow id
	ID string
	// Enrich: When `1` or `true`, enrich create() field shapes and sidecar
	// capabilities from live provider configs. Omit for the fast static surface.
	//
	// One of "1", "true".
	Enrich *string
}

WorkflowsTypingsParams holds the parameters for `client.workflows.typings`.

Jump to

Keyboard shortcuts

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