Documentation
¶
Overview ¶
Package sinatra is the official Go client for sinatra.dev, the AI coding agent that turns Linear and GitHub issues into pull requests: start, follow and stop Sinatra tasks, and delegate Linear and GitHub issues.
The types (Task, Message, Me, ...) are generated from the API's OpenAPI spec into api.gen.go. The client in this file adds authentication, retries, idempotency keys, timeouts and pagination on top.
client, err := sinatra.NewClient() // reads SINATRA_TOKEN me, err := client.Me.Get(ctx)
Fields such as Task.Status, Task.Source, Message.Role, Message.Kind and Error.Code are plain strings, and the API adds values over time: handle values you don't recognise.
Reference: https://docs.sinatra.dev/docs/api-reference
Index ¶
- Constants
- func Ptr[T any](v T) *T
- type Account
- type BillingCheckoutJSONRequestBody
- type BillingCheckoutRequest
- type BillingCheckoutRequestPlan
- type BillingHandoff
- type BillingPortalJSONRequestBody
- type BillingPortalRequest
- type CallOption
- type Client
- type CreateMessageRequest
- type CreateMessageResponse
- type CreateTaskRequest
- type CreateTaskResponse
- type DelegateGithubTicket
- type DelegateGithubTicketSource
- type DelegateLinearTicket
- type DelegateLinearTicketSource
- type DelegateTarget
- type DelegateTicketRequest
- func (t DelegateTicketRequest) AsDelegateGithubTicket() (DelegateGithubTicket, error)
- func (t DelegateTicketRequest) AsDelegateLinearTicket() (DelegateLinearTicket, error)
- func (t DelegateTicketRequest) Discriminator() (string, error)
- func (t *DelegateTicketRequest) FromDelegateGithubTicket(v DelegateGithubTicket) error
- func (t *DelegateTicketRequest) FromDelegateLinearTicket(v DelegateLinearTicket) error
- func (t DelegateTicketRequest) MarshalJSON() ([]byte, error)
- func (t *DelegateTicketRequest) MergeDelegateGithubTicket(v DelegateGithubTicket) error
- func (t *DelegateTicketRequest) MergeDelegateLinearTicket(v DelegateLinearTicket) error
- func (t *DelegateTicketRequest) UnmarshalJSON(b []byte) error
- func (t DelegateTicketRequest) ValueByDiscriminator() (interface{}, error)
- type DelegateTicketResponse
- type DelegateTicketResponseOk
- type EmailPreferences
- type Error
- type ErrorBody
- type IdempotencyKey
- type IntegrationConnect
- type IntegrationsConnectParamsIntegration
- type Me
- type MeService
- type MeUpdateEmailPreferencesJSONRequestBody
- type Message
- type MessageList
- type MessagesCreateJSONRequestBody
- type MessagesCreateParams
- type MessagesListParams
- type MessagesService
- func (s *MessagesService) Create(ctx context.Context, workspaceID, taskID string, body CreateMessageRequest, ...) (*CreateMessageResponse, error)
- func (s *MessagesService) List(ctx context.Context, workspaceID, taskID string, params *MessagesListParams) (*MessageList, error)
- func (s *MessagesService) ListAll(ctx context.Context, workspaceID, taskID string, params *MessagesListParams) iter.Seq2[Message, error]
- type Option
- type PullRequest
- type RepoCapabilityRequests
- type RepoConfig
- type RepoConfigPreflight
- type RepoEnvironment
- type RepoOverrideRequest
- type RepoSecret
- type RepoSecretPatchRequest
- type RepoSecretPutRequest
- type RepoSecrets
- type ReposPatchSecretJSONRequestBody
- type ReposPreflightJSONRequestBody
- type ReposPutSecretJSONRequestBody
- type ReposSetOverrideJSONRequestBody
- type StopTaskResponse
- type StopTaskResponseAccepted
- type SubscriptionsComplete200
- type SubscriptionsComplete200Status
- type SubscriptionsCompleteJSONRequestBody
- type SubscriptionsCompleteRequest
- type SubscriptionsList200
- type SubscriptionsList200ConnectionsProvider
- type SubscriptionsPoll200
- func (t SubscriptionsPoll200) AsSubscriptionsComplete200() (SubscriptionsComplete200, error)
- func (t SubscriptionsPoll200) AsSubscriptionsPoll2000() (SubscriptionsPoll2000, error)
- func (t *SubscriptionsPoll200) FromSubscriptionsComplete200(v SubscriptionsComplete200) error
- func (t *SubscriptionsPoll200) FromSubscriptionsPoll2000(v SubscriptionsPoll2000) error
- func (t SubscriptionsPoll200) MarshalJSON() ([]byte, error)
- func (t *SubscriptionsPoll200) MergeSubscriptionsComplete200(v SubscriptionsComplete200) error
- func (t *SubscriptionsPoll200) MergeSubscriptionsPoll2000(v SubscriptionsPoll2000) error
- func (t *SubscriptionsPoll200) UnmarshalJSON(b []byte) error
- type SubscriptionsPoll400
- func (t SubscriptionsPoll400) AsErrorBody() (ErrorBody, error)
- func (t SubscriptionsPoll400) AsSubscriptionsPoll4001() (SubscriptionsPoll4001, error)
- func (t SubscriptionsPoll400) AsSubscriptionsPoll4002() (SubscriptionsPoll4002, error)
- func (t *SubscriptionsPoll400) FromErrorBody(v ErrorBody) error
- func (t *SubscriptionsPoll400) FromSubscriptionsPoll4001(v SubscriptionsPoll4001) error
- func (t *SubscriptionsPoll400) FromSubscriptionsPoll4002(v SubscriptionsPoll4002) error
- func (t SubscriptionsPoll400) MarshalJSON() ([]byte, error)
- func (t *SubscriptionsPoll400) MergeErrorBody(v ErrorBody) error
- func (t *SubscriptionsPoll400) MergeSubscriptionsPoll4001(v SubscriptionsPoll4001) error
- func (t *SubscriptionsPoll400) MergeSubscriptionsPoll4002(v SubscriptionsPoll4002) error
- func (t *SubscriptionsPoll400) UnmarshalJSON(b []byte) error
- type SubscriptionsPoll2000
- type SubscriptionsPoll2000Status
- type SubscriptionsPoll4001
- type SubscriptionsPoll4001Status
- type SubscriptionsPoll4002
- type SubscriptionsPoll4002Error
- type SubscriptionsPoll4002Status
- type SubscriptionsPollJSONRequestBody
- type SubscriptionsPollParamsProvider
- type SubscriptionsPollRequest
- func (t SubscriptionsPollRequest) AsSubscriptionsPollRequest0() (SubscriptionsPollRequest0, error)
- func (t SubscriptionsPollRequest) AsSubscriptionsPollRequest1() (SubscriptionsPollRequest1, error)
- func (t SubscriptionsPollRequest) AsSubscriptionsPollRequest2() (SubscriptionsPollRequest2, error)
- func (t *SubscriptionsPollRequest) FromSubscriptionsPollRequest0(v SubscriptionsPollRequest0) error
- func (t *SubscriptionsPollRequest) FromSubscriptionsPollRequest1(v SubscriptionsPollRequest1) error
- func (t *SubscriptionsPollRequest) FromSubscriptionsPollRequest2(v SubscriptionsPollRequest2) error
- func (t SubscriptionsPollRequest) MarshalJSON() ([]byte, error)
- func (t *SubscriptionsPollRequest) MergeSubscriptionsPollRequest0(v SubscriptionsPollRequest0) error
- func (t *SubscriptionsPollRequest) MergeSubscriptionsPollRequest1(v SubscriptionsPollRequest1) error
- func (t *SubscriptionsPollRequest) MergeSubscriptionsPollRequest2(v SubscriptionsPollRequest2) error
- func (t *SubscriptionsPollRequest) UnmarshalJSON(b []byte) error
- type SubscriptionsPollRequest0
- type SubscriptionsPollRequest1
- type SubscriptionsPollRequest2
- type SubscriptionsStart200
- func (t SubscriptionsStart200) AsSubscriptionsStart2000() (SubscriptionsStart2000, error)
- func (t SubscriptionsStart200) AsSubscriptionsStart2001() (SubscriptionsStart2001, error)
- func (t SubscriptionsStart200) AsSubscriptionsStart2002() (SubscriptionsStart2002, error)
- func (t SubscriptionsStart200) AsSubscriptionsStart2003() (SubscriptionsStart2003, error)
- func (t *SubscriptionsStart200) FromSubscriptionsStart2000(v SubscriptionsStart2000) error
- func (t *SubscriptionsStart200) FromSubscriptionsStart2001(v SubscriptionsStart2001) error
- func (t *SubscriptionsStart200) FromSubscriptionsStart2002(v SubscriptionsStart2002) error
- func (t *SubscriptionsStart200) FromSubscriptionsStart2003(v SubscriptionsStart2003) error
- func (t SubscriptionsStart200) MarshalJSON() ([]byte, error)
- func (t *SubscriptionsStart200) MergeSubscriptionsStart2000(v SubscriptionsStart2000) error
- func (t *SubscriptionsStart200) MergeSubscriptionsStart2001(v SubscriptionsStart2001) error
- func (t *SubscriptionsStart200) MergeSubscriptionsStart2002(v SubscriptionsStart2002) error
- func (t *SubscriptionsStart200) MergeSubscriptionsStart2003(v SubscriptionsStart2003) error
- func (t *SubscriptionsStart200) UnmarshalJSON(b []byte) error
- type SubscriptionsStart2000
- type SubscriptionsStart2001
- type SubscriptionsStart2002
- type SubscriptionsStart2003
- type SubscriptionsStartParamsProvider
- type SubscriptionsUpdate200
- type SubscriptionsUpdateJSONRequestBody
- type SubscriptionsUpdateRequest
- type SubscriptionsUpdateRequestMakePrimary
- type SubscriptionsUsage200
- func (t SubscriptionsUsage200) AsSubscriptionsUsage2000() (SubscriptionsUsage2000, error)
- func (t SubscriptionsUsage200) AsSubscriptionsUsage2001() (SubscriptionsUsage2001, error)
- func (t SubscriptionsUsage200) AsSubscriptionsUsage2002() (SubscriptionsUsage2002, error)
- func (t SubscriptionsUsage200) AsSubscriptionsUsage2003() (SubscriptionsUsage2003, error)
- func (t *SubscriptionsUsage200) FromSubscriptionsUsage2000(v SubscriptionsUsage2000) error
- func (t *SubscriptionsUsage200) FromSubscriptionsUsage2001(v SubscriptionsUsage2001) error
- func (t *SubscriptionsUsage200) FromSubscriptionsUsage2002(v SubscriptionsUsage2002) error
- func (t *SubscriptionsUsage200) FromSubscriptionsUsage2003(v SubscriptionsUsage2003) error
- func (t SubscriptionsUsage200) MarshalJSON() ([]byte, error)
- func (t *SubscriptionsUsage200) MergeSubscriptionsUsage2000(v SubscriptionsUsage2000) error
- func (t *SubscriptionsUsage200) MergeSubscriptionsUsage2001(v SubscriptionsUsage2001) error
- func (t *SubscriptionsUsage200) MergeSubscriptionsUsage2002(v SubscriptionsUsage2002) error
- func (t *SubscriptionsUsage200) MergeSubscriptionsUsage2003(v SubscriptionsUsage2003) error
- func (t *SubscriptionsUsage200) UnmarshalJSON(b []byte) error
- type SubscriptionsUsage2000
- type SubscriptionsUsage2001
- type SubscriptionsUsage2002
- type SubscriptionsUsage2002Kind
- type SubscriptionsUsage2002OverallUnit
- type SubscriptionsUsage2003
- type Task
- type TaskList
- type TasksCreateJSONRequestBody
- type TasksCreateParams
- type TasksListParams
- type TasksService
- func (s *TasksService) Create(ctx context.Context, workspaceID string, body CreateTaskRequest, ...) (*CreateTaskResponse, error)
- func (s *TasksService) Get(ctx context.Context, workspaceID, taskID string) (*Task, error)
- func (s *TasksService) List(ctx context.Context, workspaceID string, params *TasksListParams) (*TaskList, error)
- func (s *TasksService) ListAll(ctx context.Context, workspaceID string, params *TasksListParams) iter.Seq2[Task, error]
- func (s *TasksService) Stop(ctx context.Context, workspaceID, taskID string) (*StopTaskResponse, error)
- type Ticket
- type TicketSearchResult
- type TicketsDelegateJSONRequestBody
- type TicketsSearchParams
- type TicketsService
- type UpdateEmailPreferencesRequest
- func (t UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest0() (UpdateEmailPreferencesRequest0, error)
- func (t UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest1() (UpdateEmailPreferencesRequest1, error)
- func (t *UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest0(v UpdateEmailPreferencesRequest0) error
- func (t *UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest1(v UpdateEmailPreferencesRequest1) error
- func (t UpdateEmailPreferencesRequest) MarshalJSON() ([]byte, error)
- func (t *UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest0(v UpdateEmailPreferencesRequest0) error
- func (t *UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest1(v UpdateEmailPreferencesRequest1) error
- func (t *UpdateEmailPreferencesRequest) UnmarshalJSON(b []byte) error
- type UpdateEmailPreferencesRequest0
- type UpdateEmailPreferencesRequest1
- type Workspace
- type WorkspaceAccess
- type WorkspaceAccessApproveRequestJSONRequestBody
- type WorkspaceAccessApproved
- type WorkspaceAccessCreateInviteJSONRequestBody
- type WorkspaceAccessDenied
- type WorkspaceAccessOk
- type WorkspaceAccessOkOk
- type WorkspaceAccessSetRoleJSONRequestBody
- type WorkspaceGrantRoleRequest
- type WorkspaceGrantRoleRequestRole
- type WorkspaceInvite
- type WorkspaceInviteCreateRequest
- type WorkspaceInviteCreateRequestRole
- type WorkspaceInviteResponse
- type WorkspaceMembershipResponse
- type WorkspaceModelDefault
- type WorkspaceModelKey
- type WorkspaceModelKeyRequest
- type WorkspaceModelKeyRequestProvider
- type WorkspaceModelKeys
- type WorkspaceModelSelection
- type WorkspaceModelsAddKeyJSONRequestBody
- type WorkspaceModelsRemoveKeyParamsProvider
- type WorkspaceModelsSetDefaultJSONRequestBody
- type WorkspaceOverview
- type WorkspaceOwnershipTransferred
- type WorkspacePlanStatus
- func (t WorkspacePlanStatus) AsWorkspacePlanStatus0() (WorkspacePlanStatus0, error)
- func (t WorkspacePlanStatus) AsWorkspacePlanStatus1() (WorkspacePlanStatus1, error)
- func (t *WorkspacePlanStatus) FromWorkspacePlanStatus0(v WorkspacePlanStatus0) error
- func (t *WorkspacePlanStatus) FromWorkspacePlanStatus1(v WorkspacePlanStatus1) error
- func (t WorkspacePlanStatus) MarshalJSON() ([]byte, error)
- func (t *WorkspacePlanStatus) MergeWorkspacePlanStatus0(v WorkspacePlanStatus0) error
- func (t *WorkspacePlanStatus) MergeWorkspacePlanStatus1(v WorkspacePlanStatus1) error
- func (t *WorkspacePlanStatus) UnmarshalJSON(b []byte) error
- type WorkspacePlanStatus0
- type WorkspacePlanStatus0Plan
- type WorkspacePlanStatus1
- type WorkspacePlanStatus1Plan
Constants ¶
const ( // DefaultBaseURL is the API the client talks to unless WithBaseURL says otherwise. DefaultBaseURL = "https://api.sinatra.dev" // DefaultTimeout is how long each attempt of a request may take, unless // WithTimeout says otherwise. DefaultTimeout = 60 * time.Second )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Account ¶ added in v0.1.8
type Account struct {
LinkedAccounts struct {
// Telegram Telegram's dashboard-visible account state. Identity, routing and bot are null when unavailable.
Telegram struct {
Available bool `json:"available"`
Bot *struct {
Url string `json:"url"`
Username string `json:"username"`
} `json:"bot"`
Identity *struct {
DisplayName *string `json:"displayName"`
LinkedAt time.Time `json:"linkedAt"`
TelegramUserId string `json:"telegramUserId"`
} `json:"identity"`
RequestWorkspaces *struct {
Current *struct {
Id string `json:"id"`
Name *string `json:"name"`
Usable bool `json:"usable"`
} `json:"current"`
Options []struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"options"`
RoutesTo *struct {
Id string `json:"id"`
Name string `json:"name"`
} `json:"routesTo"`
} `json:"requestWorkspaces"`
} `json:"telegram"`
} `json:"linkedAccounts"`
// Memberships Your memberships and dashboard workspace summaries, ordered by workspace name.
Memberships []struct {
Membership struct {
Id string `json:"id"`
Role string `json:"role"`
WorkspaceId string `json:"workspaceId"`
} `json:"membership"`
Workspace struct {
CreatedAt time.Time `json:"createdAt"`
GithubAccountLogin *string `json:"githubAccountLogin"`
GithubAccountType *string `json:"githubAccountType"`
Id string `json:"id"`
LinearOrganizationName *string `json:"linearOrganizationName"`
Name string `json:"name"`
} `json:"workspace"`
} `json:"memberships"`
// User Your dashboard-visible account identity. Credentials and session metadata are never returned.
User struct {
AvatarUrl *string `json:"avatarUrl"`
Email string `json:"email"`
GithubLogin *string `json:"githubLogin"`
Id string `json:"id"`
LinearUserId *string `json:"linearUserId"`
Name *string `json:"name"`
} `json:"user"`
}
Account Your own account, combining the dashboard's profile and linked accounts. The workspace path checks membership; the account belongs to the token's user, not the workspace owner.
type BillingCheckoutJSONRequestBody ¶ added in v0.1.9
type BillingCheckoutJSONRequestBody = BillingCheckoutRequest
BillingCheckoutJSONRequestBody defines body for BillingCheckout for application/json ContentType.
type BillingCheckoutRequest ¶ added in v0.1.9
type BillingCheckoutRequest struct {
// Plan The paid capacity plan to buy.
Plan BillingCheckoutRequestPlan `json:"plan"`
}
BillingCheckoutRequest defines model for BillingCheckoutRequest.
type BillingCheckoutRequestPlan ¶ added in v0.1.9
type BillingCheckoutRequestPlan string
BillingCheckoutRequestPlan The paid capacity plan to buy.
const ( BillingCheckoutRequestPlanPro BillingCheckoutRequestPlan = "pro" BillingCheckoutRequestPlanScale BillingCheckoutRequestPlan = "scale" BillingCheckoutRequestPlanTeam BillingCheckoutRequestPlan = "team" )
Defines values for BillingCheckoutRequestPlan.
func (BillingCheckoutRequestPlan) Valid ¶ added in v0.1.9
func (e BillingCheckoutRequestPlan) Valid() bool
Valid indicates whether the value is a known member of the BillingCheckoutRequestPlan enum.
type BillingHandoff ¶ added in v0.1.9
type BillingHandoff struct {
// Url An owner-only Stripe-hosted URL. Open it to continue; no billing credentials are returned.
Url string `json:"url"`
}
BillingHandoff defines model for BillingHandoff.
type BillingPortalJSONRequestBody ¶ added in v0.1.9
type BillingPortalJSONRequestBody = BillingPortalRequest
BillingPortalJSONRequestBody defines body for BillingPortal for application/json ContentType.
type BillingPortalRequest ¶ added in v0.1.9
type BillingPortalRequest = map[string]interface{}
BillingPortalRequest defines model for BillingPortalRequest.
type CallOption ¶
type CallOption func(*callOptions)
CallOption configures one call of Tasks.Create or Messages.Create.
func WithIdempotencyKey ¶
func WithIdempotencyKey(key string) CallOption
WithIdempotencyKey sets the call's Idempotency-Key: 1 to 128 printable ASCII characters, with no spaces. Without it, the client makes a random UUID. Either way, every retry of the call sends the same key, so a retried start never starts a second task. Pass your own key to make a retry safe across process restarts too.
type Client ¶
type Client struct {
Me *MeService
Tasks *TasksService
Messages *MessagesService
Tickets *TicketsService
// contains filtered or unexported fields
}
Client is a Sinatra API client. Its services mirror the API's operations: Me.Get is GET /v1/me, Tasks.Create is POST /v1/workspaces/{workspaceId}/tasks. A Client is safe for concurrent use.
Requests that are safe to repeat (GETs, the token DELETE, and starts and messages, which always carry an Idempotency-Key) are retried up to 3 times on 429 and 503. Tasks.Stop is retried on 503 only, Tickets.Delegate never. Error responses are returned as *Error.
type CreateMessageRequest ¶
type CreateMessageRequest struct {
// Text The message, up to 100,000 characters after trimming.
Text string `json:"text"`
}
CreateMessageRequest A message to send on a task.
type CreateMessageResponse ¶
type CreateMessageResponse struct {
// MessageId The message's id: the `Idempotency-Key` you sent, or a generated id.
MessageId string `json:"messageId"`
}
CreateMessageResponse The message that was sent.
type CreateTaskRequest ¶
type CreateTaskRequest struct {
// Model A model from Sinatra's catalog, such as `anthropic/claude-opus-5-5` or `openai-codex/gpt-6.1-sol`, that every agent on the task runs on. The model picks its engine. Omit it to use the repository's or workspace's model.
Model *string `json:"model,omitempty"`
// Prompt What to do, as you'd ask a teammate. Up to 100,000 characters, after trimming.
Prompt string `json:"prompt"`
// Repo `owner/name` of a repository connected to the workspace. Omit it to let the agent choose.
Repo *string `json:"repo,omitempty"`
// Title The task's title, up to 200 characters. Defaults to the prompt's first line, cut to 80 characters.
Title *string `json:"title,omitempty"`
}
CreateTaskRequest A task to start.
type CreateTaskResponse ¶
type CreateTaskResponse struct {
// MessageId The id of your first message: the `Idempotency-Key` you sent, or a generated id.
MessageId string `json:"messageId"`
// Task A task: one piece of work Sinatra does, from any source.
Task Task `json:"task"`
}
CreateTaskResponse The task that started, and the id of your first message.
type DelegateGithubTicket ¶
type DelegateGithubTicket struct {
// Number The issue's number in that repository.
Number int `json:"number"`
// Repo `owner/name` of a repository enabled in the workspace.
Repo string `json:"repo"`
// Source `github` to delegate a GitHub issue.
Source DelegateGithubTicketSource `json:"source"`
}
DelegateGithubTicket A GitHub issue to delegate, by its repository and number.
type DelegateGithubTicketSource ¶
type DelegateGithubTicketSource string
DelegateGithubTicketSource `github` to delegate a GitHub issue.
const (
DelegateGithubTicketSourceGithub DelegateGithubTicketSource = "github"
)
Defines values for DelegateGithubTicketSource.
func (DelegateGithubTicketSource) Valid ¶
func (e DelegateGithubTicketSource) Valid() bool
Valid indicates whether the value is a known member of the DelegateGithubTicketSource enum.
type DelegateLinearTicket ¶
type DelegateLinearTicket struct {
// Id The issue's identifier, such as `ENG-123`, or its id.
Id string `json:"id"`
// Source `linear` to delegate a Linear issue.
Source DelegateLinearTicketSource `json:"source"`
}
DelegateLinearTicket A Linear issue to delegate, by its identifier or id.
type DelegateLinearTicketSource ¶
type DelegateLinearTicketSource string
DelegateLinearTicketSource `linear` to delegate a Linear issue.
const (
DelegateLinearTicketSourceLinear DelegateLinearTicketSource = "linear"
)
Defines values for DelegateLinearTicketSource.
func (DelegateLinearTicketSource) Valid ¶
func (e DelegateLinearTicketSource) Valid() bool
Valid indicates whether the value is a known member of the DelegateLinearTicketSource enum.
type DelegateTarget ¶
type DelegateTarget interface {
// contains filtered or unexported methods
}
DelegateTarget is an issue to delegate: a DelegateLinearTicket, a DelegateGithubTicket, or a DelegateTicketRequest. Source is filled in for you.
type DelegateTicketRequest ¶
type DelegateTicketRequest struct {
// contains filtered or unexported fields
}
DelegateTicketRequest An issue to delegate: a Linear issue by `id`, or a GitHub issue by `repo` and `number`.
func (DelegateTicketRequest) AsDelegateGithubTicket ¶
func (t DelegateTicketRequest) AsDelegateGithubTicket() (DelegateGithubTicket, error)
AsDelegateGithubTicket returns the union data inside the DelegateTicketRequest as a DelegateGithubTicket
func (DelegateTicketRequest) AsDelegateLinearTicket ¶
func (t DelegateTicketRequest) AsDelegateLinearTicket() (DelegateLinearTicket, error)
AsDelegateLinearTicket returns the union data inside the DelegateTicketRequest as a DelegateLinearTicket
func (DelegateTicketRequest) Discriminator ¶
func (t DelegateTicketRequest) Discriminator() (string, error)
func (*DelegateTicketRequest) FromDelegateGithubTicket ¶
func (t *DelegateTicketRequest) FromDelegateGithubTicket(v DelegateGithubTicket) error
FromDelegateGithubTicket overwrites any union data inside the DelegateTicketRequest as the provided DelegateGithubTicket
func (*DelegateTicketRequest) FromDelegateLinearTicket ¶
func (t *DelegateTicketRequest) FromDelegateLinearTicket(v DelegateLinearTicket) error
FromDelegateLinearTicket overwrites any union data inside the DelegateTicketRequest as the provided DelegateLinearTicket
func (DelegateTicketRequest) MarshalJSON ¶
func (t DelegateTicketRequest) MarshalJSON() ([]byte, error)
func (*DelegateTicketRequest) MergeDelegateGithubTicket ¶
func (t *DelegateTicketRequest) MergeDelegateGithubTicket(v DelegateGithubTicket) error
MergeDelegateGithubTicket performs a merge with any union data inside the DelegateTicketRequest, using the provided DelegateGithubTicket
func (*DelegateTicketRequest) MergeDelegateLinearTicket ¶
func (t *DelegateTicketRequest) MergeDelegateLinearTicket(v DelegateLinearTicket) error
MergeDelegateLinearTicket performs a merge with any union data inside the DelegateTicketRequest, using the provided DelegateLinearTicket
func (*DelegateTicketRequest) UnmarshalJSON ¶
func (t *DelegateTicketRequest) UnmarshalJSON(b []byte) error
func (DelegateTicketRequest) ValueByDiscriminator ¶
func (t DelegateTicketRequest) ValueByDiscriminator() (interface{}, error)
type DelegateTicketResponse ¶
type DelegateTicketResponse struct {
// Ok Always `true`: the issue was handed to Sinatra.
Ok DelegateTicketResponseOk `json:"ok"`
}
DelegateTicketResponse The issue was delegated.
type DelegateTicketResponseOk ¶
type DelegateTicketResponseOk bool
DelegateTicketResponseOk Always `true`: the issue was handed to Sinatra.
const (
DelegateTicketResponseOkTrue DelegateTicketResponseOk = true
)
Defines values for DelegateTicketResponseOk.
func (DelegateTicketResponseOk) Valid ¶
func (e DelegateTicketResponseOk) Valid() bool
Valid indicates whether the value is a known member of the DelegateTicketResponseOk enum.
type EmailPreferences ¶ added in v0.1.8
type EmailPreferences struct {
// SetupReminders Whether Sinatra may send you setup reminder emails.
SetupReminders bool `json:"setupReminders"`
// TaskAlerts Whether Sinatra may send you task alert emails.
TaskAlerts bool `json:"taskAlerts"`
}
EmailPreferences Your account-wide email preferences, shared with the signed email-preferences page.
type Error ¶
type Error struct {
// Status is the HTTP status, such as 409.
Status int
// Code is the API's machine-readable error code, such as "capacity_full".
// New codes can appear at any time, so treat it as an open string. It is
// "http_error" when the response carried no code, such as an HTML error
// page from a proxy. Branch on Code, not on Reason.
Code string
// Reason is a sentence saying what went wrong, written for a person.
Reason string
// RequestID is the request's id, from the body or the x-request-id
// header. Include it when you contact support.
RequestID string
// Body is the raw response body.
Body []byte
// Header holds the response headers.
Header http.Header
// Details is the decoded body when it was a JSON object, with fields such
// as BillingUrl on some refusals. Nil otherwise.
Details *ErrorBody
}
Error is the error every method returns for an HTTP error response. Get it with errors.As:
var apiErr *sinatra.Error
if errors.As(err, &apiErr) && apiErr.Code == "not_running" { ... }
Network failures, timeouts and cancellations are not an *Error: they are returned as net/http and context report them.
type ErrorBody ¶
type ErrorBody struct {
// BillingUrl The settings section that fixes the refusal: your model credentials or billing, on `payment_required`; billing, when starting a task, on `capacity_full`.
BillingUrl *string `json:"billingUrl,omitempty"`
// Error A machine-readable code, such as `invalid_prompt`. Branch on this, not on `reason`. New codes can appear. Known codes: `actor_not_authorized`, `already_member`, `already_subscribed`, `assigned_to_other`, `bad_request`, `billing_disabled`, `capability_request_not_found`, `capability_target_not_authorized`, `capacity_full`, `code_exchange_failed`, `consumed`, `customer_missing`, `declined`, `device_auth_not_enabled`, `expired`, `forbidden`, `github_identity_required`, `github_not_connected`, `github_rate_limited`, `idempotency_conflict`, `illegal_role`, `internal_error`, `invalid_body`, `invalid_code`, `invalid_cursor`, `invalid_idempotency_key`, `invalid_limit`, `invalid_model`, `invalid_model_selection`, `invalid_override_fragment`, `invalid_pending_connect`, `invalid_prompt`, `invalid_repo`, `invalid_secret_header`, `invalid_secret_hosts`, `invalid_secret_name`, `invalid_secret_prefix`, `invalid_secret_value`, `invalid_status`, `invalid_title`, `invalid_token`, `invite_delivery_failed`, `invite_limit`, `invite_not_found`, `invite_revoked`, `issue_closed`, `issue_not_found`, `key_validation_failed`, `linear_app_user_missing`, `linear_identity_conflict`, `linear_identity_unlinked`, `linear_not_connected`, `linear_reconnect_required`, `membership_not_found`, `model_key_not_found`, `no_checkout_url`, `no_customer`, `no_portal_url`, `not_an_api_task`, `not_an_issue`, `not_connected`, `not_found`, `not_running`, `payment_required`, `plan_required`, `plans_not_configured`, `provider_unreachable`, `repo_disabled`, `repo_environments_not_enabled`, `repo_not_found`, `request_not_found`, `request_not_pending`, `revoked`, `secret_cap_exceeded`, `slack_disabled`, `state_mismatch`, `telegram_unavailable`, `unavailable`, `unsupported_integration`, `unsupported_provider`, `usage_unavailable`.
Error string `json:"error"`
// MessageId On `unavailable`: the message that was saved but not sent yet. Retry with it as the `Idempotency-Key`.
MessageId *string `json:"messageId,omitempty"`
// Plan The workspace's plan, on `capacity_full` when starting a task.
Plan *string `json:"plan,omitempty"`
// Queued How many agents the plan lets wait, on `capacity_full` when starting a task.
Queued *int `json:"queued,omitempty"`
// Reason A sentence saying what went wrong and, where it helps, what to do. Written to show to a person.
Reason *string `json:"reason,omitempty"`
// Refusal Why a start was refused, on `payment_required` and `github_not_connected`. For `payment_required`: `own_credentials_required` or `subscription_inactive`. For `github_not_connected`: `missing` or `suspended`.
Refusal *string `json:"refusal,omitempty"`
// RequestId The request's id. Present on some errors, not all; the `x-request-id` response header always carries it. Share it with support.
RequestId *string `json:"requestId,omitempty"`
// Running How many agents the plan runs at a time, on `capacity_full` when starting a task.
Running *int `json:"running,omitempty"`
// SettingsUrl The settings page that fixes the refusal, on `github_not_connected`.
SettingsUrl *string `json:"settingsUrl,omitempty"`
// TaskId On `unavailable` after a start: the task that was made. Retry with the same key, or send a message on it.
TaskId *string `json:"taskId,omitempty"`
}
ErrorBody The body of every error response.
type IntegrationConnect ¶ added in v0.1.9
type IntegrationConnect struct {
// Url A Sinatra dashboard URL to open in a browser. Authorization is completed there; no OAuth state, tokens or credentials are returned.
Url string `json:"url"`
}
IntegrationConnect defines model for IntegrationConnect.
type IntegrationsConnectParamsIntegration ¶ added in v0.1.9
type IntegrationsConnectParamsIntegration string
IntegrationsConnectParamsIntegration defines parameters for IntegrationsConnect.
const ( IntegrationsConnectParamsIntegrationGithub IntegrationsConnectParamsIntegration = "github" IntegrationsConnectParamsIntegrationLinear IntegrationsConnectParamsIntegration = "linear" IntegrationsConnectParamsIntegrationSlack IntegrationsConnectParamsIntegration = "slack" IntegrationsConnectParamsIntegrationTelegram IntegrationsConnectParamsIntegration = "telegram" )
Defines values for IntegrationsConnectParamsIntegration.
func (IntegrationsConnectParamsIntegration) Valid ¶ added in v0.1.9
func (e IntegrationsConnectParamsIntegration) Valid() bool
Valid indicates whether the value is a known member of the IntegrationsConnectParamsIntegration enum.
type Me ¶
type Me struct {
// User The user the token acts as.
User struct {
// Email The user's email address: the one they sign in with by email, or their primary GitHub email.
Email string `json:"email"`
// GithubLogin The user's GitHub login. `null` for a user without GitHub.
GithubLogin *string `json:"githubLogin"`
// Id The user's id.
Id string `json:"id"`
// Name The user's name, if they have one.
Name *string `json:"name"`
} `json:"user"`
// Workspaces The workspaces the user belongs to, ordered by name.
Workspaces []Workspace `json:"workspaces"`
}
Me The token's user and workspaces.
type MeService ¶
type MeService struct {
// contains filtered or unexported fields
}
MeService is the token's user: Client.Me.
type MeUpdateEmailPreferencesJSONRequestBody ¶ added in v0.1.8
type MeUpdateEmailPreferencesJSONRequestBody = UpdateEmailPreferencesRequest
MeUpdateEmailPreferencesJSONRequestBody defines body for MeUpdateEmailPreferences for application/json ContentType.
type Message ¶
type Message struct {
// Body The text.
Body string `json:"body"`
// CreatedAt When it was written.
CreatedAt time.Time `json:"createdAt"`
// Id The entry's id. Pass the last one you read as `after` to get only later entries.
Id string `json:"id"`
// Kind What it is: `message` (a person's message), `response` (the agent's answer, or a notice from Sinatra such as a stop or files the agent produced), `clarify` (a question the agent needs answered to continue) or `error` (a refusal or failure from Sinatra). New kinds can appear.
Kind string `json:"kind"`
// MessageId For a message a person sent: the id it was sent with, which is its idempotency key or a generated id. `null` on every other entry.
MessageId *string `json:"messageId"`
// Role Who wrote it: `user` for a person, `agent` for the agent, `platform` for Sinatra itself. New roles can appear.
Role string `json:"role"`
}
Message An entry in a task's conversation.
type MessageList ¶
type MessageList struct {
// Messages The page's entries, oldest first.
Messages []Message `json:"messages"`
// Next When it isn't `null`, more entries follow: pass it as `after` to get them. `null` on the last page.
Next *string `json:"next"`
}
MessageList A page of a task's conversation.
type MessagesCreateJSONRequestBody ¶
type MessagesCreateJSONRequestBody = CreateMessageRequest
MessagesCreateJSONRequestBody defines body for MessagesCreate for application/json ContentType.
type MessagesCreateParams ¶
type MessagesCreateParams struct {
// IdempotencyKey Makes a retry safe. 1 to 128 printable ASCII characters, with no spaces. A request repeated with the same key answers with the first one's result and does the work once; the same key with different content is `409 idempotency_conflict`. Keys belong to the person who sent them: two people using the same key start two tasks or send two messages. The key is also the `messageId` of the message the request sends, which is a start's first message.
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}
MessagesCreateParams defines parameters for MessagesCreate.
type MessagesListParams ¶
type MessagesListParams struct {
// After The `id` of the last entry you've read. Returns only later entries. An id that isn't an entry of this task is `invalid_cursor`.
After *string `form:"after,omitempty" json:"after,omitempty"`
// Limit How many entries to return, 1 to 200.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
}
MessagesListParams defines parameters for MessagesList.
type MessagesService ¶
type MessagesService struct {
// contains filtered or unexported fields
}
MessagesService is the conversation of a task: Client.Messages.
func (*MessagesService) Create ¶
func (s *MessagesService) Create(ctx context.Context, workspaceID, taskID string, body CreateMessageRequest, opts ...CallOption) (*CreateMessageResponse, error)
Create sends a follow-up on a task started from the API, CLI, MCP or dashboard (messages.create). It always sends an Idempotency-Key; see WithIdempotencyKey.
func (*MessagesService) List ¶
func (s *MessagesService) List(ctx context.Context, workspaceID, taskID string, params *MessagesListParams) (*MessageList, error)
List returns one page of the task's conversation, oldest first (messages.list). params may be nil. To wait for a reply, poll with After set to the Id of the last entry you read.
func (*MessagesService) ListAll ¶
func (s *MessagesService) ListAll(ctx context.Context, workspaceID, taskID string, params *MessagesListParams) iter.Seq2[Message, error]
ListAll returns every entry after params.After (or from the start), following next page by page. It stops after the first error, which it yields.
type Option ¶
type Option func(*Client)
Option configures NewClient.
func WithBaseURL ¶
WithBaseURL sets the API's address. It defaults to DefaultBaseURL.
func WithHTTPClient ¶
WithHTTPClient sets the *http.Client requests go through. It defaults to http.DefaultClient.
func WithTimeout ¶
WithTimeout sets how long each attempt of a request may take, from sending it to reading the whole response, before it fails with an error that wraps context.DeadlineExceeded. Timed-out attempts aren't retried. It defaults to DefaultTimeout; 0 means no limit. To limit a whole call, retries included, give it a context with a deadline.
type PullRequest ¶
type PullRequest struct {
// Merged `true` once the pull request is merged.
Merged bool `json:"merged"`
// Url The pull request's address on GitHub.
Url string `json:"url"`
}
PullRequest The pull request a task opened.
type RepoCapabilityRequests ¶ added in v0.1.9
type RepoCapabilityRequests struct {
Requests []struct {
Capability string `json:"capability"`
CreatedAt time.Time `json:"createdAt"`
EnvVarName *string `json:"envVarName"`
Evidence interface{} `json:"evidence"`
Id string `json:"id"`
NotificationBatchKeys []string `json:"notificationBatchKeys"`
NotifiedGeneration float32 `json:"notifiedGeneration"`
NotifiedRecipientIds []string `json:"notifiedRecipientIds"`
Reason string `json:"reason"`
RepairGeneration float32 `json:"repairGeneration"`
RepoId string `json:"repoId"`
State string `json:"state"`
SuppliedSecretId *string `json:"suppliedSecretId"`
Target string `json:"target"`
UpdatedAt time.Time `json:"updatedAt"`
WorkspaceId string `json:"workspaceId"`
} `json:"requests"`
}
RepoCapabilityRequests defines model for RepoCapabilityRequests.
type RepoConfig ¶ added in v0.1.9
type RepoConfig struct {
FetchError *string `json:"fetchError"`
FetchedAt time.Time `json:"fetchedAt"`
InheritedAutomatic *struct {
Effort *string `json:"effort,omitempty"`
Engine string `json:"engine"`
Model string `json:"model"`
Reason *string `json:"reason,omitempty"`
} `json:"inheritedAutomatic"`
NextTask *struct {
Effort *string `json:"effort,omitempty"`
EffortSource string `json:"effortSource"`
Engine string `json:"engine"`
Model string `json:"model"`
ModelSource string `json:"modelSource"`
Reason *string `json:"reason,omitempty"`
} `json:"nextTask"`
OverridableLeafs []string `json:"overridableLeafs"`
ParseError *string `json:"parseError"`
// Parsed Effective parsed configuration for the authenticated user.
Parsed map[string]interface{} `json:"parsed"`
Raw *string `json:"raw"`
// RepoParsed Inherited parsed configuration before personal overrides.
RepoParsed map[string]interface{} `json:"repoParsed"`
RepoSource map[string]string `json:"repoSource"`
Source map[string]string `json:"source"`
SourceFile *string `json:"sourceFile"`
UserFragment *map[string]interface{} `json:"userFragment"`
}
RepoConfig defines model for RepoConfig.
type RepoConfigPreflight ¶ added in v0.1.9
type RepoConfigPreflight struct {
Issues []struct {
ConnectedCredentialsLabel string `json:"connectedCredentialsLabel"`
Engine string `json:"engine"`
Kind string `json:"kind"`
Model string `json:"model"`
Path string `json:"path"`
Provider string `json:"provider"`
RequiredCredentialLabel string `json:"requiredCredentialLabel"`
} `json:"issues"`
WouldWarn bool `json:"wouldWarn"`
}
RepoConfigPreflight defines model for RepoConfigPreflight.
type RepoEnvironment ¶ added in v0.1.9
type RepoEnvironment struct {
Environment *struct {
ActiveVersionId *string `json:"activeVersionId"`
InitialPassState string `json:"initialPassState"`
Versions []struct {
CompletedAt *time.Time `json:"completedAt"`
CreatedAt time.Time `json:"createdAt"`
FailureReason *string `json:"failureReason"`
Id string `json:"id"`
Origin string `json:"origin"`
Readiness interface{} `json:"readiness"`
Sequence float32 `json:"sequence"`
SnapshotResources interface{} `json:"snapshotResources"`
SourceCommit *string `json:"sourceCommit"`
Status string `json:"status"`
SupersededById *string `json:"supersededById"`
} `json:"versions"`
} `json:"environment"`
Updates []struct {
Change string `json:"change"`
CreatedAt time.Time `json:"createdAt"`
Evidence string `json:"evidence"`
FinishedAt *time.Time `json:"finishedAt"`
Id string `json:"id"`
Reason string `json:"reason"`
State string `json:"state"`
VersionId *string `json:"versionId"`
} `json:"updates"`
}
RepoEnvironment defines model for RepoEnvironment.
type RepoOverrideRequest ¶ added in v0.1.9
type RepoOverrideRequest struct {
// Fragment A personal override fragment. Only the returned overridableLeafs are accepted; engine, agent.model and agent.effort are not personal repo overrides.
Fragment map[string]interface{} `json:"fragment"`
}
RepoOverrideRequest defines model for RepoOverrideRequest.
type RepoSecret ¶ added in v0.1.9
type RepoSecret struct {
CreatedAt time.Time `json:"createdAt"`
Header string `json:"header"`
Hosts []string `json:"hosts"`
Id string `json:"id"`
Name string `json:"name"`
Prefix string `json:"prefix"`
UpdatedAt time.Time `json:"updatedAt"`
}
RepoSecret Secret metadata only: no plaintext, ciphertext, wrapped keys or masked value suffix.
type RepoSecretPatchRequest ¶ added in v0.1.9
type RepoSecretPatchRequest struct {
Header *string `json:"header,omitempty"`
// Hosts Allowed proxy target hosts. Required and nonempty on creation; omitted fields retain their stored values on rotation.
Hosts *[]string `json:"hosts,omitempty"`
Prefix *string `json:"prefix,omitempty"`
}
RepoSecretPatchRequest Supply at least one proxy metadata field; does not change the secret value.
type RepoSecretPutRequest ¶ added in v0.1.9
type RepoSecretPutRequest struct {
CapabilityRequestId *string `json:"capabilityRequestId,omitempty"`
Header *string `json:"header,omitempty"`
// Hosts Allowed proxy target hosts. Required and nonempty on creation; omitted fields retain their stored values on rotation.
Hosts *[]string `json:"hosts,omitempty"`
Prefix *string `json:"prefix,omitempty"`
// Value Secret value, encrypted at rest and never returned. Do not pass it through MCP.
Value string `json:"value"`
}
RepoSecretPutRequest defines model for RepoSecretPutRequest.
type RepoSecrets ¶ added in v0.1.9
type RepoSecrets struct {
Secrets []RepoSecret `json:"secrets"`
}
RepoSecrets defines model for RepoSecrets.
type ReposPatchSecretJSONRequestBody ¶ added in v0.1.9
type ReposPatchSecretJSONRequestBody = RepoSecretPatchRequest
ReposPatchSecretJSONRequestBody defines body for ReposPatchSecret for application/json ContentType.
type ReposPreflightJSONRequestBody ¶ added in v0.1.9
type ReposPreflightJSONRequestBody = RepoOverrideRequest
ReposPreflightJSONRequestBody defines body for ReposPreflight for application/json ContentType.
type ReposPutSecretJSONRequestBody ¶ added in v0.1.9
type ReposPutSecretJSONRequestBody = RepoSecretPutRequest
ReposPutSecretJSONRequestBody defines body for ReposPutSecret for application/json ContentType.
type ReposSetOverrideJSONRequestBody ¶ added in v0.1.9
type ReposSetOverrideJSONRequestBody = RepoOverrideRequest
ReposSetOverrideJSONRequestBody defines body for ReposSetOverride for application/json ContentType.
type StopTaskResponse ¶
type StopTaskResponse struct {
// Accepted Always `true`: the task was told to stop.
Accepted StopTaskResponseAccepted `json:"accepted"`
}
StopTaskResponse The stop was accepted.
type StopTaskResponseAccepted ¶
type StopTaskResponseAccepted bool
StopTaskResponseAccepted Always `true`: the task was told to stop.
const (
StopTaskResponseAcceptedTrue StopTaskResponseAccepted = true
)
Defines values for StopTaskResponseAccepted.
func (StopTaskResponseAccepted) Valid ¶
func (e StopTaskResponseAccepted) Valid() bool
Valid indicates whether the value is a known member of the StopTaskResponseAccepted enum.
type SubscriptionsComplete200 ¶ added in v0.1.9
type SubscriptionsComplete200 struct {
Email *string `json:"email"`
Status SubscriptionsComplete200Status `json:"status"`
}
SubscriptionsComplete200 defines model for subscriptions_complete_200.
type SubscriptionsComplete200Status ¶ added in v0.1.9
type SubscriptionsComplete200Status string
SubscriptionsComplete200Status defines model for SubscriptionsComplete200.Status.
const (
SubscriptionsComplete200StatusConnected SubscriptionsComplete200Status = "connected"
)
Defines values for SubscriptionsComplete200Status.
func (SubscriptionsComplete200Status) Valid ¶ added in v0.1.9
func (e SubscriptionsComplete200Status) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsComplete200Status enum.
type SubscriptionsCompleteJSONRequestBody ¶ added in v0.1.9
type SubscriptionsCompleteJSONRequestBody = SubscriptionsCompleteRequest
SubscriptionsCompleteJSONRequestBody defines body for SubscriptionsComplete for application/json ContentType.
type SubscriptionsCompleteRequest ¶ added in v0.1.9
type SubscriptionsCompleteRequest struct {
Code string `json:"code"`
PendingToken string `json:"pendingToken"`
State string `json:"state"`
}
SubscriptionsCompleteRequest defines model for subscriptions_complete_Request.
type SubscriptionsList200 ¶ added in v0.1.9
type SubscriptionsList200 struct {
Connections []struct {
AnthropicAccountId *string `json:"anthropicAccountId,omitempty"`
ChatgptAccountId *string `json:"chatgptAccountId,omitempty"`
Connected bool `json:"connected"`
CreatedAt string `json:"createdAt"`
Email *string `json:"email"`
Id string `json:"id"`
Label *string `json:"label"`
NeedsReconnect bool `json:"needsReconnect"`
// Primary Whether this is your primary connection for this provider in this workspace.
Primary bool `json:"primary"`
Provider SubscriptionsList200ConnectionsProvider `json:"provider"`
XaiAccountId *string `json:"xaiAccountId,omitempty"`
} `json:"connections"`
}
SubscriptionsList200 defines model for subscriptions_list_200.
type SubscriptionsList200ConnectionsProvider ¶ added in v0.1.9
type SubscriptionsList200ConnectionsProvider string
SubscriptionsList200ConnectionsProvider defines model for SubscriptionsList200.Connections.Provider.
const ( SubscriptionsList200ConnectionsProviderClaude SubscriptionsList200ConnectionsProvider = "claude" SubscriptionsList200ConnectionsProviderCodex SubscriptionsList200ConnectionsProvider = "codex" SubscriptionsList200ConnectionsProviderCursor SubscriptionsList200ConnectionsProvider = "cursor" SubscriptionsList200ConnectionsProviderXai SubscriptionsList200ConnectionsProvider = "xai" )
Defines values for SubscriptionsList200ConnectionsProvider.
func (SubscriptionsList200ConnectionsProvider) Valid ¶ added in v0.1.9
func (e SubscriptionsList200ConnectionsProvider) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsList200ConnectionsProvider enum.
type SubscriptionsPoll200 ¶ added in v0.1.9
type SubscriptionsPoll200 struct {
// contains filtered or unexported fields
}
SubscriptionsPoll200 defines model for subscriptions_poll_200.
func (SubscriptionsPoll200) AsSubscriptionsComplete200 ¶ added in v0.1.9
func (t SubscriptionsPoll200) AsSubscriptionsComplete200() (SubscriptionsComplete200, error)
AsSubscriptionsComplete200 returns the union data inside the SubscriptionsPoll200 as a SubscriptionsComplete200
func (SubscriptionsPoll200) AsSubscriptionsPoll2000 ¶ added in v0.1.9
func (t SubscriptionsPoll200) AsSubscriptionsPoll2000() (SubscriptionsPoll2000, error)
AsSubscriptionsPoll2000 returns the union data inside the SubscriptionsPoll200 as a SubscriptionsPoll2000
func (*SubscriptionsPoll200) FromSubscriptionsComplete200 ¶ added in v0.1.9
func (t *SubscriptionsPoll200) FromSubscriptionsComplete200(v SubscriptionsComplete200) error
FromSubscriptionsComplete200 overwrites any union data inside the SubscriptionsPoll200 as the provided SubscriptionsComplete200
func (*SubscriptionsPoll200) FromSubscriptionsPoll2000 ¶ added in v0.1.9
func (t *SubscriptionsPoll200) FromSubscriptionsPoll2000(v SubscriptionsPoll2000) error
FromSubscriptionsPoll2000 overwrites any union data inside the SubscriptionsPoll200 as the provided SubscriptionsPoll2000
func (SubscriptionsPoll200) MarshalJSON ¶ added in v0.1.9
func (t SubscriptionsPoll200) MarshalJSON() ([]byte, error)
func (*SubscriptionsPoll200) MergeSubscriptionsComplete200 ¶ added in v0.1.9
func (t *SubscriptionsPoll200) MergeSubscriptionsComplete200(v SubscriptionsComplete200) error
MergeSubscriptionsComplete200 performs a merge with any union data inside the SubscriptionsPoll200, using the provided SubscriptionsComplete200
func (*SubscriptionsPoll200) MergeSubscriptionsPoll2000 ¶ added in v0.1.9
func (t *SubscriptionsPoll200) MergeSubscriptionsPoll2000(v SubscriptionsPoll2000) error
MergeSubscriptionsPoll2000 performs a merge with any union data inside the SubscriptionsPoll200, using the provided SubscriptionsPoll2000
func (*SubscriptionsPoll200) UnmarshalJSON ¶ added in v0.1.9
func (t *SubscriptionsPoll200) UnmarshalJSON(b []byte) error
type SubscriptionsPoll400 ¶ added in v0.1.9
type SubscriptionsPoll400 struct {
// contains filtered or unexported fields
}
SubscriptionsPoll400 defines model for subscriptions_poll_400.
func (SubscriptionsPoll400) AsErrorBody ¶ added in v0.1.9
func (t SubscriptionsPoll400) AsErrorBody() (ErrorBody, error)
AsErrorBody returns the union data inside the SubscriptionsPoll400 as a ErrorBody
func (SubscriptionsPoll400) AsSubscriptionsPoll4001 ¶ added in v0.1.9
func (t SubscriptionsPoll400) AsSubscriptionsPoll4001() (SubscriptionsPoll4001, error)
AsSubscriptionsPoll4001 returns the union data inside the SubscriptionsPoll400 as a SubscriptionsPoll4001
func (SubscriptionsPoll400) AsSubscriptionsPoll4002 ¶ added in v0.1.9
func (t SubscriptionsPoll400) AsSubscriptionsPoll4002() (SubscriptionsPoll4002, error)
AsSubscriptionsPoll4002 returns the union data inside the SubscriptionsPoll400 as a SubscriptionsPoll4002
func (*SubscriptionsPoll400) FromErrorBody ¶ added in v0.1.9
func (t *SubscriptionsPoll400) FromErrorBody(v ErrorBody) error
FromErrorBody overwrites any union data inside the SubscriptionsPoll400 as the provided ErrorBody
func (*SubscriptionsPoll400) FromSubscriptionsPoll4001 ¶ added in v0.1.9
func (t *SubscriptionsPoll400) FromSubscriptionsPoll4001(v SubscriptionsPoll4001) error
FromSubscriptionsPoll4001 overwrites any union data inside the SubscriptionsPoll400 as the provided SubscriptionsPoll4001
func (*SubscriptionsPoll400) FromSubscriptionsPoll4002 ¶ added in v0.1.9
func (t *SubscriptionsPoll400) FromSubscriptionsPoll4002(v SubscriptionsPoll4002) error
FromSubscriptionsPoll4002 overwrites any union data inside the SubscriptionsPoll400 as the provided SubscriptionsPoll4002
func (SubscriptionsPoll400) MarshalJSON ¶ added in v0.1.9
func (t SubscriptionsPoll400) MarshalJSON() ([]byte, error)
func (*SubscriptionsPoll400) MergeErrorBody ¶ added in v0.1.9
func (t *SubscriptionsPoll400) MergeErrorBody(v ErrorBody) error
MergeErrorBody performs a merge with any union data inside the SubscriptionsPoll400, using the provided ErrorBody
func (*SubscriptionsPoll400) MergeSubscriptionsPoll4001 ¶ added in v0.1.9
func (t *SubscriptionsPoll400) MergeSubscriptionsPoll4001(v SubscriptionsPoll4001) error
MergeSubscriptionsPoll4001 performs a merge with any union data inside the SubscriptionsPoll400, using the provided SubscriptionsPoll4001
func (*SubscriptionsPoll400) MergeSubscriptionsPoll4002 ¶ added in v0.1.9
func (t *SubscriptionsPoll400) MergeSubscriptionsPoll4002(v SubscriptionsPoll4002) error
MergeSubscriptionsPoll4002 performs a merge with any union data inside the SubscriptionsPoll400, using the provided SubscriptionsPoll4002
func (*SubscriptionsPoll400) UnmarshalJSON ¶ added in v0.1.9
func (t *SubscriptionsPoll400) UnmarshalJSON(b []byte) error
type SubscriptionsPoll2000 ¶ added in v0.1.9
type SubscriptionsPoll2000 struct {
Status SubscriptionsPoll2000Status `json:"status"`
}
SubscriptionsPoll2000 defines model for SubscriptionsPoll200.0.
type SubscriptionsPoll2000Status ¶ added in v0.1.9
type SubscriptionsPoll2000Status string
SubscriptionsPoll2000Status defines model for SubscriptionsPoll200.0.Status.
const (
SubscriptionsPoll2000StatusPending SubscriptionsPoll2000Status = "pending"
)
Defines values for SubscriptionsPoll2000Status.
func (SubscriptionsPoll2000Status) Valid ¶ added in v0.1.9
func (e SubscriptionsPoll2000Status) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsPoll2000Status enum.
type SubscriptionsPoll4001 ¶ added in v0.1.9
type SubscriptionsPoll4001 struct {
Status SubscriptionsPoll4001Status `json:"status"`
}
SubscriptionsPoll4001 defines model for SubscriptionsPoll400.1.
type SubscriptionsPoll4001Status ¶ added in v0.1.9
type SubscriptionsPoll4001Status string
SubscriptionsPoll4001Status defines model for SubscriptionsPoll400.1.Status.
const ( SubscriptionsPoll4001StatusDenied SubscriptionsPoll4001Status = "denied" SubscriptionsPoll4001StatusExpired SubscriptionsPoll4001Status = "expired" )
Defines values for SubscriptionsPoll4001Status.
func (SubscriptionsPoll4001Status) Valid ¶ added in v0.1.9
func (e SubscriptionsPoll4001Status) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsPoll4001Status enum.
type SubscriptionsPoll4002 ¶ added in v0.1.9
type SubscriptionsPoll4002 struct {
Error SubscriptionsPoll4002Error `json:"error"`
Status SubscriptionsPoll4002Status `json:"status"`
}
SubscriptionsPoll4002 defines model for SubscriptionsPoll400.2.
type SubscriptionsPoll4002Error ¶ added in v0.1.9
type SubscriptionsPoll4002Error string
SubscriptionsPoll4002Error defines model for SubscriptionsPoll400.2.Error.
const (
SubscriptionsPoll4002ErrorSaveFailed SubscriptionsPoll4002Error = "save_failed"
)
Defines values for SubscriptionsPoll4002Error.
func (SubscriptionsPoll4002Error) Valid ¶ added in v0.1.9
func (e SubscriptionsPoll4002Error) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsPoll4002Error enum.
type SubscriptionsPoll4002Status ¶ added in v0.1.9
type SubscriptionsPoll4002Status string
SubscriptionsPoll4002Status defines model for SubscriptionsPoll400.2.Status.
const (
SubscriptionsPoll4002StatusFailed SubscriptionsPoll4002Status = "failed"
)
Defines values for SubscriptionsPoll4002Status.
func (SubscriptionsPoll4002Status) Valid ¶ added in v0.1.9
func (e SubscriptionsPoll4002Status) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsPoll4002Status enum.
type SubscriptionsPollJSONRequestBody ¶ added in v0.1.9
type SubscriptionsPollJSONRequestBody = SubscriptionsPollRequest
SubscriptionsPollJSONRequestBody defines body for SubscriptionsPoll for application/json ContentType.
type SubscriptionsPollParamsProvider ¶ added in v0.1.9
type SubscriptionsPollParamsProvider string
SubscriptionsPollParamsProvider defines parameters for SubscriptionsPoll.
const ( SubscriptionsPollParamsProviderCodex SubscriptionsPollParamsProvider = "codex" SubscriptionsPollParamsProviderCursor SubscriptionsPollParamsProvider = "cursor" SubscriptionsPollParamsProviderXai SubscriptionsPollParamsProvider = "xai" )
Defines values for SubscriptionsPollParamsProvider.
func (SubscriptionsPollParamsProvider) Valid ¶ added in v0.1.9
func (e SubscriptionsPollParamsProvider) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsPollParamsProvider enum.
type SubscriptionsPollRequest ¶ added in v0.1.9
type SubscriptionsPollRequest struct {
// contains filtered or unexported fields
}
SubscriptionsPollRequest defines model for subscriptions_poll_Request.
func (SubscriptionsPollRequest) AsSubscriptionsPollRequest0 ¶ added in v0.1.9
func (t SubscriptionsPollRequest) AsSubscriptionsPollRequest0() (SubscriptionsPollRequest0, error)
AsSubscriptionsPollRequest0 returns the union data inside the SubscriptionsPollRequest as a SubscriptionsPollRequest0
func (SubscriptionsPollRequest) AsSubscriptionsPollRequest1 ¶ added in v0.1.9
func (t SubscriptionsPollRequest) AsSubscriptionsPollRequest1() (SubscriptionsPollRequest1, error)
AsSubscriptionsPollRequest1 returns the union data inside the SubscriptionsPollRequest as a SubscriptionsPollRequest1
func (SubscriptionsPollRequest) AsSubscriptionsPollRequest2 ¶ added in v0.1.9
func (t SubscriptionsPollRequest) AsSubscriptionsPollRequest2() (SubscriptionsPollRequest2, error)
AsSubscriptionsPollRequest2 returns the union data inside the SubscriptionsPollRequest as a SubscriptionsPollRequest2
func (*SubscriptionsPollRequest) FromSubscriptionsPollRequest0 ¶ added in v0.1.9
func (t *SubscriptionsPollRequest) FromSubscriptionsPollRequest0(v SubscriptionsPollRequest0) error
FromSubscriptionsPollRequest0 overwrites any union data inside the SubscriptionsPollRequest as the provided SubscriptionsPollRequest0
func (*SubscriptionsPollRequest) FromSubscriptionsPollRequest1 ¶ added in v0.1.9
func (t *SubscriptionsPollRequest) FromSubscriptionsPollRequest1(v SubscriptionsPollRequest1) error
FromSubscriptionsPollRequest1 overwrites any union data inside the SubscriptionsPollRequest as the provided SubscriptionsPollRequest1
func (*SubscriptionsPollRequest) FromSubscriptionsPollRequest2 ¶ added in v0.1.9
func (t *SubscriptionsPollRequest) FromSubscriptionsPollRequest2(v SubscriptionsPollRequest2) error
FromSubscriptionsPollRequest2 overwrites any union data inside the SubscriptionsPollRequest as the provided SubscriptionsPollRequest2
func (SubscriptionsPollRequest) MarshalJSON ¶ added in v0.1.9
func (t SubscriptionsPollRequest) MarshalJSON() ([]byte, error)
func (*SubscriptionsPollRequest) MergeSubscriptionsPollRequest0 ¶ added in v0.1.9
func (t *SubscriptionsPollRequest) MergeSubscriptionsPollRequest0(v SubscriptionsPollRequest0) error
MergeSubscriptionsPollRequest0 performs a merge with any union data inside the SubscriptionsPollRequest, using the provided SubscriptionsPollRequest0
func (*SubscriptionsPollRequest) MergeSubscriptionsPollRequest1 ¶ added in v0.1.9
func (t *SubscriptionsPollRequest) MergeSubscriptionsPollRequest1(v SubscriptionsPollRequest1) error
MergeSubscriptionsPollRequest1 performs a merge with any union data inside the SubscriptionsPollRequest, using the provided SubscriptionsPollRequest1
func (*SubscriptionsPollRequest) MergeSubscriptionsPollRequest2 ¶ added in v0.1.9
func (t *SubscriptionsPollRequest) MergeSubscriptionsPollRequest2(v SubscriptionsPollRequest2) error
MergeSubscriptionsPollRequest2 performs a merge with any union data inside the SubscriptionsPollRequest, using the provided SubscriptionsPollRequest2
func (*SubscriptionsPollRequest) UnmarshalJSON ¶ added in v0.1.9
func (t *SubscriptionsPollRequest) UnmarshalJSON(b []byte) error
type SubscriptionsPollRequest0 ¶ added in v0.1.9
type SubscriptionsPollRequest0 struct {
DeviceAuthId string `json:"deviceAuthId"`
PollToken string `json:"pollToken"`
UserCode string `json:"userCode"`
}
SubscriptionsPollRequest0 Codex
type SubscriptionsPollRequest1 ¶ added in v0.1.9
type SubscriptionsPollRequest1 struct {
DeviceCode string `json:"deviceCode"`
PollToken string `json:"pollToken"`
}
SubscriptionsPollRequest1 xAI
type SubscriptionsPollRequest2 ¶ added in v0.1.9
type SubscriptionsPollRequest2 struct {
PollToken string `json:"pollToken"`
}
SubscriptionsPollRequest2 Cursor
type SubscriptionsStart200 ¶ added in v0.1.9
type SubscriptionsStart200 struct {
// contains filtered or unexported fields
}
SubscriptionsStart200 defines model for subscriptions_start_200.
func (SubscriptionsStart200) AsSubscriptionsStart2000 ¶ added in v0.1.9
func (t SubscriptionsStart200) AsSubscriptionsStart2000() (SubscriptionsStart2000, error)
AsSubscriptionsStart2000 returns the union data inside the SubscriptionsStart200 as a SubscriptionsStart2000
func (SubscriptionsStart200) AsSubscriptionsStart2001 ¶ added in v0.1.9
func (t SubscriptionsStart200) AsSubscriptionsStart2001() (SubscriptionsStart2001, error)
AsSubscriptionsStart2001 returns the union data inside the SubscriptionsStart200 as a SubscriptionsStart2001
func (SubscriptionsStart200) AsSubscriptionsStart2002 ¶ added in v0.1.9
func (t SubscriptionsStart200) AsSubscriptionsStart2002() (SubscriptionsStart2002, error)
AsSubscriptionsStart2002 returns the union data inside the SubscriptionsStart200 as a SubscriptionsStart2002
func (SubscriptionsStart200) AsSubscriptionsStart2003 ¶ added in v0.1.9
func (t SubscriptionsStart200) AsSubscriptionsStart2003() (SubscriptionsStart2003, error)
AsSubscriptionsStart2003 returns the union data inside the SubscriptionsStart200 as a SubscriptionsStart2003
func (*SubscriptionsStart200) FromSubscriptionsStart2000 ¶ added in v0.1.9
func (t *SubscriptionsStart200) FromSubscriptionsStart2000(v SubscriptionsStart2000) error
FromSubscriptionsStart2000 overwrites any union data inside the SubscriptionsStart200 as the provided SubscriptionsStart2000
func (*SubscriptionsStart200) FromSubscriptionsStart2001 ¶ added in v0.1.9
func (t *SubscriptionsStart200) FromSubscriptionsStart2001(v SubscriptionsStart2001) error
FromSubscriptionsStart2001 overwrites any union data inside the SubscriptionsStart200 as the provided SubscriptionsStart2001
func (*SubscriptionsStart200) FromSubscriptionsStart2002 ¶ added in v0.1.9
func (t *SubscriptionsStart200) FromSubscriptionsStart2002(v SubscriptionsStart2002) error
FromSubscriptionsStart2002 overwrites any union data inside the SubscriptionsStart200 as the provided SubscriptionsStart2002
func (*SubscriptionsStart200) FromSubscriptionsStart2003 ¶ added in v0.1.9
func (t *SubscriptionsStart200) FromSubscriptionsStart2003(v SubscriptionsStart2003) error
FromSubscriptionsStart2003 overwrites any union data inside the SubscriptionsStart200 as the provided SubscriptionsStart2003
func (SubscriptionsStart200) MarshalJSON ¶ added in v0.1.9
func (t SubscriptionsStart200) MarshalJSON() ([]byte, error)
func (*SubscriptionsStart200) MergeSubscriptionsStart2000 ¶ added in v0.1.9
func (t *SubscriptionsStart200) MergeSubscriptionsStart2000(v SubscriptionsStart2000) error
MergeSubscriptionsStart2000 performs a merge with any union data inside the SubscriptionsStart200, using the provided SubscriptionsStart2000
func (*SubscriptionsStart200) MergeSubscriptionsStart2001 ¶ added in v0.1.9
func (t *SubscriptionsStart200) MergeSubscriptionsStart2001(v SubscriptionsStart2001) error
MergeSubscriptionsStart2001 performs a merge with any union data inside the SubscriptionsStart200, using the provided SubscriptionsStart2001
func (*SubscriptionsStart200) MergeSubscriptionsStart2002 ¶ added in v0.1.9
func (t *SubscriptionsStart200) MergeSubscriptionsStart2002(v SubscriptionsStart2002) error
MergeSubscriptionsStart2002 performs a merge with any union data inside the SubscriptionsStart200, using the provided SubscriptionsStart2002
func (*SubscriptionsStart200) MergeSubscriptionsStart2003 ¶ added in v0.1.9
func (t *SubscriptionsStart200) MergeSubscriptionsStart2003(v SubscriptionsStart2003) error
MergeSubscriptionsStart2003 performs a merge with any union data inside the SubscriptionsStart200, using the provided SubscriptionsStart2003
func (*SubscriptionsStart200) UnmarshalJSON ¶ added in v0.1.9
func (t *SubscriptionsStart200) UnmarshalJSON(b []byte) error
type SubscriptionsStart2000 ¶ added in v0.1.9
type SubscriptionsStart2000 struct {
DeviceAuthId string `json:"deviceAuthId"`
Interval float32 `json:"interval"`
PollToken string `json:"pollToken"`
UserCode string `json:"userCode"`
VerificationUrl string `json:"verificationUrl"`
}
SubscriptionsStart2000 Codex
type SubscriptionsStart2001 ¶ added in v0.1.9
type SubscriptionsStart2001 struct {
DeviceCode string `json:"deviceCode"`
Interval float32 `json:"interval"`
PollToken string `json:"pollToken"`
UserCode string `json:"userCode"`
VerificationUrl string `json:"verificationUrl"`
}
SubscriptionsStart2001 xAI
type SubscriptionsStart2002 ¶ added in v0.1.9
type SubscriptionsStart2002 struct {
Interval float32 `json:"interval"`
LoginUrl string `json:"loginUrl"`
PollToken string `json:"pollToken"`
}
SubscriptionsStart2002 Cursor
type SubscriptionsStart2003 ¶ added in v0.1.9
type SubscriptionsStart2003 struct {
AuthorizeUrl string `json:"authorizeUrl"`
PendingToken string `json:"pendingToken"`
State string `json:"state"`
}
SubscriptionsStart2003 Claude
type SubscriptionsStartParamsProvider ¶ added in v0.1.9
type SubscriptionsStartParamsProvider string
SubscriptionsStartParamsProvider defines parameters for SubscriptionsStart.
const ( SubscriptionsStartParamsProviderClaude SubscriptionsStartParamsProvider = "claude" SubscriptionsStartParamsProviderCodex SubscriptionsStartParamsProvider = "codex" SubscriptionsStartParamsProviderCursor SubscriptionsStartParamsProvider = "cursor" SubscriptionsStartParamsProviderXai SubscriptionsStartParamsProvider = "xai" )
Defines values for SubscriptionsStartParamsProvider.
func (SubscriptionsStartParamsProvider) Valid ¶ added in v0.1.9
func (e SubscriptionsStartParamsProvider) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsStartParamsProvider enum.
type SubscriptionsUpdate200 ¶ added in v0.1.9
type SubscriptionsUpdate200 struct {
Id string `json:"id"`
Label *string `json:"label"`
Primary bool `json:"primary"`
}
SubscriptionsUpdate200 defines model for subscriptions_update_200.
type SubscriptionsUpdateJSONRequestBody ¶ added in v0.1.9
type SubscriptionsUpdateJSONRequestBody = SubscriptionsUpdateRequest
SubscriptionsUpdateJSONRequestBody defines body for SubscriptionsUpdate for application/json ContentType.
type SubscriptionsUpdateRequest ¶ added in v0.1.9
type SubscriptionsUpdateRequest struct {
Label *string `json:"label,omitempty"`
MakePrimary *SubscriptionsUpdateRequestMakePrimary `json:"makePrimary,omitempty"`
}
SubscriptionsUpdateRequest Provide at least one field. Use `label: null` to clear the label, or `makePrimary: true` to select this connection.
type SubscriptionsUpdateRequestMakePrimary ¶ added in v0.1.9
type SubscriptionsUpdateRequestMakePrimary bool
SubscriptionsUpdateRequestMakePrimary defines model for SubscriptionsUpdateRequest.MakePrimary.
const (
SubscriptionsUpdateRequestMakePrimaryTrue SubscriptionsUpdateRequestMakePrimary = true
)
Defines values for SubscriptionsUpdateRequestMakePrimary.
func (SubscriptionsUpdateRequestMakePrimary) Valid ¶ added in v0.1.9
func (e SubscriptionsUpdateRequestMakePrimary) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsUpdateRequestMakePrimary enum.
type SubscriptionsUsage200 ¶ added in v0.1.9
type SubscriptionsUsage200 struct {
// contains filtered or unexported fields
}
SubscriptionsUsage200 defines model for subscriptions_usage_200.
func (SubscriptionsUsage200) AsSubscriptionsUsage2000 ¶ added in v0.1.9
func (t SubscriptionsUsage200) AsSubscriptionsUsage2000() (SubscriptionsUsage2000, error)
AsSubscriptionsUsage2000 returns the union data inside the SubscriptionsUsage200 as a SubscriptionsUsage2000
func (SubscriptionsUsage200) AsSubscriptionsUsage2001 ¶ added in v0.1.9
func (t SubscriptionsUsage200) AsSubscriptionsUsage2001() (SubscriptionsUsage2001, error)
AsSubscriptionsUsage2001 returns the union data inside the SubscriptionsUsage200 as a SubscriptionsUsage2001
func (SubscriptionsUsage200) AsSubscriptionsUsage2002 ¶ added in v0.1.9
func (t SubscriptionsUsage200) AsSubscriptionsUsage2002() (SubscriptionsUsage2002, error)
AsSubscriptionsUsage2002 returns the union data inside the SubscriptionsUsage200 as a SubscriptionsUsage2002
func (SubscriptionsUsage200) AsSubscriptionsUsage2003 ¶ added in v0.1.9
func (t SubscriptionsUsage200) AsSubscriptionsUsage2003() (SubscriptionsUsage2003, error)
AsSubscriptionsUsage2003 returns the union data inside the SubscriptionsUsage200 as a SubscriptionsUsage2003
func (*SubscriptionsUsage200) FromSubscriptionsUsage2000 ¶ added in v0.1.9
func (t *SubscriptionsUsage200) FromSubscriptionsUsage2000(v SubscriptionsUsage2000) error
FromSubscriptionsUsage2000 overwrites any union data inside the SubscriptionsUsage200 as the provided SubscriptionsUsage2000
func (*SubscriptionsUsage200) FromSubscriptionsUsage2001 ¶ added in v0.1.9
func (t *SubscriptionsUsage200) FromSubscriptionsUsage2001(v SubscriptionsUsage2001) error
FromSubscriptionsUsage2001 overwrites any union data inside the SubscriptionsUsage200 as the provided SubscriptionsUsage2001
func (*SubscriptionsUsage200) FromSubscriptionsUsage2002 ¶ added in v0.1.9
func (t *SubscriptionsUsage200) FromSubscriptionsUsage2002(v SubscriptionsUsage2002) error
FromSubscriptionsUsage2002 overwrites any union data inside the SubscriptionsUsage200 as the provided SubscriptionsUsage2002
func (*SubscriptionsUsage200) FromSubscriptionsUsage2003 ¶ added in v0.1.9
func (t *SubscriptionsUsage200) FromSubscriptionsUsage2003(v SubscriptionsUsage2003) error
FromSubscriptionsUsage2003 overwrites any union data inside the SubscriptionsUsage200 as the provided SubscriptionsUsage2003
func (SubscriptionsUsage200) MarshalJSON ¶ added in v0.1.9
func (t SubscriptionsUsage200) MarshalJSON() ([]byte, error)
func (*SubscriptionsUsage200) MergeSubscriptionsUsage2000 ¶ added in v0.1.9
func (t *SubscriptionsUsage200) MergeSubscriptionsUsage2000(v SubscriptionsUsage2000) error
MergeSubscriptionsUsage2000 performs a merge with any union data inside the SubscriptionsUsage200, using the provided SubscriptionsUsage2000
func (*SubscriptionsUsage200) MergeSubscriptionsUsage2001 ¶ added in v0.1.9
func (t *SubscriptionsUsage200) MergeSubscriptionsUsage2001(v SubscriptionsUsage2001) error
MergeSubscriptionsUsage2001 performs a merge with any union data inside the SubscriptionsUsage200, using the provided SubscriptionsUsage2001
func (*SubscriptionsUsage200) MergeSubscriptionsUsage2002 ¶ added in v0.1.9
func (t *SubscriptionsUsage200) MergeSubscriptionsUsage2002(v SubscriptionsUsage2002) error
MergeSubscriptionsUsage2002 performs a merge with any union data inside the SubscriptionsUsage200, using the provided SubscriptionsUsage2002
func (*SubscriptionsUsage200) MergeSubscriptionsUsage2003 ¶ added in v0.1.9
func (t *SubscriptionsUsage200) MergeSubscriptionsUsage2003(v SubscriptionsUsage2003) error
MergeSubscriptionsUsage2003 performs a merge with any union data inside the SubscriptionsUsage200, using the provided SubscriptionsUsage2003
func (*SubscriptionsUsage200) UnmarshalJSON ¶ added in v0.1.9
func (t *SubscriptionsUsage200) UnmarshalJSON(b []byte) error
type SubscriptionsUsage2000 ¶ added in v0.1.9
type SubscriptionsUsage2000 struct {
FetchedAt string `json:"fetchedAt"`
FiveHour *struct {
LeftPercent float32 `json:"leftPercent"`
ResetsAt *string `json:"resetsAt,omitempty"`
UsedPercent float32 `json:"usedPercent"`
WindowSeconds *float32 `json:"windowSeconds,omitempty"`
} `json:"fiveHour,omitempty"`
Plan *string `json:"plan,omitempty"`
ResetCredits *struct {
AvailableCount float32 `json:"availableCount"`
Credits *[]struct {
ExpiresAt *string `json:"expiresAt,omitempty"`
GrantedAt *string `json:"grantedAt,omitempty"`
Id string `json:"id"`
Status string `json:"status"`
Title *string `json:"title,omitempty"`
} `json:"credits,omitempty"`
} `json:"resetCredits,omitempty"`
Weekly *struct {
LeftPercent float32 `json:"leftPercent"`
ResetsAt *string `json:"resetsAt,omitempty"`
UsedPercent float32 `json:"usedPercent"`
WindowSeconds *float32 `json:"windowSeconds,omitempty"`
} `json:"weekly,omitempty"`
}
SubscriptionsUsage2000 Codex usage: rolling and weekly caps, plan and banked reset credits when reported.
type SubscriptionsUsage2001 ¶ added in v0.1.9
type SubscriptionsUsage2001 struct {
ExtraWindows *[]struct {
Label string `json:"label"`
LeftPercent float32 `json:"leftPercent"`
ResetsAt *string `json:"resetsAt,omitempty"`
UsedPercent float32 `json:"usedPercent"`
} `json:"extraWindows,omitempty"`
FetchedAt string `json:"fetchedAt"`
FiveHour *struct {
LeftPercent float32 `json:"leftPercent"`
ResetsAt *string `json:"resetsAt,omitempty"`
UsedPercent float32 `json:"usedPercent"`
} `json:"fiveHour,omitempty"`
Weekly *struct {
LeftPercent float32 `json:"leftPercent"`
ResetsAt *string `json:"resetsAt,omitempty"`
UsedPercent float32 `json:"usedPercent"`
} `json:"weekly,omitempty"`
}
SubscriptionsUsage2001 Claude usage: rolling and weekly caps and additional provider-reported windows.
type SubscriptionsUsage2002 ¶ added in v0.1.9
type SubscriptionsUsage2002 struct {
Kind SubscriptionsUsage2002Kind `json:"kind"`
OnDemand *struct {
Limit float32 `json:"limit"`
Used float32 `json:"used"`
} `json:"onDemand,omitempty"`
Overall struct {
Limit float32 `json:"limit"`
Remaining float32 `json:"remaining"`
ResetsAt *string `json:"resetsAt,omitempty"`
Unit SubscriptionsUsage2002OverallUnit `json:"unit"`
Used float32 `json:"used"`
} `json:"overall"`
Products []struct {
Product string `json:"product"`
UsedPercent float32 `json:"usedPercent"`
} `json:"products"`
}
SubscriptionsUsage2002 xAI usage: overall allowance, per-product percentages and optional on-demand spending.
type SubscriptionsUsage2002Kind ¶ added in v0.1.9
type SubscriptionsUsage2002Kind string
SubscriptionsUsage2002Kind defines model for SubscriptionsUsage200.2.Kind.
const ( SubscriptionsUsage2002KindMonthly SubscriptionsUsage2002Kind = "monthly" SubscriptionsUsage2002KindWeekly SubscriptionsUsage2002Kind = "weekly" )
Defines values for SubscriptionsUsage2002Kind.
func (SubscriptionsUsage2002Kind) Valid ¶ added in v0.1.9
func (e SubscriptionsUsage2002Kind) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsUsage2002Kind enum.
type SubscriptionsUsage2002OverallUnit ¶ added in v0.1.9
type SubscriptionsUsage2002OverallUnit string
SubscriptionsUsage2002OverallUnit defines model for SubscriptionsUsage200.2.Overall.Unit.
const ( SubscriptionsUsage2002OverallUnitCredits SubscriptionsUsage2002OverallUnit = "credits" SubscriptionsUsage2002OverallUnitPercent SubscriptionsUsage2002OverallUnit = "percent" )
Defines values for SubscriptionsUsage2002OverallUnit.
func (SubscriptionsUsage2002OverallUnit) Valid ¶ added in v0.1.9
func (e SubscriptionsUsage2002OverallUnit) Valid() bool
Valid indicates whether the value is a known member of the SubscriptionsUsage2002OverallUnit enum.
type SubscriptionsUsage2003 ¶ added in v0.1.9
type SubscriptionsUsage2003 struct {
Windows []struct {
Label string `json:"label"`
ResetsAt *string `json:"resetsAt,omitempty"`
UsedPercent float32 `json:"usedPercent"`
} `json:"windows"`
}
SubscriptionsUsage2003 Cursor usage windows.
type Task ¶
type Task struct {
// CreatedAt When the task was created.
CreatedAt time.Time `json:"createdAt"`
// Id The task's id. Use it as `taskId` in the task endpoints.
Id string `json:"id"`
// LastActivityAt When the task last did something. `null` if it hasn't yet.
LastActivityAt *time.Time `json:"lastActivityAt"`
// PullRequest The task's pull request. `null` until one opens.
PullRequest *PullRequest `json:"pullRequest"`
// Queued `true` while the task's agent waits because the workspace is already running as many agents at a time as its plan allows. The dashboard shows this as Waiting.
Queued bool `json:"queued"`
// Repo `owner/name` of the task's repository. `null` until a repository is chosen.
Repo *string `json:"repo"`
// Source Where the task started: `api` for the CLI, MCP, this API or the dashboard, `linear` or `github_issue` for an issue, `slack` or `telegram` for a chat. Other sources can appear, so treat an unknown value as a task started elsewhere.
Source string `json:"source"`
// Status Where the task is in its life, such as `pending`, `implementing`, `replied`, `pr_open` or `completed`. New statuses can appear, so don't treat the list as closed. See [Raw statuses](https://docs.sinatra.dev/docs/getting-started/how-it-works#raw-statuses) for each one.
Status string `json:"status"`
// Title The task's title: its issue's title, or a chat task's name. `null` for a task whose issue has no title, or a chat task not yet named.
Title *string `json:"title"`
// Url The task's page in the Sinatra dashboard, where anyone in the workspace can follow it. On a task started from the CLI, MCP, API or dashboard they can reply there too.
Url *string `json:"url"`
}
Task A task: one piece of work Sinatra does, from any source.
type TaskList ¶
type TaskList struct {
// NextCursor Pass it back as `cursor` to get the next page. Treat it as opaque. `null` on the last page.
NextCursor *string `json:"nextCursor"`
// Tasks The page's tasks, most recently active first.
Tasks []Task `json:"tasks"`
}
TaskList A page of tasks.
type TasksCreateJSONRequestBody ¶
type TasksCreateJSONRequestBody = CreateTaskRequest
TasksCreateJSONRequestBody defines body for TasksCreate for application/json ContentType.
type TasksCreateParams ¶
type TasksCreateParams struct {
// IdempotencyKey Makes a retry safe. 1 to 128 printable ASCII characters, with no spaces. A request repeated with the same key answers with the first one's result and does the work once; the same key with different content is `409 idempotency_conflict`. Keys belong to the person who sent them: two people using the same key start two tasks or send two messages. The key is also the `messageId` of the message the request sends, which is a start's first message.
IdempotencyKey *IdempotencyKey `json:"Idempotency-Key,omitempty"`
}
TasksCreateParams defines parameters for TasksCreate.
type TasksListParams ¶
type TasksListParams struct {
// Status Only tasks in this status, such as `implementing` or `pr_open`. A name that isn't a task status is `invalid_status`.
Status *string `form:"status,omitempty" json:"status,omitempty"`
// Limit How many tasks to return, 1 to 100.
Limit *int `form:"limit,omitempty" json:"limit,omitempty"`
// Cursor `nextCursor` from the previous page. Treat it as opaque.
Cursor *string `form:"cursor,omitempty" json:"cursor,omitempty"`
}
TasksListParams defines parameters for TasksList.
type TasksService ¶
type TasksService struct {
// contains filtered or unexported fields
}
TasksService is a workspace's tasks: Client.Tasks.
func (*TasksService) Create ¶
func (s *TasksService) Create(ctx context.Context, workspaceID string, body CreateTaskRequest, opts ...CallOption) (*CreateTaskResponse, error)
Create starts a task (tasks.create). It returns once the task is made, not when it's done: follow it with Get and Messages.ListAll. It always sends an Idempotency-Key; see WithIdempotencyKey.
func (*TasksService) List ¶
func (s *TasksService) List(ctx context.Context, workspaceID string, params *TasksListParams) (*TaskList, error)
List returns one page of the workspace's tasks, most recently active first (tasks.list). params may be nil. ListAll follows the pages for you.
func (*TasksService) ListAll ¶
func (s *TasksService) ListAll(ctx context.Context, workspaceID string, params *TasksListParams) iter.Seq2[Task, error]
ListAll returns every task from params.Cursor on (or from the start), following nextCursor page by page. It stops after the first error, which it yields.
func (*TasksService) Stop ¶
func (s *TasksService) Stop(ctx context.Context, workspaceID, taskID string) (*StopTaskResponse, error)
Stop stops the task's running turn (tasks.stop). A task that isn't running is 409 not_running. Retried on 503 only.
type Ticket ¶
type Ticket struct {
// Context The Linear team's name, or the GitHub repository's name.
Context *string `json:"context"`
// Id The issue's id on Sinatra's side. For GitHub it looks like `github:owner/name#42`.
Id string `json:"id"`
// Identifier What to delegate it by. A Linear identifier such as `ENG-123` (send it as `id`), or a GitHub `owner/name#42` (send `owner/name` as `repo` and `42` as `number`).
Identifier string `json:"identifier"`
// Source Where the issue lives: `linear` or `github`. New sources can appear.
Source string `json:"source"`
// State A GitHub issue's state, such as `open`. `null` for a Linear issue.
State *string `json:"state"`
// Title The issue's title.
Title string `json:"title"`
// Url The issue's address on its tracker.
Url string `json:"url"`
// WorkspaceId The id of the workspace that was searched.
WorkspaceId string `json:"workspaceId"`
// WorkspaceLabel The name the dashboard's ticket picker gives that workspace.
WorkspaceLabel string `json:"workspaceLabel"`
// Yours `true` if the issue is assigned to you or you wrote it.
Yours bool `json:"yours"`
}
Ticket An open issue you could delegate to Sinatra.
type TicketSearchResult ¶
type TicketSearchResult struct {
// Github The workspace's GitHub connection.
Github struct {
// Connected Whether the workspace is connected to GitHub.
Connected bool `json:"connected"`
// Repo The repository the GitHub search covered, when the `repo` query matched an enabled one and had open issues. Otherwise `null`.
Repo *string `json:"repo"`
} `json:"github"`
// Linear The workspace's Linear connection, as it applies to you.
Linear struct {
// Connected Whether the workspace is connected to Linear.
Connected bool `json:"connected"`
// IdentityBound Whether your Linear identity is tied to your Sinatra user.
IdentityBound bool `json:"identityBound"`
// IdentityLinked Whether your Linear account is linked in this workspace. Linear issues are listed only when it is.
IdentityLinked bool `json:"identityLinked"`
} `json:"linear"`
// Tickets The issues you could delegate. Linear issues come first, then GitHub's, each with yours before your team's unassigned ones.
Tickets []Ticket `json:"tickets"`
}
TicketSearchResult The issues you could delegate, and how the workspace is connected to each tracker.
type TicketsDelegateJSONRequestBody ¶
type TicketsDelegateJSONRequestBody = DelegateTicketRequest
TicketsDelegateJSONRequestBody defines body for TicketsDelegate for application/json ContentType.
type TicketsSearchParams ¶
type TicketsSearchParams struct {
// Q Text to match: GitHub search terms, and a substring of a Linear issue's title. Up to 200 characters.
Q *string `form:"q,omitempty" json:"q,omitempty"`
// Repo `owner/name` of an enabled repository to search first on GitHub. A repository that isn't enabled is ignored.
Repo *string `form:"repo,omitempty" json:"repo,omitempty"`
}
TicketsSearchParams defines parameters for TicketsSearch.
type TicketsService ¶
type TicketsService struct {
// contains filtered or unexported fields
}
TicketsService is the issues you could delegate: Client.Tickets.
func (*TicketsService) Delegate ¶
func (s *TicketsService) Delegate(ctx context.Context, workspaceID string, ticket DelegateTarget) (*DelegateTicketResponse, error)
Delegate hands Sinatra an existing issue, as you (tickets.delegate):
client.Tickets.Delegate(ctx, workspaceID, sinatra.DelegateLinearTicket{Id: "ENG-123"})
client.Tickets.Delegate(ctx, workspaceID, sinatra.DelegateGithubTicket{Repo: "acme/web", Number: 42})
Never retried: the operation takes no Idempotency-Key.
func (*TicketsService) Search ¶
func (s *TicketsService) Search(ctx context.Context, workspaceID string, params *TicketsSearchParams) (*TicketSearchResult, error)
Search returns open Linear and GitHub issues you could delegate (tickets.search). params may be nil.
type UpdateEmailPreferencesRequest ¶ added in v0.1.8
type UpdateEmailPreferencesRequest struct {
// contains filtered or unexported fields
}
UpdateEmailPreferencesRequest Set at least one boolean. Omitted categories are unchanged; these preferences belong to you across all your workspaces.
func (UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest0 ¶ added in v0.1.8
func (t UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest0() (UpdateEmailPreferencesRequest0, error)
AsUpdateEmailPreferencesRequest0 returns the union data inside the UpdateEmailPreferencesRequest as a UpdateEmailPreferencesRequest0
func (UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest1 ¶ added in v0.1.8
func (t UpdateEmailPreferencesRequest) AsUpdateEmailPreferencesRequest1() (UpdateEmailPreferencesRequest1, error)
AsUpdateEmailPreferencesRequest1 returns the union data inside the UpdateEmailPreferencesRequest as a UpdateEmailPreferencesRequest1
func (*UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest0 ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest0(v UpdateEmailPreferencesRequest0) error
FromUpdateEmailPreferencesRequest0 overwrites any union data inside the UpdateEmailPreferencesRequest as the provided UpdateEmailPreferencesRequest0
func (*UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest1 ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) FromUpdateEmailPreferencesRequest1(v UpdateEmailPreferencesRequest1) error
FromUpdateEmailPreferencesRequest1 overwrites any union data inside the UpdateEmailPreferencesRequest as the provided UpdateEmailPreferencesRequest1
func (UpdateEmailPreferencesRequest) MarshalJSON ¶ added in v0.1.8
func (t UpdateEmailPreferencesRequest) MarshalJSON() ([]byte, error)
func (*UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest0 ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest0(v UpdateEmailPreferencesRequest0) error
MergeUpdateEmailPreferencesRequest0 performs a merge with any union data inside the UpdateEmailPreferencesRequest, using the provided UpdateEmailPreferencesRequest0
func (*UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest1 ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) MergeUpdateEmailPreferencesRequest1(v UpdateEmailPreferencesRequest1) error
MergeUpdateEmailPreferencesRequest1 performs a merge with any union data inside the UpdateEmailPreferencesRequest, using the provided UpdateEmailPreferencesRequest1
func (*UpdateEmailPreferencesRequest) UnmarshalJSON ¶ added in v0.1.8
func (t *UpdateEmailPreferencesRequest) UnmarshalJSON(b []byte) error
type UpdateEmailPreferencesRequest0 ¶ added in v0.1.8
type UpdateEmailPreferencesRequest0 struct {
SetupReminders bool `json:"setupReminders"`
TaskAlerts *bool `json:"taskAlerts,omitempty"`
}
UpdateEmailPreferencesRequest0 defines model for UpdateEmailPreferencesRequest.0.
type UpdateEmailPreferencesRequest1 ¶ added in v0.1.8
type UpdateEmailPreferencesRequest1 struct {
SetupReminders *bool `json:"setupReminders,omitempty"`
TaskAlerts bool `json:"taskAlerts"`
}
UpdateEmailPreferencesRequest1 defines model for UpdateEmailPreferencesRequest.1.
type Workspace ¶
type Workspace struct {
// Id The workspace's id. Use it as `workspaceId` in the workspace endpoints.
Id string `json:"id"`
// Name The workspace's name.
Name string `json:"name"`
// Role Your role in it: `owner`, `admin` or `member`. New roles can appear.
Role string `json:"role"`
}
Workspace A workspace you belong to.
type WorkspaceAccess ¶ added in v0.1.8
type WorkspaceAccess struct {
AccessRequests []struct {
AssignedRole *string `json:"assignedRole"`
Id string `json:"id"`
RequestedAt time.Time `json:"requestedAt"`
Requester struct {
AvatarUrl *string `json:"avatarUrl"`
GithubLogin *string `json:"githubLogin"`
Id string `json:"id"`
Name *string `json:"name"`
} `json:"requester"`
ReviewedAt *time.Time `json:"reviewedAt"`
State string `json:"state"`
} `json:"accessRequests"`
Invites []WorkspaceInvite `json:"invites"`
Memberships []struct {
CreatedAt time.Time `json:"createdAt"`
Id string `json:"id"`
Role string `json:"role"`
User struct {
AvatarUrl *string `json:"avatarUrl"`
GithubLogin *string `json:"githubLogin"`
Id string `json:"id"`
Name *string `json:"name"`
} `json:"user"`
} `json:"memberships"`
}
WorkspaceAccess defines model for WorkspaceAccess.
type WorkspaceAccessApproveRequestJSONRequestBody ¶ added in v0.1.8
type WorkspaceAccessApproveRequestJSONRequestBody = WorkspaceGrantRoleRequest
WorkspaceAccessApproveRequestJSONRequestBody defines body for WorkspaceAccessApproveRequest for application/json ContentType.
type WorkspaceAccessApproved ¶ added in v0.1.8
type WorkspaceAccessApproved struct {
Membership struct {
Id string `json:"id"`
Role string `json:"role"`
} `json:"membership"`
Request struct {
AssignedRole *string `json:"assignedRole"`
Id string `json:"id"`
State string `json:"state"`
} `json:"request"`
}
WorkspaceAccessApproved defines model for WorkspaceAccessApproved.
type WorkspaceAccessCreateInviteJSONRequestBody ¶ added in v0.1.8
type WorkspaceAccessCreateInviteJSONRequestBody = WorkspaceInviteCreateRequest
WorkspaceAccessCreateInviteJSONRequestBody defines body for WorkspaceAccessCreateInvite for application/json ContentType.
type WorkspaceAccessDenied ¶ added in v0.1.8
type WorkspaceAccessDenied struct {
Request struct {
Id string `json:"id"`
State string `json:"state"`
} `json:"request"`
}
WorkspaceAccessDenied defines model for WorkspaceAccessDenied.
type WorkspaceAccessOk ¶ added in v0.1.8
type WorkspaceAccessOk struct {
Ok WorkspaceAccessOkOk `json:"ok"`
}
WorkspaceAccessOk defines model for WorkspaceAccessOk.
type WorkspaceAccessOkOk ¶ added in v0.1.8
type WorkspaceAccessOkOk bool
WorkspaceAccessOkOk defines model for WorkspaceAccessOk.Ok.
const (
WorkspaceAccessOkOkTrue WorkspaceAccessOkOk = true
)
Defines values for WorkspaceAccessOkOk.
func (WorkspaceAccessOkOk) Valid ¶ added in v0.1.8
func (e WorkspaceAccessOkOk) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceAccessOkOk enum.
type WorkspaceAccessSetRoleJSONRequestBody ¶ added in v0.1.8
type WorkspaceAccessSetRoleJSONRequestBody = WorkspaceGrantRoleRequest
WorkspaceAccessSetRoleJSONRequestBody defines body for WorkspaceAccessSetRole for application/json ContentType.
type WorkspaceGrantRoleRequest ¶ added in v0.1.8
type WorkspaceGrantRoleRequest struct {
// Role The role to grant. Ownership can only be transferred, never granted.
Role WorkspaceGrantRoleRequestRole `json:"role"`
}
WorkspaceGrantRoleRequest defines model for WorkspaceGrantRoleRequest.
type WorkspaceGrantRoleRequestRole ¶ added in v0.1.8
type WorkspaceGrantRoleRequestRole string
WorkspaceGrantRoleRequestRole The role to grant. Ownership can only be transferred, never granted.
const ( WorkspaceGrantRoleRequestRoleAdmin WorkspaceGrantRoleRequestRole = "admin" WorkspaceGrantRoleRequestRoleMember WorkspaceGrantRoleRequestRole = "member" )
Defines values for WorkspaceGrantRoleRequestRole.
func (WorkspaceGrantRoleRequestRole) Valid ¶ added in v0.1.8
func (e WorkspaceGrantRoleRequestRole) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceGrantRoleRequestRole enum.
type WorkspaceInvite ¶ added in v0.1.8
type WorkspaceInvite struct {
AcceptedAt *time.Time `json:"acceptedAt"`
CreatedAt time.Time `json:"createdAt"`
DeclinedAt *time.Time `json:"declinedAt"`
Email string `json:"email"`
ExpiresAt time.Time `json:"expiresAt"`
Id string `json:"id"`
RevokedAt *time.Time `json:"revokedAt"`
Role string `json:"role"`
// Status active, revoked, expired, consumed or declined.
Status string `json:"status"`
}
WorkspaceInvite An invitation's public metadata. No invitation token or redemption secret is returned.
type WorkspaceInviteCreateRequest ¶ added in v0.1.8
type WorkspaceInviteCreateRequest struct {
Email openapi_types.Email `json:"email"`
Role WorkspaceInviteCreateRequestRole `json:"role"`
}
WorkspaceInviteCreateRequest defines model for WorkspaceInviteCreateRequest.
type WorkspaceInviteCreateRequestRole ¶ added in v0.1.8
type WorkspaceInviteCreateRequestRole string
WorkspaceInviteCreateRequestRole defines model for WorkspaceInviteCreateRequest.Role.
const ( WorkspaceInviteCreateRequestRoleAdmin WorkspaceInviteCreateRequestRole = "admin" WorkspaceInviteCreateRequestRoleMember WorkspaceInviteCreateRequestRole = "member" )
Defines values for WorkspaceInviteCreateRequestRole.
func (WorkspaceInviteCreateRequestRole) Valid ¶ added in v0.1.8
func (e WorkspaceInviteCreateRequestRole) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceInviteCreateRequestRole enum.
type WorkspaceInviteResponse ¶ added in v0.1.8
type WorkspaceInviteResponse struct {
// Invite An invitation's public metadata. No invitation token or redemption secret is returned.
Invite WorkspaceInvite `json:"invite"`
}
WorkspaceInviteResponse defines model for WorkspaceInviteResponse.
type WorkspaceMembershipResponse ¶ added in v0.1.8
type WorkspaceMembershipResponse struct {
Membership struct {
Id string `json:"id"`
Role string `json:"role"`
} `json:"membership"`
}
WorkspaceMembershipResponse defines model for WorkspaceMembershipResponse.
type WorkspaceModelDefault ¶ added in v0.1.9
type WorkspaceModelDefault struct {
// Selection The workspace default, or null to inherit automatic selection.
Selection *WorkspaceModelSelection `json:"selection"`
}
WorkspaceModelDefault defines model for WorkspaceModelDefault.
type WorkspaceModelKey ¶ added in v0.1.9
type WorkspaceModelKey struct {
// Provider The provider, currently anthropic or openrouter.
Provider string `json:"provider"`
// Status Currently configured. No key material or masked suffix is returned.
Status string `json:"status"`
}
WorkspaceModelKey defines model for WorkspaceModelKey.
type WorkspaceModelKeyRequest ¶ added in v0.1.9
type WorkspaceModelKeyRequest struct {
// ApiKey The provider API key. It is encrypted at rest and never returned.
ApiKey string `json:"apiKey"`
Provider WorkspaceModelKeyRequestProvider `json:"provider"`
}
WorkspaceModelKeyRequest defines model for WorkspaceModelKeyRequest.
type WorkspaceModelKeyRequestProvider ¶ added in v0.1.9
type WorkspaceModelKeyRequestProvider string
WorkspaceModelKeyRequestProvider defines model for WorkspaceModelKeyRequest.Provider.
const ( WorkspaceModelKeyRequestProviderAnthropic WorkspaceModelKeyRequestProvider = "anthropic" WorkspaceModelKeyRequestProviderOpenrouter WorkspaceModelKeyRequestProvider = "openrouter" )
Defines values for WorkspaceModelKeyRequestProvider.
func (WorkspaceModelKeyRequestProvider) Valid ¶ added in v0.1.9
func (e WorkspaceModelKeyRequestProvider) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceModelKeyRequestProvider enum.
type WorkspaceModelKeys ¶ added in v0.1.9
type WorkspaceModelKeys struct {
Credentials []WorkspaceModelKey `json:"credentials"`
}
WorkspaceModelKeys defines model for WorkspaceModelKeys.
type WorkspaceModelSelection ¶ added in v0.1.9
type WorkspaceModelSelection struct {
// Effort An effort supported by that engine and model; omitted when not applicable.
Effort *string `json:"effort,omitempty"`
// Engine A supported engine from Sinatra's model catalog.
Engine string `json:"engine"`
// Model A model supported by the selected engine.
Model string `json:"model"`
}
WorkspaceModelSelection defines model for WorkspaceModelSelection.
type WorkspaceModelsAddKeyJSONRequestBody ¶ added in v0.1.9
type WorkspaceModelsAddKeyJSONRequestBody = WorkspaceModelKeyRequest
WorkspaceModelsAddKeyJSONRequestBody defines body for WorkspaceModelsAddKey for application/json ContentType.
type WorkspaceModelsRemoveKeyParamsProvider ¶ added in v0.1.9
type WorkspaceModelsRemoveKeyParamsProvider string
WorkspaceModelsRemoveKeyParamsProvider defines parameters for WorkspaceModelsRemoveKey.
const ( WorkspaceModelsRemoveKeyParamsProviderAnthropic WorkspaceModelsRemoveKeyParamsProvider = "anthropic" WorkspaceModelsRemoveKeyParamsProviderOpenrouter WorkspaceModelsRemoveKeyParamsProvider = "openrouter" )
Defines values for WorkspaceModelsRemoveKeyParamsProvider.
func (WorkspaceModelsRemoveKeyParamsProvider) Valid ¶ added in v0.1.9
func (e WorkspaceModelsRemoveKeyParamsProvider) Valid() bool
Valid indicates whether the value is a known member of the WorkspaceModelsRemoveKeyParamsProvider enum.
type WorkspaceModelsSetDefaultJSONRequestBody ¶ added in v0.1.9
type WorkspaceModelsSetDefaultJSONRequestBody = WorkspaceModelSelection
WorkspaceModelsSetDefaultJSONRequestBody defines body for WorkspaceModelsSetDefault for application/json ContentType.
type WorkspaceOverview ¶ added in v0.1.8
type WorkspaceOverview struct {
// DefaultModel The workspace's saved model default, or null when unset. Personal and repository overrides aren't included.
DefaultModel *struct {
Effort *string `json:"effort,omitempty"`
Engine string `json:"engine"`
Model string `json:"model"`
} `json:"defaultModel"`
Github struct {
AccountLogin *string `json:"accountLogin"`
AccountType *string `json:"accountType"`
// InstallationId GitHub installation id as a decimal string.
InstallationId *string `json:"installationId"`
// Status `connected` or `not_connected`.
Status string `json:"status"`
} `json:"github"`
// Id The workspace's id. Use it as `workspaceId` in the workspace endpoints.
Id string `json:"id"`
Linear struct {
CurrentUserHasReadToken bool `json:"currentUserHasReadToken"`
NeedsReconnect bool `json:"needsReconnect"`
OrganizationName *string `json:"organizationName"`
OrganizationUrlKey *string `json:"organizationUrlKey"`
RecentTeams []struct {
Key string `json:"key"`
TaskCount int `json:"taskCount"`
} `json:"recentTeams"`
// Status `connected` or `not_connected`.
Status string `json:"status"`
} `json:"linear"`
// Name The workspace's name.
Name string `json:"name"`
// PlanStatus The member-visible billing and capacity status shared by workspace overview and billing settings. No Stripe identifiers or credential material are returned.
PlanStatus WorkspacePlanStatus `json:"planStatus"`
// RepoCatalog `none` without GitHub, `syncing` before its catalog is published, `ready` once published, or `suspended`. An empty repository list while syncing doesn't mean there are no connected repositories.
RepoCatalog string `json:"repoCatalog"`
RepoEnvironmentsEnabled bool `json:"repoEnvironmentsEnabled"`
// RepoEnvironmentsStage Repository environments rollout stage: `off`, `prepare` or `live`.
RepoEnvironmentsStage string `json:"repoEnvironmentsStage"`
Repos []struct {
Id string `json:"id"`
// Name Connected repository in `owner/name` form.
Name string `json:"name"`
Preprocessing struct {
Label struct {
Error *string `json:"error"`
Status string `json:"status"`
} `json:"label"`
Metadata struct {
Error *string `json:"error"`
Status string `json:"status"`
} `json:"metadata"`
OverallStatus string `json:"overallStatus"`
} `json:"preprocessing"`
PrimaryLanguage *string `json:"primaryLanguage"`
ShortDescription string `json:"shortDescription"`
Stack *string `json:"stack"`
} `json:"repos"`
// Role Your role in it: `owner`, `admin` or `member`. New roles can appear.
Role string `json:"role"`
Slack struct {
AllowExternalSharedChannels bool `json:"allowExternalSharedChannels"`
Available bool `json:"available"`
Identity *struct {
DisplayName *string `json:"displayName"`
SlackUserId string `json:"slackUserId"`
} `json:"identity"`
// Status `connected`, `inactive` or `not_connected`.
Status string `json:"status"`
TeamName *string `json:"teamName"`
} `json:"slack"`
Telegram struct {
Available bool `json:"available"`
// Connected Whether the current user has linked their personal Telegram account. This is independent of workspace enablement.
Connected bool `json:"connected"`
Enabled bool `json:"enabled"`
} `json:"telegram"`
}
WorkspaceOverview Read-only workspace overview, with the same member-visible data as the dashboard. No credentials or tokens.
type WorkspaceOwnershipTransferred ¶ added in v0.1.8
type WorkspaceOwnershipTransferred struct {
From struct {
Id string `json:"id"`
Role string `json:"role"`
} `json:"from"`
To struct {
Id string `json:"id"`
Role string `json:"role"`
} `json:"to"`
}
WorkspaceOwnershipTransferred defines model for WorkspaceOwnershipTransferred.
type WorkspacePlanStatus ¶ added in v0.1.9
type WorkspacePlanStatus struct {
// contains filtered or unexported fields
}
WorkspacePlanStatus The member-visible billing and capacity status shared by workspace overview and billing settings. No Stripe identifiers or credential material are returned.
func (WorkspacePlanStatus) AsWorkspacePlanStatus0 ¶ added in v0.1.9
func (t WorkspacePlanStatus) AsWorkspacePlanStatus0() (WorkspacePlanStatus0, error)
AsWorkspacePlanStatus0 returns the union data inside the WorkspacePlanStatus as a WorkspacePlanStatus0
func (WorkspacePlanStatus) AsWorkspacePlanStatus1 ¶ added in v0.1.9
func (t WorkspacePlanStatus) AsWorkspacePlanStatus1() (WorkspacePlanStatus1, error)
AsWorkspacePlanStatus1 returns the union data inside the WorkspacePlanStatus as a WorkspacePlanStatus1
func (*WorkspacePlanStatus) FromWorkspacePlanStatus0 ¶ added in v0.1.9
func (t *WorkspacePlanStatus) FromWorkspacePlanStatus0(v WorkspacePlanStatus0) error
FromWorkspacePlanStatus0 overwrites any union data inside the WorkspacePlanStatus as the provided WorkspacePlanStatus0
func (*WorkspacePlanStatus) FromWorkspacePlanStatus1 ¶ added in v0.1.9
func (t *WorkspacePlanStatus) FromWorkspacePlanStatus1(v WorkspacePlanStatus1) error
FromWorkspacePlanStatus1 overwrites any union data inside the WorkspacePlanStatus as the provided WorkspacePlanStatus1
func (WorkspacePlanStatus) MarshalJSON ¶ added in v0.1.9
func (t WorkspacePlanStatus) MarshalJSON() ([]byte, error)
func (*WorkspacePlanStatus) MergeWorkspacePlanStatus0 ¶ added in v0.1.9
func (t *WorkspacePlanStatus) MergeWorkspacePlanStatus0(v WorkspacePlanStatus0) error
MergeWorkspacePlanStatus0 performs a merge with any union data inside the WorkspacePlanStatus, using the provided WorkspacePlanStatus0
func (*WorkspacePlanStatus) MergeWorkspacePlanStatus1 ¶ added in v0.1.9
func (t *WorkspacePlanStatus) MergeWorkspacePlanStatus1(v WorkspacePlanStatus1) error
MergeWorkspacePlanStatus1 performs a merge with any union data inside the WorkspacePlanStatus, using the provided WorkspacePlanStatus1
func (*WorkspacePlanStatus) UnmarshalJSON ¶ added in v0.1.9
func (t *WorkspacePlanStatus) UnmarshalJSON(b []byte) error
type WorkspacePlanStatus0 ¶ added in v0.1.9
type WorkspacePlanStatus0 struct {
Plan WorkspacePlanStatus0Plan `json:"plan"`
}
WorkspacePlanStatus0 defines model for WorkspacePlanStatus.0.
type WorkspacePlanStatus0Plan ¶ added in v0.1.9
type WorkspacePlanStatus0Plan string
WorkspacePlanStatus0Plan defines model for WorkspacePlanStatus.0.Plan.
const (
WorkspacePlanStatus0PlanEnterprise WorkspacePlanStatus0Plan = "enterprise"
)
Defines values for WorkspacePlanStatus0Plan.
func (WorkspacePlanStatus0Plan) Valid ¶ added in v0.1.9
func (e WorkspacePlanStatus0Plan) Valid() bool
Valid indicates whether the value is a known member of the WorkspacePlanStatus0Plan enum.
type WorkspacePlanStatus1 ¶ added in v0.1.9
type WorkspacePlanStatus1 struct {
// ByokConfigured Whether your model credentials or a workspace key are configured.
ByokConfigured bool `json:"byokConfigured"`
Capacity struct {
Plan string `json:"plan"`
Queued int `json:"queued"`
Running int `json:"running"`
} `json:"capacity"`
CapacityCatalog []struct {
Plan string `json:"plan"`
PriceUsd float32 `json:"priceUsd"`
Queued int `json:"queued"`
Running int `json:"running"`
} `json:"capacityCatalog"`
Plan WorkspacePlanStatus1Plan `json:"plan"`
Subscription *struct {
ActionRequiredHostedInvoiceUrl *string `json:"actionRequiredHostedInvoiceUrl"`
CancelAtPeriodEnd bool `json:"cancelAtPeriodEnd"`
CapacityPlan *string `json:"capacityPlan"`
CurrentPeriodEnd *time.Time `json:"currentPeriodEnd"`
EndsAt *time.Time `json:"endsAt"`
PastDueSinceAt *time.Time `json:"pastDueSinceAt"`
Status string `json:"status"`
TrialEndsAt *time.Time `json:"trialEndsAt"`
} `json:"subscription"`
}
WorkspacePlanStatus1 defines model for WorkspacePlanStatus.1.
type WorkspacePlanStatus1Plan ¶ added in v0.1.9
type WorkspacePlanStatus1Plan string
WorkspacePlanStatus1Plan defines model for WorkspacePlanStatus.1.Plan.
const (
WorkspacePlanStatus1PlanMonthly WorkspacePlanStatus1Plan = "monthly"
)
Defines values for WorkspacePlanStatus1Plan.
func (WorkspacePlanStatus1Plan) Valid ¶ added in v0.1.9
func (e WorkspacePlanStatus1Plan) Valid() bool
Valid indicates whether the value is a known member of the WorkspacePlanStatus1Plan enum.
Directories
¶
| Path | Synopsis |
|---|---|
|
examples
|
|
|
delegate-issue
command
Command delegate-issue hands Sinatra an issue you already have, the way assigning it in Linear or labelling it on GitHub would.
|
Command delegate-issue hands Sinatra an issue you already have, the way assigning it in Linear or labelling it on GitHub would. |
|
open-prs
command
Command open-prs prints every pull request Sinatra has open and waiting for review, in each of your workspaces, as a Markdown list you can paste into a standup or a Slack channel.
|
Command open-prs prints every pull request Sinatra has open and waiting for review, in each of your workspaces, as a Markdown list you can paste into a standup or a Slack channel. |
|
quickstart
command
Command quickstart is README.md's quick start as a whole program: it starts a task in your first workspace and prints the conversation until the turn ends.
|
Command quickstart is README.md's quick start as a whole program: it starts a task in your first workspace and prints the conversation until the turn ends. |
|
search-issues
command
Command search-issues lists open Linear and GitHub issues you could hand to Sinatra, yours first.
|
Command search-issues lists open Linear and GitHub issues you could hand to Sinatra, yours first. |