Documentation
¶
Overview ¶
Package api provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.8.0 DO NOT EDIT.
Package api is generated from api/openapi.yaml.
Index ¶
- func GetSpec() (swagger *openapi3.T, err error)
- func GetSpecJSON() ([]byte, error)
- func GetSwagger() (*openapi3.T, error)deprecated
- func NewActivateAccountRequest(server string, name string, params *ActivateAccountParams) (*http.Request, error)
- func NewAdoptAccountRequest(server string, body AdoptAccountJSONRequestBody) (*http.Request, error)
- func NewAdoptAccountRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewCancelLoginRequest(server string, name string, params *CancelLoginParams) (*http.Request, error)
- func NewCreateWebCodeRequest(server string) (*http.Request, error)
- func NewFinishLoginRequest(server string, name string, body FinishLoginJSONRequestBody) (*http.Request, error)
- func NewFinishLoginRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
- func NewGetEventsRequest(server string) (*http.Request, error)
- func NewGetI18nRequest(server string, lang string, params *GetI18nParams) (*http.Request, error)
- func NewGetStatusRequest(server string) (*http.Request, error)
- func NewImportAccountRequest(server string, body ImportAccountJSONRequestBody) (*http.Request, error)
- func NewImportAccountRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewInstallUpdateRequest(server string) (*http.Request, error)
- func NewListAccountsRequest(server string) (*http.Request, error)
- func NewMigrateCancelRequest(server string, body MigrateCancelJSONRequestBody) (*http.Request, error)
- func NewMigrateCancelRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewMigrateCommitRequest(server string, body MigrateCommitJSONRequestBody) (*http.Request, error)
- func NewMigrateCommitRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewMigrateExportRequest(server string, body MigrateExportJSONRequestBody) (*http.Request, error)
- func NewMigrateExportRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewMigrateImportRequest(server string, body MigrateImportJSONRequestBody) (*http.Request, error)
- func NewMigrateImportRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewOpenWebSessionRequest(server string, body OpenWebSessionJSONRequestBody) (*http.Request, error)
- func NewOpenWebSessionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewPatchAccountRequest(server string, name string, body PatchAccountJSONRequestBody) (*http.Request, error)
- func NewPatchAccountRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
- func NewRefreshLoginRequest(server string, name string) (*http.Request, error)
- func NewRefreshRequest(server string) (*http.Request, error)
- func NewRemoveAccountRequest(server string, name string) (*http.Request, error)
- func NewRestartRequest(server string, body RestartJSONRequestBody) (*http.Request, error)
- func NewRestartRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewSetAutoRequest(server string, body SetAutoJSONRequestBody) (*http.Request, error)
- func NewSetAutoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewSetLangRequest(server string, body SetLangJSONRequestBody) (*http.Request, error)
- func NewSetLangRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewSetRemoteRequest(server string, body SetRemoteJSONRequestBody) (*http.Request, error)
- func NewSetRemoteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewSetStrategyRequest(server string, body SetStrategyJSONRequestBody) (*http.Request, error)
- func NewSetStrategyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewSetThresholdsRequest(server string, body SetThresholdsJSONRequestBody) (*http.Request, error)
- func NewSetThresholdsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewSignalRequest(server string, body SignalJSONRequestBody) (*http.Request, error)
- func NewSignalRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewStartLoginRequest(server string, name string) (*http.Request, error)
- func NewUseResetRequest(server string, name string, body UseResetJSONRequestBody) (*http.Request, error)
- func NewUseResetRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- func RegisterHandlers(router fiber.Router, si ServerInterface)
- func RegisterHandlersWithOptions(router fiber.Router, si ServerInterface, options FiberServerOptions)
- type Account
- type AccountPatch
- type ActivateAccount200JSONResponse
- type ActivateAccount400JSONResponse
- type ActivateAccount404JSONResponse
- type ActivateAccount409JSONResponse
- type ActivateAccount500JSONResponse
- type ActivateAccountParams
- type ActivateAccountRequestObject
- type ActivateAccountResponse
- func (r ActivateAccountResponse) ContentType() string
- func (r ActivateAccountResponse) GetBody() []byte
- func (r ActivateAccountResponse) GetJSON200() *Status
- func (r ActivateAccountResponse) GetJSON400() *Error
- func (r ActivateAccountResponse) GetJSON404() *Error
- func (r ActivateAccountResponse) GetJSON409() *Error
- func (r ActivateAccountResponse) GetJSON500() *Error
- func (r ActivateAccountResponse) Status() string
- func (r ActivateAccountResponse) StatusCode() int
- type ActivateAccountResponseObject
- type AdoptAccount200JSONResponse
- type AdoptAccount400JSONResponse
- type AdoptAccount404JSONResponse
- type AdoptAccount409JSONResponse
- type AdoptAccount500JSONResponse
- type AdoptAccountJSONRequestBody
- type AdoptAccountRequestObject
- type AdoptAccountResponse
- func (r AdoptAccountResponse) ContentType() string
- func (r AdoptAccountResponse) GetBody() []byte
- func (r AdoptAccountResponse) GetJSON200() *Account
- func (r AdoptAccountResponse) GetJSON400() *Error
- func (r AdoptAccountResponse) GetJSON404() *Error
- func (r AdoptAccountResponse) GetJSON409() *Error
- func (r AdoptAccountResponse) GetJSON500() *Error
- func (r AdoptAccountResponse) Status() string
- func (r AdoptAccountResponse) StatusCode() int
- type AdoptAccountResponseObject
- type AdoptRequest
- type AutoRequest
- type CancelLogin204Response
- type CancelLogin500JSONResponse
- type CancelLoginParams
- type CancelLoginRequestObject
- type CancelLoginResponse
- type CancelLoginResponseObject
- type Catalog
- type Client
- func (c *Client) ActivateAccount(ctx context.Context, name string, params *ActivateAccountParams, ...) (*http.Response, error)
- func (c *Client) AdoptAccount(ctx context.Context, body AdoptAccountJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) AdoptAccountWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) CancelLogin(ctx context.Context, name string, params *CancelLoginParams, ...) (*http.Response, error)
- func (c *Client) CreateWebCode(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) FinishLogin(ctx context.Context, name string, body FinishLoginJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) FinishLoginWithBody(ctx context.Context, name string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) GetEvents(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetI18n(ctx context.Context, lang string, params *GetI18nParams, ...) (*http.Response, error)
- func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ImportAccount(ctx context.Context, body ImportAccountJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) ImportAccountWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) InstallUpdate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListAccounts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) MigrateCancel(ctx context.Context, body MigrateCancelJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) MigrateCancelWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) MigrateCommit(ctx context.Context, body MigrateCommitJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) MigrateCommitWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) MigrateExport(ctx context.Context, body MigrateExportJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) MigrateExportWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) MigrateImport(ctx context.Context, body MigrateImportJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) MigrateImportWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) OpenWebSession(ctx context.Context, body OpenWebSessionJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) OpenWebSessionWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) PatchAccount(ctx context.Context, name string, body PatchAccountJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PatchAccountWithBody(ctx context.Context, name string, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Refresh(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) RefreshLogin(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) RemoveAccount(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) Restart(ctx context.Context, body RestartJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) RestartWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) SetAuto(ctx context.Context, body SetAutoJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SetAutoWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) SetLang(ctx context.Context, body SetLangJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SetLangWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) SetRemote(ctx context.Context, body SetRemoteJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SetRemoteWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) SetStrategy(ctx context.Context, body SetStrategyJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SetStrategyWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) SetThresholds(ctx context.Context, body SetThresholdsJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SetThresholdsWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) Signal(ctx context.Context, body SignalJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) SignalWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) StartLogin(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) UseReset(ctx context.Context, name string, body UseResetJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) UseResetWithBody(ctx context.Context, name string, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) ActivateAccountWithResponse(ctx context.Context, name string, params *ActivateAccountParams, ...) (*ActivateAccountResponse, error)
- func (c *ClientWithResponses) AdoptAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*AdoptAccountResponse, error)
- func (c *ClientWithResponses) AdoptAccountWithResponse(ctx context.Context, body AdoptAccountJSONRequestBody, ...) (*AdoptAccountResponse, error)
- func (c *ClientWithResponses) CancelLoginWithResponse(ctx context.Context, name string, params *CancelLoginParams, ...) (*CancelLoginResponse, error)
- func (c *ClientWithResponses) CreateWebCodeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CreateWebCodeResponse, error)
- func (c *ClientWithResponses) FinishLoginWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, ...) (*FinishLoginResponse, error)
- func (c *ClientWithResponses) FinishLoginWithResponse(ctx context.Context, name string, body FinishLoginJSONRequestBody, ...) (*FinishLoginResponse, error)
- func (c *ClientWithResponses) GetEventsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEventsResponse, error)
- func (c *ClientWithResponses) GetI18nWithResponse(ctx context.Context, lang string, params *GetI18nParams, ...) (*GetI18nResponse, error)
- func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
- func (c *ClientWithResponses) ImportAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*ImportAccountResponse, error)
- func (c *ClientWithResponses) ImportAccountWithResponse(ctx context.Context, body ImportAccountJSONRequestBody, ...) (*ImportAccountResponse, error)
- func (c *ClientWithResponses) InstallUpdateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InstallUpdateResponse, error)
- func (c *ClientWithResponses) ListAccountsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAccountsResponse, error)
- func (c *ClientWithResponses) MigrateCancelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*MigrateCancelResponse, error)
- func (c *ClientWithResponses) MigrateCancelWithResponse(ctx context.Context, body MigrateCancelJSONRequestBody, ...) (*MigrateCancelResponse, error)
- func (c *ClientWithResponses) MigrateCommitWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*MigrateCommitResponse, error)
- func (c *ClientWithResponses) MigrateCommitWithResponse(ctx context.Context, body MigrateCommitJSONRequestBody, ...) (*MigrateCommitResponse, error)
- func (c *ClientWithResponses) MigrateExportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*MigrateExportResponse, error)
- func (c *ClientWithResponses) MigrateExportWithResponse(ctx context.Context, body MigrateExportJSONRequestBody, ...) (*MigrateExportResponse, error)
- func (c *ClientWithResponses) MigrateImportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*MigrateImportResponse, error)
- func (c *ClientWithResponses) MigrateImportWithResponse(ctx context.Context, body MigrateImportJSONRequestBody, ...) (*MigrateImportResponse, error)
- func (c *ClientWithResponses) OpenWebSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*OpenWebSessionResponse, error)
- func (c *ClientWithResponses) OpenWebSessionWithResponse(ctx context.Context, body OpenWebSessionJSONRequestBody, ...) (*OpenWebSessionResponse, error)
- func (c *ClientWithResponses) PatchAccountWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, ...) (*PatchAccountResponse, error)
- func (c *ClientWithResponses) PatchAccountWithResponse(ctx context.Context, name string, body PatchAccountJSONRequestBody, ...) (*PatchAccountResponse, error)
- func (c *ClientWithResponses) RefreshLoginWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RefreshLoginResponse, error)
- func (c *ClientWithResponses) RefreshWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RefreshResponse, error)
- func (c *ClientWithResponses) RemoveAccountWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RemoveAccountResponse, error)
- func (c *ClientWithResponses) RestartWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*RestartResponse, error)
- func (c *ClientWithResponses) RestartWithResponse(ctx context.Context, body RestartJSONRequestBody, ...) (*RestartResponse, error)
- func (c *ClientWithResponses) SetAutoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SetAutoResponse, error)
- func (c *ClientWithResponses) SetAutoWithResponse(ctx context.Context, body SetAutoJSONRequestBody, ...) (*SetAutoResponse, error)
- func (c *ClientWithResponses) SetLangWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SetLangResponse, error)
- func (c *ClientWithResponses) SetLangWithResponse(ctx context.Context, body SetLangJSONRequestBody, ...) (*SetLangResponse, error)
- func (c *ClientWithResponses) SetRemoteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SetRemoteResponse, error)
- func (c *ClientWithResponses) SetRemoteWithResponse(ctx context.Context, body SetRemoteJSONRequestBody, ...) (*SetRemoteResponse, error)
- func (c *ClientWithResponses) SetStrategyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SetStrategyResponse, error)
- func (c *ClientWithResponses) SetStrategyWithResponse(ctx context.Context, body SetStrategyJSONRequestBody, ...) (*SetStrategyResponse, error)
- func (c *ClientWithResponses) SetThresholdsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SetThresholdsResponse, error)
- func (c *ClientWithResponses) SetThresholdsWithResponse(ctx context.Context, body SetThresholdsJSONRequestBody, ...) (*SetThresholdsResponse, error)
- func (c *ClientWithResponses) SignalWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SignalResponse, error)
- func (c *ClientWithResponses) SignalWithResponse(ctx context.Context, body SignalJSONRequestBody, reqEditors ...RequestEditorFn) (*SignalResponse, error)
- func (c *ClientWithResponses) StartLoginWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*StartLoginResponse, error)
- func (c *ClientWithResponses) UseResetWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, ...) (*UseResetResponse, error)
- func (c *ClientWithResponses) UseResetWithResponse(ctx context.Context, name string, body UseResetJSONRequestBody, ...) (*UseResetResponse, error)
- type ClientWithResponsesInterface
- type CreateWebCode200JSONResponse
- type CreateWebCode500JSONResponse
- type CreateWebCodeRequestObject
- type CreateWebCodeResponse
- type CreateWebCodeResponseObject
- type Error
- type ErrorJSONResponse
- type FiberServerOptions
- type FinishLogin200JSONResponse
- type FinishLogin400JSONResponse
- type FinishLogin404JSONResponse
- type FinishLogin409JSONResponse
- type FinishLogin500JSONResponse
- type FinishLogin502JSONResponse
- type FinishLoginJSONRequestBody
- type FinishLoginRequestObject
- type FinishLoginResponse
- func (r FinishLoginResponse) ContentType() string
- func (r FinishLoginResponse) GetBody() []byte
- func (r FinishLoginResponse) GetJSON200() *Account
- func (r FinishLoginResponse) GetJSON400() *Error
- func (r FinishLoginResponse) GetJSON404() *Error
- func (r FinishLoginResponse) GetJSON409() *Error
- func (r FinishLoginResponse) GetJSON500() *Error
- func (r FinishLoginResponse) GetJSON502() *Error
- func (r FinishLoginResponse) Status() string
- func (r FinishLoginResponse) StatusCode() int
- type FinishLoginResponseObject
- type GetEvents200TexteventStreamResponse
- type GetEvents500JSONResponse
- type GetEventsRequestObject
- type GetEventsResponse
- type GetEventsResponseObject
- type GetI18n200JSONResponse
- type GetI18n200ResponseHeaders
- type GetI18n304Response
- type GetI18n304ResponseHeaders
- type GetI18n404JSONResponse
- type GetI18nParams
- type GetI18nRequestObject
- type GetI18nResponse
- type GetI18nResponse200Headers
- type GetI18nResponse304Headers
- type GetI18nResponseObject
- type GetStatus200JSONResponse
- type GetStatus500JSONResponse
- type GetStatusRequestObject
- type GetStatusResponse
- type GetStatusResponseObject
- type HandlerMiddlewareFunc
- type HttpRequestDoer
- type ImportAccount200JSONResponse
- type ImportAccount400JSONResponse
- type ImportAccount409JSONResponse
- type ImportAccount500JSONResponse
- type ImportAccountJSONRequestBody
- type ImportAccountRequestObject
- type ImportAccountResponse
- func (r ImportAccountResponse) ContentType() string
- func (r ImportAccountResponse) GetBody() []byte
- func (r ImportAccountResponse) GetJSON200() *Account
- func (r ImportAccountResponse) GetJSON400() *Error
- func (r ImportAccountResponse) GetJSON409() *Error
- func (r ImportAccountResponse) GetJSON500() *Error
- func (r ImportAccountResponse) Status() string
- func (r ImportAccountResponse) StatusCode() int
- type ImportAccountResponseObject
- type ImportRequest
- type InstallUpdate200JSONResponse
- type InstallUpdate409JSONResponse
- type InstallUpdate500JSONResponse
- type InstallUpdate502JSONResponse
- type InstallUpdateRequestObject
- type InstallUpdateResponse
- func (r InstallUpdateResponse) ContentType() string
- func (r InstallUpdateResponse) GetBody() []byte
- func (r InstallUpdateResponse) GetJSON200() *Release
- func (r InstallUpdateResponse) GetJSON409() *Error
- func (r InstallUpdateResponse) GetJSON500() *Error
- func (r InstallUpdateResponse) GetJSON502() *Error
- func (r InstallUpdateResponse) Status() string
- func (r InstallUpdateResponse) StatusCode() int
- type InstallUpdateResponseObject
- type LangRequest
- type Language
- type ListAccounts200JSONResponse
- type ListAccounts500JSONResponse
- type ListAccountsRequestObject
- type ListAccountsResponse
- type ListAccountsResponseObject
- type LoginCode
- type LoginLink
- type MiddlewareFunc
- type MigrateCancel204Response
- type MigrateCancel400JSONResponse
- type MigrateCancel409JSONResponse
- type MigrateCancel500JSONResponse
- type MigrateCancelJSONRequestBody
- type MigrateCancelRequestObject
- type MigrateCancelResponse
- func (r MigrateCancelResponse) ContentType() string
- func (r MigrateCancelResponse) GetBody() []byte
- func (r MigrateCancelResponse) GetJSON400() *Error
- func (r MigrateCancelResponse) GetJSON409() *Error
- func (r MigrateCancelResponse) GetJSON500() *Error
- func (r MigrateCancelResponse) Status() string
- func (r MigrateCancelResponse) StatusCode() int
- type MigrateCancelResponseObject
- type MigrateCommit204Response
- type MigrateCommit400JSONResponse
- type MigrateCommit409JSONResponse
- type MigrateCommit500JSONResponse
- type MigrateCommitJSONRequestBody
- type MigrateCommitRequestObject
- type MigrateCommitResponse
- func (r MigrateCommitResponse) ContentType() string
- func (r MigrateCommitResponse) GetBody() []byte
- func (r MigrateCommitResponse) GetJSON400() *Error
- func (r MigrateCommitResponse) GetJSON409() *Error
- func (r MigrateCommitResponse) GetJSON500() *Error
- func (r MigrateCommitResponse) Status() string
- func (r MigrateCommitResponse) StatusCode() int
- type MigrateCommitResponseObject
- type MigrateExport
- type MigrateExport200JSONResponse
- type MigrateExport400JSONResponse
- type MigrateExport404JSONResponse
- type MigrateExport409JSONResponse
- type MigrateExport500JSONResponse
- type MigrateExportJSONRequestBody
- type MigrateExportRequest
- type MigrateExportRequestObject
- type MigrateExportResponse
- func (r MigrateExportResponse) ContentType() string
- func (r MigrateExportResponse) GetBody() []byte
- func (r MigrateExportResponse) GetJSON200() *MigrateExport
- func (r MigrateExportResponse) GetJSON400() *Error
- func (r MigrateExportResponse) GetJSON404() *Error
- func (r MigrateExportResponse) GetJSON409() *Error
- func (r MigrateExportResponse) GetJSON500() *Error
- func (r MigrateExportResponse) Status() string
- func (r MigrateExportResponse) StatusCode() int
- type MigrateExportResponseObject
- type MigrateImport
- type MigrateImport200JSONResponse
- type MigrateImport400JSONResponse
- type MigrateImport409JSONResponse
- type MigrateImport500JSONResponse
- type MigrateImport502JSONResponse
- type MigrateImportJSONRequestBody
- type MigrateImportRequest
- type MigrateImportRequestObject
- type MigrateImportResponse
- func (r MigrateImportResponse) ContentType() string
- func (r MigrateImportResponse) GetBody() []byte
- func (r MigrateImportResponse) GetJSON200() *MigrateImport
- func (r MigrateImportResponse) GetJSON400() *Error
- func (r MigrateImportResponse) GetJSON409() *Error
- func (r MigrateImportResponse) GetJSON500() *Error
- func (r MigrateImportResponse) GetJSON502() *Error
- func (r MigrateImportResponse) Status() string
- func (r MigrateImportResponse) StatusCode() int
- type MigrateImportResponseObject
- type MigrateTokenRequest
- type ModelWindow
- type OpenWebSession200JSONResponse
- type OpenWebSession400JSONResponse
- type OpenWebSession403JSONResponse
- type OpenWebSession404JSONResponse
- type OpenWebSession500JSONResponse
- type OpenWebSessionJSONRequestBody
- type OpenWebSessionRequestObject
- type OpenWebSessionResponse
- func (r OpenWebSessionResponse) ContentType() string
- func (r OpenWebSessionResponse) GetBody() []byte
- func (r OpenWebSessionResponse) GetJSON200() *WebSession
- func (r OpenWebSessionResponse) GetJSON400() *Error
- func (r OpenWebSessionResponse) GetJSON403() *Error
- func (r OpenWebSessionResponse) GetJSON404() *Error
- func (r OpenWebSessionResponse) GetJSON500() *Error
- func (r OpenWebSessionResponse) Status() string
- func (r OpenWebSessionResponse) StatusCode() int
- type OpenWebSessionResponseObject
- type PatchAccount200JSONResponse
- type PatchAccount400JSONResponse
- type PatchAccount404JSONResponse
- type PatchAccount500JSONResponse
- type PatchAccountJSONRequestBody
- type PatchAccountRequestObject
- type PatchAccountResponse
- func (r PatchAccountResponse) ContentType() string
- func (r PatchAccountResponse) GetBody() []byte
- func (r PatchAccountResponse) GetJSON200() *Account
- func (r PatchAccountResponse) GetJSON400() *Error
- func (r PatchAccountResponse) GetJSON404() *Error
- func (r PatchAccountResponse) GetJSON500() *Error
- func (r PatchAccountResponse) Status() string
- func (r PatchAccountResponse) StatusCode() int
- type PatchAccountResponseObject
- type Refresh204Response
- type Refresh500JSONResponse
- type RefreshLogin200JSONResponse
- type RefreshLogin404JSONResponse
- type RefreshLogin409JSONResponse
- type RefreshLogin500JSONResponse
- type RefreshLogin502JSONResponse
- type RefreshLoginRequestObject
- type RefreshLoginResponse
- func (r RefreshLoginResponse) ContentType() string
- func (r RefreshLoginResponse) GetBody() []byte
- func (r RefreshLoginResponse) GetJSON200() *Account
- func (r RefreshLoginResponse) GetJSON404() *Error
- func (r RefreshLoginResponse) GetJSON409() *Error
- func (r RefreshLoginResponse) GetJSON500() *Error
- func (r RefreshLoginResponse) GetJSON502() *Error
- func (r RefreshLoginResponse) Status() string
- func (r RefreshLoginResponse) StatusCode() int
- type RefreshLoginResponseObject
- type RefreshRequestObject
- type RefreshResponse
- type RefreshResponseObject
- type Release
- type Remote
- type RemoteRequest
- type RemoveAccount204Response
- type RemoveAccount404JSONResponse
- type RemoveAccount409JSONResponse
- type RemoveAccount500JSONResponse
- type RemoveAccountRequestObject
- type RemoveAccountResponse
- func (r RemoveAccountResponse) ContentType() string
- func (r RemoveAccountResponse) GetBody() []byte
- func (r RemoveAccountResponse) GetJSON404() *Error
- func (r RemoveAccountResponse) GetJSON409() *Error
- func (r RemoveAccountResponse) GetJSON500() *Error
- func (r RemoveAccountResponse) Status() string
- func (r RemoveAccountResponse) StatusCode() int
- type RemoveAccountResponseObject
- type RequestEditorFn
- type ResetGrant
- type Resets
- type Restart
- type Restart200JSONResponse
- type Restart400JSONResponse
- type Restart409JSONResponse
- type Restart500JSONResponse
- type RestartJSONRequestBody
- type RestartRequest
- type RestartRequestObject
- type RestartResponse
- func (r RestartResponse) ContentType() string
- func (r RestartResponse) GetBody() []byte
- func (r RestartResponse) GetJSON200() *Restart
- func (r RestartResponse) GetJSON400() *Error
- func (r RestartResponse) GetJSON409() *Error
- func (r RestartResponse) GetJSON500() *Error
- func (r RestartResponse) Status() string
- func (r RestartResponse) StatusCode() int
- type RestartResponseObject
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) ActivateAccount(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) AdoptAccount(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) CancelLogin(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) CreateWebCode(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) FinishLogin(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) GetEvents(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) GetI18n(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) GetStatus(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) ImportAccount(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) InstallUpdate(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) ListAccounts(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) MigrateCancel(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) MigrateCommit(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) MigrateExport(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) MigrateImport(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) OpenWebSession(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) PatchAccount(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) Refresh(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) RefreshLogin(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) RemoveAccount(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) Restart(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) SetAuto(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) SetLang(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) SetRemote(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) SetStrategy(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) SetThresholds(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) Signal(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) StartLogin(c fiber.Ctx) error
- func (siw *ServerInterfaceWrapper) UseReset(c fiber.Ctx) error
- type SetAuto204Response
- type SetAuto400JSONResponse
- type SetAuto500JSONResponse
- type SetAutoJSONRequestBody
- type SetAutoRequestObject
- type SetAutoResponse
- type SetAutoResponseObject
- type SetLang204Response
- type SetLang400JSONResponse
- type SetLang500JSONResponse
- type SetLangJSONRequestBody
- type SetLangRequestObject
- type SetLangResponse
- type SetLangResponseObject
- type SetRemote204Response
- type SetRemote400JSONResponse
- type SetRemote500JSONResponse
- type SetRemoteJSONRequestBody
- type SetRemoteRequestObject
- type SetRemoteResponse
- type SetRemoteResponseObject
- type SetStrategy204Response
- type SetStrategy400JSONResponse
- type SetStrategy500JSONResponse
- type SetStrategyJSONRequestBody
- type SetStrategyRequestObject
- type SetStrategyResponse
- type SetStrategyResponseObject
- type SetThresholds200JSONResponse
- type SetThresholds400JSONResponse
- type SetThresholds500JSONResponse
- type SetThresholdsJSONRequestBody
- type SetThresholdsRequestObject
- type SetThresholdsResponse
- func (r SetThresholdsResponse) ContentType() string
- func (r SetThresholdsResponse) GetBody() []byte
- func (r SetThresholdsResponse) GetJSON200() *Thresholds
- func (r SetThresholdsResponse) GetJSON400() *Error
- func (r SetThresholdsResponse) GetJSON500() *Error
- func (r SetThresholdsResponse) Status() string
- func (r SetThresholdsResponse) StatusCode() int
- type SetThresholdsResponseObject
- type Shift
- type Signal204Response
- type Signal400JSONResponse
- type Signal500JSONResponse
- type SignalJSONRequestBody
- type SignalRequest
- type SignalRequestObject
- type SignalResponse
- type SignalResponseObject
- type Snapshot
- type StartLogin200JSONResponse
- type StartLogin404JSONResponse
- type StartLogin409JSONResponse
- type StartLogin429JSONResponse
- type StartLogin500JSONResponse
- type StartLogin502JSONResponse
- type StartLoginRequestObject
- type StartLoginResponse
- func (r StartLoginResponse) ContentType() string
- func (r StartLoginResponse) GetBody() []byte
- func (r StartLoginResponse) GetJSON200() *LoginLink
- func (r StartLoginResponse) GetJSON404() *Error
- func (r StartLoginResponse) GetJSON409() *Error
- func (r StartLoginResponse) GetJSON429() *Error
- func (r StartLoginResponse) GetJSON500() *Error
- func (r StartLoginResponse) GetJSON502() *Error
- func (r StartLoginResponse) Status() string
- func (r StartLoginResponse) StatusCode() int
- type StartLoginResponseObject
- type Status
- type Strategy
- type StrategyRequest
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type Thresholds
- type UseReset200JSONResponse
- type UseReset404JSONResponse
- type UseReset409JSONResponse
- type UseReset500JSONResponse
- type UseReset502JSONResponse
- type UseResetJSONRequestBody
- type UseResetRequest
- type UseResetRequestObject
- type UseResetResponse
- func (r UseResetResponse) ContentType() string
- func (r UseResetResponse) GetBody() []byte
- func (r UseResetResponse) GetJSON200() *Account
- func (r UseResetResponse) GetJSON404() *Error
- func (r UseResetResponse) GetJSON409() *Error
- func (r UseResetResponse) GetJSON500() *Error
- func (r UseResetResponse) GetJSON502() *Error
- func (r UseResetResponse) Status() string
- func (r UseResetResponse) StatusCode() int
- type UseResetResponseObject
- type WebCode
- type WebSession
- type WebSessionRequest
- type Window
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetSpec ¶
GetSpec returns the OpenAPI specification corresponding to the generated code in this file. External references in the spec are resolved through PathToRawSpec; externally-referenced files must be embedded in their corresponding Go packages (via the import-mapping feature). URL-based external refs are not supported.
func GetSpecJSON ¶
GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI specification: decompressed but not unmarshaled. External references are not resolved here; the bytes are the spec exactly as embedded by codegen. The result is cached at package init time, so repeated calls are cheap.
func GetSwagger
deprecated
func NewActivateAccountRequest ¶
func NewActivateAccountRequest(server string, name string, params *ActivateAccountParams) (*http.Request, error)
NewActivateAccountRequest constructs an http.Request for the ActivateAccount method
func NewAdoptAccountRequest ¶
func NewAdoptAccountRequest(server string, body AdoptAccountJSONRequestBody) (*http.Request, error)
NewAdoptAccountRequest calls the generic AdoptAccount builder with application/json body
func NewAdoptAccountRequestWithBody ¶
func NewAdoptAccountRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewAdoptAccountRequestWithBody constructs an http.Request for the AdoptAccount method, with any body, and a specified content type
func NewCancelLoginRequest ¶ added in v0.2.0
func NewCancelLoginRequest(server string, name string, params *CancelLoginParams) (*http.Request, error)
NewCancelLoginRequest constructs an http.Request for the CancelLogin method
func NewCreateWebCodeRequest ¶
NewCreateWebCodeRequest constructs an http.Request for the CreateWebCode method
func NewFinishLoginRequest ¶ added in v0.2.0
func NewFinishLoginRequest(server string, name string, body FinishLoginJSONRequestBody) (*http.Request, error)
NewFinishLoginRequest calls the generic FinishLogin builder with application/json body
func NewFinishLoginRequestWithBody ¶ added in v0.2.0
func NewFinishLoginRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
NewFinishLoginRequestWithBody constructs an http.Request for the FinishLogin method, with any body, and a specified content type
func NewGetEventsRequest ¶
NewGetEventsRequest constructs an http.Request for the GetEvents method
func NewGetI18nRequest ¶
NewGetI18nRequest constructs an http.Request for the GetI18n method
func NewGetStatusRequest ¶
NewGetStatusRequest constructs an http.Request for the GetStatus method
func NewImportAccountRequest ¶
func NewImportAccountRequest(server string, body ImportAccountJSONRequestBody) (*http.Request, error)
NewImportAccountRequest calls the generic ImportAccount builder with application/json body
func NewImportAccountRequestWithBody ¶
func NewImportAccountRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewImportAccountRequestWithBody constructs an http.Request for the ImportAccount method, with any body, and a specified content type
func NewInstallUpdateRequest ¶ added in v0.2.0
NewInstallUpdateRequest constructs an http.Request for the InstallUpdate method
func NewListAccountsRequest ¶
NewListAccountsRequest constructs an http.Request for the ListAccounts method
func NewMigrateCancelRequest ¶
func NewMigrateCancelRequest(server string, body MigrateCancelJSONRequestBody) (*http.Request, error)
NewMigrateCancelRequest calls the generic MigrateCancel builder with application/json body
func NewMigrateCancelRequestWithBody ¶
func NewMigrateCancelRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewMigrateCancelRequestWithBody constructs an http.Request for the MigrateCancel method, with any body, and a specified content type
func NewMigrateCommitRequest ¶
func NewMigrateCommitRequest(server string, body MigrateCommitJSONRequestBody) (*http.Request, error)
NewMigrateCommitRequest calls the generic MigrateCommit builder with application/json body
func NewMigrateCommitRequestWithBody ¶
func NewMigrateCommitRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewMigrateCommitRequestWithBody constructs an http.Request for the MigrateCommit method, with any body, and a specified content type
func NewMigrateExportRequest ¶
func NewMigrateExportRequest(server string, body MigrateExportJSONRequestBody) (*http.Request, error)
NewMigrateExportRequest calls the generic MigrateExport builder with application/json body
func NewMigrateExportRequestWithBody ¶
func NewMigrateExportRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewMigrateExportRequestWithBody constructs an http.Request for the MigrateExport method, with any body, and a specified content type
func NewMigrateImportRequest ¶
func NewMigrateImportRequest(server string, body MigrateImportJSONRequestBody) (*http.Request, error)
NewMigrateImportRequest calls the generic MigrateImport builder with application/json body
func NewMigrateImportRequestWithBody ¶
func NewMigrateImportRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewMigrateImportRequestWithBody constructs an http.Request for the MigrateImport method, with any body, and a specified content type
func NewOpenWebSessionRequest ¶
func NewOpenWebSessionRequest(server string, body OpenWebSessionJSONRequestBody) (*http.Request, error)
NewOpenWebSessionRequest calls the generic OpenWebSession builder with application/json body
func NewOpenWebSessionRequestWithBody ¶
func NewOpenWebSessionRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewOpenWebSessionRequestWithBody constructs an http.Request for the OpenWebSession method, with any body, and a specified content type
func NewPatchAccountRequest ¶
func NewPatchAccountRequest(server string, name string, body PatchAccountJSONRequestBody) (*http.Request, error)
NewPatchAccountRequest calls the generic PatchAccount builder with application/json body
func NewPatchAccountRequestWithBody ¶
func NewPatchAccountRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
NewPatchAccountRequestWithBody constructs an http.Request for the PatchAccount method, with any body, and a specified content type
func NewRefreshLoginRequest ¶ added in v0.2.0
NewRefreshLoginRequest constructs an http.Request for the RefreshLogin method
func NewRefreshRequest ¶
NewRefreshRequest constructs an http.Request for the Refresh method
func NewRemoveAccountRequest ¶
NewRemoveAccountRequest constructs an http.Request for the RemoveAccount method
func NewRestartRequest ¶ added in v0.2.0
func NewRestartRequest(server string, body RestartJSONRequestBody) (*http.Request, error)
NewRestartRequest calls the generic Restart builder with application/json body
func NewRestartRequestWithBody ¶ added in v0.2.0
func NewRestartRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewRestartRequestWithBody constructs an http.Request for the Restart method, with any body, and a specified content type
func NewSetAutoRequest ¶
func NewSetAutoRequest(server string, body SetAutoJSONRequestBody) (*http.Request, error)
NewSetAutoRequest calls the generic SetAuto builder with application/json body
func NewSetAutoRequestWithBody ¶
func NewSetAutoRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSetAutoRequestWithBody constructs an http.Request for the SetAuto method, with any body, and a specified content type
func NewSetLangRequest ¶
func NewSetLangRequest(server string, body SetLangJSONRequestBody) (*http.Request, error)
NewSetLangRequest calls the generic SetLang builder with application/json body
func NewSetLangRequestWithBody ¶
func NewSetLangRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSetLangRequestWithBody constructs an http.Request for the SetLang method, with any body, and a specified content type
func NewSetRemoteRequest ¶
func NewSetRemoteRequest(server string, body SetRemoteJSONRequestBody) (*http.Request, error)
NewSetRemoteRequest calls the generic SetRemote builder with application/json body
func NewSetRemoteRequestWithBody ¶
func NewSetRemoteRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSetRemoteRequestWithBody constructs an http.Request for the SetRemote method, with any body, and a specified content type
func NewSetStrategyRequest ¶
func NewSetStrategyRequest(server string, body SetStrategyJSONRequestBody) (*http.Request, error)
NewSetStrategyRequest calls the generic SetStrategy builder with application/json body
func NewSetStrategyRequestWithBody ¶
func NewSetStrategyRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSetStrategyRequestWithBody constructs an http.Request for the SetStrategy method, with any body, and a specified content type
func NewSetThresholdsRequest ¶
func NewSetThresholdsRequest(server string, body SetThresholdsJSONRequestBody) (*http.Request, error)
NewSetThresholdsRequest calls the generic SetThresholds builder with application/json body
func NewSetThresholdsRequestWithBody ¶
func NewSetThresholdsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSetThresholdsRequestWithBody constructs an http.Request for the SetThresholds method, with any body, and a specified content type
func NewSignalRequest ¶
func NewSignalRequest(server string, body SignalJSONRequestBody) (*http.Request, error)
NewSignalRequest calls the generic Signal builder with application/json body
func NewSignalRequestWithBody ¶
func NewSignalRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSignalRequestWithBody constructs an http.Request for the Signal method, with any body, and a specified content type
func NewStartLoginRequest ¶ added in v0.2.0
NewStartLoginRequest constructs an http.Request for the StartLogin method
func NewUseResetRequest ¶ added in v0.5.0
func NewUseResetRequest(server string, name string, body UseResetJSONRequestBody) (*http.Request, error)
NewUseResetRequest calls the generic UseReset builder with application/json body
func NewUseResetRequestWithBody ¶ added in v0.5.0
func NewUseResetRequestWithBody(server string, name string, contentType string, body io.Reader) (*http.Request, error)
NewUseResetRequestWithBody constructs an http.Request for the UseReset method, with any body, and a specified content type
func PathToRawSpec ¶
Constructs a synthetic filesystem for resolving external references when loading openapi specifications.
func RegisterHandlers ¶
func RegisterHandlers(router fiber.Router, si ServerInterface)
RegisterHandlers creates http.Handler with routing matching OpenAPI spec.
func RegisterHandlersWithOptions ¶
func RegisterHandlersWithOptions(router fiber.Router, si ServerInterface, options FiberServerOptions)
RegisterHandlersWithOptions creates http.Handler with additional options
Types ¶
type Account ¶
type Account struct {
Active bool `json:"active"`
CheckedAt *time.Time `json:"checked_at,omitempty"`
Email string `json:"email"`
Enabled bool `json:"enabled"`
Error *string `json:"error,omitempty"`
Exhausted bool `json:"exhausted"`
ExhaustedReason *string `json:"exhausted_reason,omitempty"`
FiveHour *Window `json:"five_hour,omitempty"`
// FreeAt Exhausted accounts only: when auto-switch counts the account free again, the latest reset of the windows at their thresholds or the end of a limit hit, whichever is later; absent when a blocking window's reset is unknown
FreeAt *time.Time `json:"free_at,omitempty"`
// LeavesAt Account in use only: when it reaches the five-hour, weekly or a per-model weekly threshold at its pace in use over the last hour, whichever comes first; absent when the pace is unknown or flat, or the window resets first
LeavesAt *time.Time `json:"leaves_at,omitempty"`
// LoginEnding The login ends within 72 hours or has ended, and wants a new login: the daemon then announces it, and clients flag it
LoginEnding bool `json:"login_ending"`
// LoginExpiresAt When the login itself ends, as Anthropic said at its last refresh: a refresh does not move it, a new login does. Absent when unknown or while it needs a login.
LoginExpiresAt *time.Time `json:"login_expires_at,omitempty"`
Models []ModelWindow `json:"models"`
Name string `json:"name"`
NeedsLogin bool `json:"needs_login"`
// NoFiveHourLimit Anthropic's last answer has a weekly window and a null five-hour one: this plan has no such limit, as a verified Ultra has none. False before the first answer, or with a five_hour missing or unreadable, which say nothing of the plan
NoFiveHourLimit bool `json:"no_five_hour_limit"`
Priority int `json:"priority"`
// Resets The account's reset credits, which /v1/accounts/{name}/reset spends: grants of limit resets Anthropic gave it, such as one at a model launch. Absent when it has none usable now, while it needs a login, and before Anthropic said; Anthropic says only to a recent Claude Code, whose version the daemon sends.
Resets *Resets `json:"resets,omitempty"`
SevenDay *Window `json:"seven_day,omitempty"`
// TokenExpiresAt When the login's access token runs out: for the account in Claude Code, the token Claude Code holds and refreshes; for the others, ccswap's copy, which the daemon refreshes 10 minutes before. Absent while it needs a login or the daemon has not read it yet.
TokenExpiresAt *time.Time `json:"token_expires_at,omitempty"`
// WeeklyThreshold The account's own weekly threshold, in place of thresholds.seven_day: auto-switch leaves it at this % of its weekly and per-model weekly windows, and past it never waits on it when every account is at its limit, so the room above stays its owner's. Absent when it follows thresholds.seven_day.
WeeklyThreshold *float64 `json:"weekly_threshold,omitempty"`
}
Account defines model for Account.
type AccountPatch ¶
type AccountPatch struct {
Enabled *bool `json:"enabled,omitempty"`
Priority *int `json:"priority,omitempty"`
// WeeklyThreshold The account's own weekly threshold, above thresholds.hysteresis and at most 100 (else 400 invalid_thresholds); 0 follows thresholds.seven_day again
WeeklyThreshold *float64 `json:"weekly_threshold,omitempty"`
}
AccountPatch defines model for AccountPatch.
type ActivateAccount200JSONResponse ¶
type ActivateAccount200JSONResponse Status
func (ActivateAccount200JSONResponse) VisitActivateAccountResponse ¶
func (response ActivateAccount200JSONResponse) VisitActivateAccountResponse(ctx fiber.Ctx) error
type ActivateAccount400JSONResponse ¶
type ActivateAccount400JSONResponse struct{ ErrorJSONResponse }
func (ActivateAccount400JSONResponse) VisitActivateAccountResponse ¶
func (response ActivateAccount400JSONResponse) VisitActivateAccountResponse(ctx fiber.Ctx) error
type ActivateAccount404JSONResponse ¶
type ActivateAccount404JSONResponse Error
func (ActivateAccount404JSONResponse) VisitActivateAccountResponse ¶
func (response ActivateAccount404JSONResponse) VisitActivateAccountResponse(ctx fiber.Ctx) error
type ActivateAccount409JSONResponse ¶
type ActivateAccount409JSONResponse Error
func (ActivateAccount409JSONResponse) VisitActivateAccountResponse ¶
func (response ActivateAccount409JSONResponse) VisitActivateAccountResponse(ctx fiber.Ctx) error
type ActivateAccount500JSONResponse ¶
type ActivateAccount500JSONResponse Error
func (ActivateAccount500JSONResponse) VisitActivateAccountResponse ¶
func (response ActivateAccount500JSONResponse) VisitActivateAccountResponse(ctx fiber.Ctx) error
type ActivateAccountParams ¶
type ActivateAccountParams struct {
Force *bool `form:"force,omitempty" json:"force,omitempty"`
}
ActivateAccountParams defines parameters for ActivateAccount.
type ActivateAccountRequestObject ¶
type ActivateAccountRequestObject struct {
Name string `json:"name"`
Params ActivateAccountParams
}
type ActivateAccountResponse ¶
type ActivateAccountResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Status
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseActivateAccountResponse ¶
func ParseActivateAccountResponse(rsp *http.Response) (*ActivateAccountResponse, error)
ParseActivateAccountResponse parses an HTTP response from a ActivateAccountWithResponse call
func (ActivateAccountResponse) ContentType ¶
func (r ActivateAccountResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ActivateAccountResponse) GetBody ¶
func (r ActivateAccountResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ActivateAccountResponse) GetJSON200 ¶
func (r ActivateAccountResponse) GetJSON200() *Status
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (ActivateAccountResponse) GetJSON400 ¶
func (r ActivateAccountResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (ActivateAccountResponse) GetJSON404 ¶
func (r ActivateAccountResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (ActivateAccountResponse) GetJSON409 ¶
func (r ActivateAccountResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (ActivateAccountResponse) GetJSON500 ¶
func (r ActivateAccountResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (ActivateAccountResponse) Status ¶
func (r ActivateAccountResponse) Status() string
Status returns HTTPResponse.Status
func (ActivateAccountResponse) StatusCode ¶
func (r ActivateAccountResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type AdoptAccount200JSONResponse ¶
type AdoptAccount200JSONResponse Account
func (AdoptAccount200JSONResponse) VisitAdoptAccountResponse ¶
func (response AdoptAccount200JSONResponse) VisitAdoptAccountResponse(ctx fiber.Ctx) error
type AdoptAccount400JSONResponse ¶
type AdoptAccount400JSONResponse struct{ ErrorJSONResponse }
func (AdoptAccount400JSONResponse) VisitAdoptAccountResponse ¶
func (response AdoptAccount400JSONResponse) VisitAdoptAccountResponse(ctx fiber.Ctx) error
type AdoptAccount404JSONResponse ¶
type AdoptAccount404JSONResponse Error
func (AdoptAccount404JSONResponse) VisitAdoptAccountResponse ¶
func (response AdoptAccount404JSONResponse) VisitAdoptAccountResponse(ctx fiber.Ctx) error
type AdoptAccount409JSONResponse ¶
type AdoptAccount409JSONResponse Error
func (AdoptAccount409JSONResponse) VisitAdoptAccountResponse ¶
func (response AdoptAccount409JSONResponse) VisitAdoptAccountResponse(ctx fiber.Ctx) error
type AdoptAccount500JSONResponse ¶
type AdoptAccount500JSONResponse Error
func (AdoptAccount500JSONResponse) VisitAdoptAccountResponse ¶
func (response AdoptAccount500JSONResponse) VisitAdoptAccountResponse(ctx fiber.Ctx) error
type AdoptAccountJSONRequestBody ¶
type AdoptAccountJSONRequestBody = AdoptRequest
AdoptAccountJSONRequestBody defines body for AdoptAccount for application/json ContentType.
type AdoptAccountRequestObject ¶
type AdoptAccountRequestObject struct {
Body *AdoptAccountJSONRequestBody
}
type AdoptAccountResponse ¶
type AdoptAccountResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Account
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseAdoptAccountResponse ¶
func ParseAdoptAccountResponse(rsp *http.Response) (*AdoptAccountResponse, error)
ParseAdoptAccountResponse parses an HTTP response from a AdoptAccountWithResponse call
func (AdoptAccountResponse) ContentType ¶
func (r AdoptAccountResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (AdoptAccountResponse) GetBody ¶
func (r AdoptAccountResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (AdoptAccountResponse) GetJSON200 ¶
func (r AdoptAccountResponse) GetJSON200() *Account
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (AdoptAccountResponse) GetJSON400 ¶
func (r AdoptAccountResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (AdoptAccountResponse) GetJSON404 ¶
func (r AdoptAccountResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (AdoptAccountResponse) GetJSON409 ¶
func (r AdoptAccountResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (AdoptAccountResponse) GetJSON500 ¶
func (r AdoptAccountResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (AdoptAccountResponse) Status ¶
func (r AdoptAccountResponse) Status() string
Status returns HTTPResponse.Status
func (AdoptAccountResponse) StatusCode ¶
func (r AdoptAccountResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type AdoptRequest ¶
AdoptRequest defines model for AdoptRequest.
type AutoRequest ¶
type AutoRequest struct {
Enabled bool `json:"enabled"`
}
AutoRequest defines model for AutoRequest.
type CancelLogin204Response ¶ added in v0.2.0
type CancelLogin204Response struct {
}
func (CancelLogin204Response) VisitCancelLoginResponse ¶ added in v0.2.0
func (response CancelLogin204Response) VisitCancelLoginResponse(ctx fiber.Ctx) error
type CancelLogin500JSONResponse ¶ added in v0.2.0
type CancelLogin500JSONResponse struct{ ErrorJSONResponse }
func (CancelLogin500JSONResponse) VisitCancelLoginResponse ¶ added in v0.2.0
func (response CancelLogin500JSONResponse) VisitCancelLoginResponse(ctx fiber.Ctx) error
type CancelLoginParams ¶ added in v0.2.0
type CancelLoginParams struct {
// Id The id the link came with
Id string `form:"id" json:"id"`
}
CancelLoginParams defines parameters for CancelLogin.
type CancelLoginRequestObject ¶ added in v0.2.0
type CancelLoginRequestObject struct {
Name string `json:"name"`
Params CancelLoginParams
}
type CancelLoginResponse ¶ added in v0.2.0
type CancelLoginResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseCancelLoginResponse ¶ added in v0.2.0
func ParseCancelLoginResponse(rsp *http.Response) (*CancelLoginResponse, error)
ParseCancelLoginResponse parses an HTTP response from a CancelLoginWithResponse call
func (CancelLoginResponse) ContentType ¶ added in v0.2.0
func (r CancelLoginResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (CancelLoginResponse) GetBody ¶ added in v0.2.0
func (r CancelLoginResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (CancelLoginResponse) GetJSON500 ¶ added in v0.2.0
func (r CancelLoginResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (CancelLoginResponse) Status ¶ added in v0.2.0
func (r CancelLoginResponse) Status() string
Status returns HTTPResponse.Status
func (CancelLoginResponse) StatusCode ¶ added in v0.2.0
func (r CancelLoginResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CancelLoginResponseObject ¶ added in v0.2.0
type Catalog ¶
type Catalog struct {
Lang string `json:"lang"`
// Languages Every language ccswap has
Languages []Language `json:"languages"`
// Messages Text by key: a string with {0} {1} … placeholders, **bold** and `code` marks, or a plural message as its CLDR forms ({"one": …, "other": …}), picked by argument 0
Messages map[string]interface{} `json:"messages"`
// Name The language's name in itself
Name string `json:"name"`
}
Catalog defines model for Catalog.
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) ActivateAccount ¶
func (c *Client) ActivateAccount(ctx context.Context, name string, params *ActivateAccountParams, reqEditors ...RequestEditorFn) (*http.Response, error)
ActivateAccount performs a POST /v1/accounts/{name}/activate (the `ActivateAccount` operationId) request.
func (*Client) AdoptAccount ¶
func (c *Client) AdoptAccount(ctx context.Context, body AdoptAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
AdoptAccount performs a POST /v1/accounts/adopt (the `AdoptAccount` operationId) request. Takes a body of the `application/json` content type.
Register the login currently in Claude Code as an account.
func (*Client) AdoptAccountWithBody ¶
func (c *Client) AdoptAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
AdoptAccountWithBody performs a POST /v1/accounts/adopt (the `AdoptAccount` operationId) request, with any type of body and a specified content type.
Register the login currently in Claude Code as an account.
func (*Client) CancelLogin ¶ added in v0.2.0
func (c *Client) CancelLogin(ctx context.Context, name string, params *CancelLoginParams, reqEditors ...RequestEditorFn) (*http.Response, error)
CancelLogin performs a DELETE /v1/accounts/{name}/login (the `CancelLogin` operationId) request.
Drop the account's sign-in link of this id and stop its claude auth login, if there is one.
func (*Client) CreateWebCode ¶
func (c *Client) CreateWebCode(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateWebCode performs a POST /v1/web/code (the `CreateWebCode` operationId) request.
A one-time code (single use, valid a minute) that the web page trades for the admin key at /v1/web/session. Unix socket only.
func (*Client) FinishLogin ¶ added in v0.2.0
func (c *Client) FinishLogin(ctx context.Context, name string, body FinishLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
FinishLogin performs a POST /v1/accounts/{name}/login/code (the `FinishLogin` operationId) request. Takes a body of the `application/json` content type.
Hand claude auth login of the link with this id the code its sign-in showed (CODE#STATE, or the callback URL) and store the login it gets as the account's. A link takes one code: after any answer but a bad request it is gone, and a new login starts with /v1/accounts/{name}/login again. The login must be the account's own email (wrong_account), and the account must still be here (not_found): this never adds an account.
func (*Client) FinishLoginWithBody ¶ added in v0.2.0
func (c *Client) FinishLoginWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
FinishLoginWithBody performs a POST /v1/accounts/{name}/login/code (the `FinishLogin` operationId) request, with any type of body and a specified content type.
Hand claude auth login of the link with this id the code its sign-in showed (CODE#STATE, or the callback URL) and store the login it gets as the account's. A link takes one code: after any answer but a bad request it is gone, and a new login starts with /v1/accounts/{name}/login again. The login must be the account's own email (wrong_account), and the account must still be here (not_found): this never adds an account.
func (*Client) GetEvents ¶
func (c *Client) GetEvents(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
GetEvents performs a GET /v1/events (the `GetEvents` operationId) request.
Server-sent events: a "state" event whose data is a Snapshot at once and on every change, and a ": ping" comment every 15 s in between.
func (*Client) GetI18n ¶
func (c *Client) GetI18n(ctx context.Context, lang string, params *GetI18nParams, reqEditors ...RequestEditorFn) (*http.Response, error)
GetI18n performs a GET /v1/i18n/{lang} (the `GetI18n` operationId) request.
The web page's texts in the language of the tag, else of the tag without its last subtags (pt-BR, then pt); English where that language has none. No key on the TCP listener either: the login screen needs them first, and they hold no secret.
func (*Client) GetStatus ¶
func (c *Client) GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
GetStatus performs a GET /v1/status (the `GetStatus` operationId) request.
func (*Client) ImportAccount ¶
func (c *Client) ImportAccount(ctx context.Context, body ImportAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
ImportAccount performs a POST /v1/accounts (the `ImportAccount` operationId) request. Takes a body of the `application/json` content type.
Store the login made in a temporary Claude Code config dir as an account (or re-login an existing one).
func (*Client) ImportAccountWithBody ¶
func (c *Client) ImportAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
ImportAccountWithBody performs a POST /v1/accounts (the `ImportAccount` operationId) request, with any type of body and a specified content type.
Store the login made in a temporary Claude Code config dir as an account (or re-login an existing one).
func (*Client) InstallUpdate ¶ added in v0.2.0
func (c *Client) InstallUpdate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
InstallUpdate performs a POST /v1/update (the `InstallUpdate` operationId) request.
Install the newest release over the binary this daemon runs, then restart the daemon on it: the archive must match the release's checksums.txt and the new binary must run and report the release's version before it replaces the old one. The answer comes once the new binary is in place, and the daemon restarts right after.
func (*Client) ListAccounts ¶
func (c *Client) ListAccounts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
ListAccounts performs a GET /v1/accounts (the `ListAccounts` operationId) request.
func (*Client) MigrateCancel ¶
func (c *Client) MigrateCancel(ctx context.Context, body MigrateCancelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
MigrateCancel performs a POST /v1/migrate/cancel (the `MigrateCancel` operationId) request. Takes a body of the `application/json` content type.
Drop an export that is not committed; its accounts stay here and thaw. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
func (*Client) MigrateCancelWithBody ¶
func (c *Client) MigrateCancelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
MigrateCancelWithBody performs a POST /v1/migrate/cancel (the `MigrateCancel` operationId) request, with any type of body and a specified content type.
Drop an export that is not committed; its accounts stay here and thaw. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
func (*Client) MigrateCommit ¶
func (c *Client) MigrateCommit(ctx context.Context, body MigrateCommitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
MigrateCommit performs a POST /v1/migrate/commit (the `MigrateCommit` operationId) request. Takes a body of the `application/json` content type.
Remove the accounts of an export here, once their logins are checked unchanged since packing; a second commit of the same export answers 204 again. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
func (*Client) MigrateCommitWithBody ¶
func (c *Client) MigrateCommitWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
MigrateCommitWithBody performs a POST /v1/migrate/commit (the `MigrateCommit` operationId) request, with any type of body and a specified content type.
Remove the accounts of an export here, once their logins are checked unchanged since packing; a second commit of the same export answers 204 again. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
func (*Client) MigrateExport ¶
func (c *Client) MigrateExport(ctx context.Context, body MigrateExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
MigrateExport performs a POST /v1/migrate/export (the `MigrateExport` operationId) request. Takes a body of the `application/json` content type.
Pack accounts into an encrypted bundle to move them to another machine, and freeze them (no refresh, no switch to them) until /v1/migrate/commit removes them here or /v1/migrate/cancel, a daemon restart or 5 minutes lift the freeze. The code that opens the bundle is in this answer only. Unix socket only.
func (*Client) MigrateExportWithBody ¶
func (c *Client) MigrateExportWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
MigrateExportWithBody performs a POST /v1/migrate/export (the `MigrateExport` operationId) request, with any type of body and a specified content type.
Pack accounts into an encrypted bundle to move them to another machine, and freeze them (no refresh, no switch to them) until /v1/migrate/commit removes them here or /v1/migrate/cancel, a daemon restart or 5 minutes lift the freeze. The code that opens the bundle is in this answer only. Unix socket only.
func (*Client) MigrateImport ¶
func (c *Client) MigrateImport(ctx context.Context, body MigrateImportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
MigrateImport performs a POST /v1/migrate/import (the `MigrateImport` operationId) request. Takes a body of the `application/json` content type.
Add the accounts of a bundle from /v1/migrate/export, all or none, and refresh each login at once, which spends the bundle's refresh token: the answer waits on Anthropic and shows the refresh in each account's needs_login and error. With replace, the bundle's login of an account that replaces one here is refreshed first, before anything is written, and only a refreshed login replaces one: bundle_spent and bundle_unchecked refuse the import. A refresh that would keep the answer past about 30 seconds is left to the daemon's next tick. Unix socket only.
func (*Client) MigrateImportWithBody ¶
func (c *Client) MigrateImportWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
MigrateImportWithBody performs a POST /v1/migrate/import (the `MigrateImport` operationId) request, with any type of body and a specified content type.
Add the accounts of a bundle from /v1/migrate/export, all or none, and refresh each login at once, which spends the bundle's refresh token: the answer waits on Anthropic and shows the refresh in each account's needs_login and error. With replace, the bundle's login of an account that replaces one here is refreshed first, before anything is written, and only a refreshed login replaces one: bundle_spent and bundle_unchecked refuse the import. A refresh that would keep the answer past about 30 seconds is left to the daemon's next tick. Unix socket only.
func (*Client) OpenWebSession ¶
func (c *Client) OpenWebSession(ctx context.Context, body OpenWebSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
OpenWebSession performs a POST /v1/web/session (the `OpenWebSession` operationId) request. Takes a body of the `application/json` content type.
Trade a code from /v1/web/code for the admin key the TCP listener holds. TCP listener only: it takes the code without a key, on a loopback address only; the unix socket answers 404.
func (*Client) OpenWebSessionWithBody ¶
func (c *Client) OpenWebSessionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
OpenWebSessionWithBody performs a POST /v1/web/session (the `OpenWebSession` operationId) request, with any type of body and a specified content type.
Trade a code from /v1/web/code for the admin key the TCP listener holds. TCP listener only: it takes the code without a key, on a loopback address only; the unix socket answers 404.
func (*Client) PatchAccount ¶
func (c *Client) PatchAccount(ctx context.Context, name string, body PatchAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchAccount performs a PATCH /v1/accounts/{name} (the `PatchAccount` operationId) request. Takes a body of the `application/json` content type.
func (*Client) PatchAccountWithBody ¶
func (c *Client) PatchAccountWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PatchAccountWithBody performs a PATCH /v1/accounts/{name} (the `PatchAccount` operationId) request, with any type of body and a specified content type.
func (*Client) Refresh ¶
func (c *Client) Refresh(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
Refresh performs a POST /v1/refresh (the `Refresh` operationId) request.
func (*Client) RefreshLogin ¶ added in v0.2.0
func (c *Client) RefreshLogin(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
RefreshLogin performs a POST /v1/accounts/{name}/refresh (the `RefreshLogin` operationId) request.
Refresh the account's login now, as the daemon does 10 minutes before its access token runs out: a new access token, which also proves the login still works. It does not move login_expires_at. Never the login Claude Code uses (claude_owns), which Claude Code refreshes itself. An account refreshed under a minute ago is not asked again.
func (*Client) RemoveAccount ¶
func (c *Client) RemoveAccount(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
RemoveAccount performs a DELETE /v1/accounts/{name} (the `RemoveAccount` operationId) request.
func (*Client) Restart ¶ added in v0.2.0
func (c *Client) Restart(ctx context.Context, body RestartJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
Restart performs a POST /v1/restart (the `Restart` operationId) request. Takes a body of the `application/json` content type.
Restart the daemon on its binary as /v1/update does, when that binary is the one named: ccswap update asks this after it installed a release over itself. A daemon that runs another binary carries on. The answer comes before the daemon stops. Unix socket only.
func (*Client) RestartWithBody ¶ added in v0.2.0
func (c *Client) RestartWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
RestartWithBody performs a POST /v1/restart (the `Restart` operationId) request, with any type of body and a specified content type.
Restart the daemon on its binary as /v1/update does, when that binary is the one named: ccswap update asks this after it installed a release over itself. A daemon that runs another binary carries on. The answer comes before the daemon stops. Unix socket only.
func (*Client) SetAuto ¶
func (c *Client) SetAuto(ctx context.Context, body SetAutoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
SetAuto performs a PUT /v1/auto (the `SetAuto` operationId) request. Takes a body of the `application/json` content type.
func (*Client) SetAutoWithBody ¶
func (c *Client) SetAutoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SetAutoWithBody performs a PUT /v1/auto (the `SetAuto` operationId) request, with any type of body and a specified content type.
func (*Client) SetLang ¶
func (c *Client) SetLang(ctx context.Context, body SetLangJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
SetLang performs a PUT /v1/lang (the `SetLang` operationId) request. Takes a body of the `application/json` content type.
func (*Client) SetLangWithBody ¶
func (c *Client) SetLangWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SetLangWithBody performs a PUT /v1/lang (the `SetLang` operationId) request, with any type of body and a specified content type.
func (*Client) SetRemote ¶
func (c *Client) SetRemote(ctx context.Context, body SetRemoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
SetRemote performs a PUT /v1/remote (the `SetRemote` operationId) request. Takes a body of the `application/json` content type.
Take usage from another ccswap (url and its key) instead of asking Anthropic; an empty url turns it off. Unix socket only.
func (*Client) SetRemoteWithBody ¶
func (c *Client) SetRemoteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SetRemoteWithBody performs a PUT /v1/remote (the `SetRemote` operationId) request, with any type of body and a specified content type.
Take usage from another ccswap (url and its key) instead of asking Anthropic; an empty url turns it off. Unix socket only.
func (*Client) SetStrategy ¶
func (c *Client) SetStrategy(ctx context.Context, body SetStrategyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
SetStrategy performs a PUT /v1/strategy (the `SetStrategy` operationId) request. Takes a body of the `application/json` content type.
func (*Client) SetStrategyWithBody ¶
func (c *Client) SetStrategyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SetStrategyWithBody performs a PUT /v1/strategy (the `SetStrategy` operationId) request, with any type of body and a specified content type.
func (*Client) SetThresholds ¶
func (c *Client) SetThresholds(ctx context.Context, body SetThresholdsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
SetThresholds performs a PUT /v1/thresholds (the `SetThresholds` operationId) request. Takes a body of the `application/json` content type.
Replace the switching thresholds; the daemon writes them to config.toml and applies them at once.
func (*Client) SetThresholdsWithBody ¶
func (c *Client) SetThresholdsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SetThresholdsWithBody performs a PUT /v1/thresholds (the `SetThresholds` operationId) request, with any type of body and a specified content type.
Replace the switching thresholds; the daemon writes them to config.toml and applies them at once.
func (*Client) Signal ¶
func (c *Client) Signal(ctx context.Context, body SignalJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
Signal performs a POST /v1/signal (the `Signal` operationId) request. Takes a body of the `application/json` content type.
Raw Claude Code hook input.
func (*Client) SignalWithBody ¶
func (c *Client) SignalWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SignalWithBody performs a POST /v1/signal (the `Signal` operationId) request, with any type of body and a specified content type.
Raw Claude Code hook input.
func (*Client) StartLogin ¶ added in v0.2.0
func (c *Client) StartLogin(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
StartLogin performs a POST /v1/accounts/{name}/login (the `StartLogin` operationId) request.
Start a new login of the account, as ccswap login does: the daemon runs claude auth login and answers with the sign-in link it prints and the link's id. Signing in there shows a code, which /v1/accounts/{name}/login/code takes with the id. Signing in on the daemon's machine, in the browser tab claude opens, finishes the login without a code. One link per account: while one waits for its code, a new one is refused (login_pending), except on the unix socket and to the admin key, whose new link replaces it once it is up. Without those, a start under 30 seconds after the account's last one is refused too (429 login_cooldown), as each runs a claude that may open a browser tab on the daemon's machine. A link not used within 10 minutes is dropped. Never the account Claude Code uses (active_account), whose login only Claude Code renews. The TCP listener takes the read key here on any address, as only the account's own sign-in can finish the login, and only as a new login of an account here.
func (*Client) UseReset ¶ added in v0.5.0
func (c *Client) UseReset(ctx context.Context, name string, body UseResetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
UseReset performs a POST /v1/accounts/{name}/reset (the `UseReset` operationId) request. Takes a body of the `application/json` content type.
Spend one of the account's reset credits (Account.resets): Anthropic clears its usage limits at once, as Claude Code offers at a limit. left is the count the caller showed; another count here refuses it (reset_changed), so a second click elsewhere spends no second credit. A retry within 10 minutes of a reset Anthropic gave no sure answer to names the same claim, and Anthropic takes one claim per id, so it spends no second credit. The answer comes once the account's usage was asked again, so it shows the cleared limits when Anthropic allows the ask.
func (*Client) UseResetWithBody ¶ added in v0.5.0
func (c *Client) UseResetWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UseResetWithBody performs a POST /v1/accounts/{name}/reset (the `UseReset` operationId) request, with any type of body and a specified content type.
Spend one of the account's reset credits (Account.resets): Anthropic clears its usage limits at once, as Claude Code offers at a limit. left is the count the caller showed; another count here refuses it (reset_changed), so a second click elsewhere spends no second credit. A retry within 10 minutes of a reset Anthropic gave no sure answer to names the same claim, and Anthropic takes one claim per id, so it spends no second credit. The answer comes once the account's usage was asked again, so it shows the cleared limits when Anthropic allows the ask.
type ClientInterface ¶
type ClientInterface interface {
// ListAccounts performs a GET /v1/accounts (the `ListAccounts` operationId) request.
ListAccounts(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// ImportAccountWithBody performs a POST /v1/accounts (the `ImportAccount` operationId) request,
// with any type of body and a specified content type.
//
// Store the login made in a temporary Claude Code config dir as an account (or re-login an existing one).
ImportAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// ImportAccount performs a POST /v1/accounts (the `ImportAccount` operationId) request.
// Takes a body of the `application/json` content type.
//
// Store the login made in a temporary Claude Code config dir as an account (or re-login an existing one).
ImportAccount(ctx context.Context, body ImportAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// AdoptAccountWithBody performs a POST /v1/accounts/adopt (the `AdoptAccount` operationId) request,
// with any type of body and a specified content type.
//
// Register the login currently in Claude Code as an account.
AdoptAccountWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// AdoptAccount performs a POST /v1/accounts/adopt (the `AdoptAccount` operationId) request.
// Takes a body of the `application/json` content type.
//
// Register the login currently in Claude Code as an account.
AdoptAccount(ctx context.Context, body AdoptAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RemoveAccount performs a DELETE /v1/accounts/{name} (the `RemoveAccount` operationId) request.
RemoveAccount(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
// PatchAccountWithBody performs a PATCH /v1/accounts/{name} (the `PatchAccount` operationId) request,
// with any type of body and a specified content type.
PatchAccountWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// PatchAccount performs a PATCH /v1/accounts/{name} (the `PatchAccount` operationId) request.
// Takes a body of the `application/json` content type.
PatchAccount(ctx context.Context, name string, body PatchAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// ActivateAccount performs a POST /v1/accounts/{name}/activate (the `ActivateAccount` operationId) request.
ActivateAccount(ctx context.Context, name string, params *ActivateAccountParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// CancelLogin performs a DELETE /v1/accounts/{name}/login (the `CancelLogin` operationId) request.
//
// Drop the account's sign-in link of this id and stop its claude auth login, if there is one.
CancelLogin(ctx context.Context, name string, params *CancelLoginParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// StartLogin performs a POST /v1/accounts/{name}/login (the `StartLogin` operationId) request.
//
// Start a new login of the account, as ccswap login does: the daemon runs claude auth login and answers with the sign-in link it prints and the link's id. Signing in there shows a code, which /v1/accounts/{name}/login/code takes with the id. Signing in on the daemon's machine, in the browser tab claude opens, finishes the login without a code. One link per account: while one waits for its code, a new one is refused (login_pending), except on the unix socket and to the admin key, whose new link replaces it once it is up. Without those, a start under 30 seconds after the account's last one is refused too (429 login_cooldown), as each runs a claude that may open a browser tab on the daemon's machine. A link not used within 10 minutes is dropped. Never the account Claude Code uses (active_account), whose login only Claude Code renews. The TCP listener takes the read key here on any address, as only the account's own sign-in can finish the login, and only as a new login of an account here.
StartLogin(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
// FinishLoginWithBody performs a POST /v1/accounts/{name}/login/code (the `FinishLogin` operationId) request,
// with any type of body and a specified content type.
//
// Hand claude auth login of the link with this id the code its sign-in showed (CODE#STATE, or the callback URL) and store the login it gets as the account's. A link takes one code: after any answer but a bad request it is gone, and a new login starts with /v1/accounts/{name}/login again. The login must be the account's own email (wrong_account), and the account must still be here (not_found): this never adds an account.
FinishLoginWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// FinishLogin performs a POST /v1/accounts/{name}/login/code (the `FinishLogin` operationId) request.
// Takes a body of the `application/json` content type.
//
// Hand claude auth login of the link with this id the code its sign-in showed (CODE#STATE, or the callback URL) and store the login it gets as the account's. A link takes one code: after any answer but a bad request it is gone, and a new login starts with /v1/accounts/{name}/login again. The login must be the account's own email (wrong_account), and the account must still be here (not_found): this never adds an account.
FinishLogin(ctx context.Context, name string, body FinishLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RefreshLogin performs a POST /v1/accounts/{name}/refresh (the `RefreshLogin` operationId) request.
//
// Refresh the account's login now, as the daemon does 10 minutes before its access token runs out: a new access token, which also proves the login still works. It does not move login_expires_at. Never the login Claude Code uses (claude_owns), which Claude Code refreshes itself. An account refreshed under a minute ago is not asked again.
RefreshLogin(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*http.Response, error)
// UseResetWithBody performs a POST /v1/accounts/{name}/reset (the `UseReset` operationId) request,
// with any type of body and a specified content type.
//
// Spend one of the account's reset credits (Account.resets): Anthropic clears its usage limits at once, as Claude Code offers at a limit. left is the count the caller showed; another count here refuses it (reset_changed), so a second click elsewhere spends no second credit. A retry within 10 minutes of a reset Anthropic gave no sure answer to names the same claim, and Anthropic takes one claim per id, so it spends no second credit. The answer comes once the account's usage was asked again, so it shows the cleared limits when Anthropic allows the ask.
UseResetWithBody(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// UseReset performs a POST /v1/accounts/{name}/reset (the `UseReset` operationId) request.
// Takes a body of the `application/json` content type.
//
// Spend one of the account's reset credits (Account.resets): Anthropic clears its usage limits at once, as Claude Code offers at a limit. left is the count the caller showed; another count here refuses it (reset_changed), so a second click elsewhere spends no second credit. A retry within 10 minutes of a reset Anthropic gave no sure answer to names the same claim, and Anthropic takes one claim per id, so it spends no second credit. The answer comes once the account's usage was asked again, so it shows the cleared limits when Anthropic allows the ask.
UseReset(ctx context.Context, name string, body UseResetJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetAutoWithBody performs a PUT /v1/auto (the `SetAuto` operationId) request,
// with any type of body and a specified content type.
SetAutoWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetAuto performs a PUT /v1/auto (the `SetAuto` operationId) request.
// Takes a body of the `application/json` content type.
SetAuto(ctx context.Context, body SetAutoJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetEvents performs a GET /v1/events (the `GetEvents` operationId) request.
//
// Server-sent events: a "state" event whose data is a Snapshot at once and on every change, and a ": ping"
// comment every 15 s in between.
GetEvents(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetI18n performs a GET /v1/i18n/{lang} (the `GetI18n` operationId) request.
//
// The web page's texts in the language of the tag, else of the tag without its last subtags (pt-BR, then pt); English where that language has none. No key on the TCP listener either: the login screen needs them first, and they hold no secret.
GetI18n(ctx context.Context, lang string, params *GetI18nParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetLangWithBody performs a PUT /v1/lang (the `SetLang` operationId) request,
// with any type of body and a specified content type.
SetLangWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetLang performs a PUT /v1/lang (the `SetLang` operationId) request.
// Takes a body of the `application/json` content type.
SetLang(ctx context.Context, body SetLangJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// MigrateCancelWithBody performs a POST /v1/migrate/cancel (the `MigrateCancel` operationId) request,
// with any type of body and a specified content type.
//
// Drop an export that is not committed; its accounts stay here and thaw. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
MigrateCancelWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// MigrateCancel performs a POST /v1/migrate/cancel (the `MigrateCancel` operationId) request.
// Takes a body of the `application/json` content type.
//
// Drop an export that is not committed; its accounts stay here and thaw. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
MigrateCancel(ctx context.Context, body MigrateCancelJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// MigrateCommitWithBody performs a POST /v1/migrate/commit (the `MigrateCommit` operationId) request,
// with any type of body and a specified content type.
//
// Remove the accounts of an export here, once their logins are checked unchanged since packing; a second commit of the same export answers 204 again. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
MigrateCommitWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// MigrateCommit performs a POST /v1/migrate/commit (the `MigrateCommit` operationId) request.
// Takes a body of the `application/json` content type.
//
// Remove the accounts of an export here, once their logins are checked unchanged since packing; a second commit of the same export answers 204 again. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
MigrateCommit(ctx context.Context, body MigrateCommitJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// MigrateExportWithBody performs a POST /v1/migrate/export (the `MigrateExport` operationId) request,
// with any type of body and a specified content type.
//
// Pack accounts into an encrypted bundle to move them to another machine, and freeze them (no refresh, no switch to them) until /v1/migrate/commit removes them here or /v1/migrate/cancel, a daemon restart or 5 minutes lift the freeze. The code that opens the bundle is in this answer only. Unix socket only.
MigrateExportWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// MigrateExport performs a POST /v1/migrate/export (the `MigrateExport` operationId) request.
// Takes a body of the `application/json` content type.
//
// Pack accounts into an encrypted bundle to move them to another machine, and freeze them (no refresh, no switch to them) until /v1/migrate/commit removes them here or /v1/migrate/cancel, a daemon restart or 5 minutes lift the freeze. The code that opens the bundle is in this answer only. Unix socket only.
MigrateExport(ctx context.Context, body MigrateExportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// MigrateImportWithBody performs a POST /v1/migrate/import (the `MigrateImport` operationId) request,
// with any type of body and a specified content type.
//
// Add the accounts of a bundle from /v1/migrate/export, all or none, and refresh each login at once, which spends the bundle's refresh token: the answer waits on Anthropic and shows the refresh in each account's needs_login and error. With replace, the bundle's login of an account that replaces one here is refreshed first, before anything is written, and only a refreshed login replaces one: bundle_spent and bundle_unchecked refuse the import. A refresh that would keep the answer past about 30 seconds is left to the daemon's next tick. Unix socket only.
MigrateImportWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// MigrateImport performs a POST /v1/migrate/import (the `MigrateImport` operationId) request.
// Takes a body of the `application/json` content type.
//
// Add the accounts of a bundle from /v1/migrate/export, all or none, and refresh each login at once, which spends the bundle's refresh token: the answer waits on Anthropic and shows the refresh in each account's needs_login and error. With replace, the bundle's login of an account that replaces one here is refreshed first, before anything is written, and only a refreshed login replaces one: bundle_spent and bundle_unchecked refuse the import. A refresh that would keep the answer past about 30 seconds is left to the daemon's next tick. Unix socket only.
MigrateImport(ctx context.Context, body MigrateImportJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// Refresh performs a POST /v1/refresh (the `Refresh` operationId) request.
Refresh(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetRemoteWithBody performs a PUT /v1/remote (the `SetRemote` operationId) request,
// with any type of body and a specified content type.
//
// Take usage from another ccswap (url and its key) instead of asking Anthropic; an empty url turns it off. Unix socket only.
SetRemoteWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetRemote performs a PUT /v1/remote (the `SetRemote` operationId) request.
// Takes a body of the `application/json` content type.
//
// Take usage from another ccswap (url and its key) instead of asking Anthropic; an empty url turns it off. Unix socket only.
SetRemote(ctx context.Context, body SetRemoteJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// RestartWithBody performs a POST /v1/restart (the `Restart` operationId) request,
// with any type of body and a specified content type.
//
// Restart the daemon on its binary as /v1/update does, when that binary is the one named: ccswap update asks this after it installed a release over itself. A daemon that runs another binary carries on. The answer comes before the daemon stops. Unix socket only.
RestartWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// Restart performs a POST /v1/restart (the `Restart` operationId) request.
// Takes a body of the `application/json` content type.
//
// Restart the daemon on its binary as /v1/update does, when that binary is the one named: ccswap update asks this after it installed a release over itself. A daemon that runs another binary carries on. The answer comes before the daemon stops. Unix socket only.
Restart(ctx context.Context, body RestartJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// SignalWithBody performs a POST /v1/signal (the `Signal` operationId) request,
// with any type of body and a specified content type.
//
// Raw Claude Code hook input.
SignalWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// Signal performs a POST /v1/signal (the `Signal` operationId) request.
// Takes a body of the `application/json` content type.
//
// Raw Claude Code hook input.
Signal(ctx context.Context, body SignalJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetStatus performs a GET /v1/status (the `GetStatus` operationId) request.
GetStatus(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetStrategyWithBody performs a PUT /v1/strategy (the `SetStrategy` operationId) request,
// with any type of body and a specified content type.
SetStrategyWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetStrategy performs a PUT /v1/strategy (the `SetStrategy` operationId) request.
// Takes a body of the `application/json` content type.
SetStrategy(ctx context.Context, body SetStrategyJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetThresholdsWithBody performs a PUT /v1/thresholds (the `SetThresholds` operationId) request,
// with any type of body and a specified content type.
//
// Replace the switching thresholds; the daemon writes them to config.toml and applies them at once.
SetThresholdsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// SetThresholds performs a PUT /v1/thresholds (the `SetThresholds` operationId) request.
// Takes a body of the `application/json` content type.
//
// Replace the switching thresholds; the daemon writes them to config.toml and applies them at once.
SetThresholds(ctx context.Context, body SetThresholdsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// InstallUpdate performs a POST /v1/update (the `InstallUpdate` operationId) request.
//
// Install the newest release over the binary this daemon runs, then restart the daemon on it: the archive must match the release's checksums.txt and the new binary must run and report the release's version before it replaces the old one. The answer comes once the new binary is in place, and the daemon restarts right after.
InstallUpdate(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateWebCode performs a POST /v1/web/code (the `CreateWebCode` operationId) request.
//
// A one-time code (single use, valid a minute) that the web page trades for the admin key at /v1/web/session. Unix socket only.
CreateWebCode(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// OpenWebSessionWithBody performs a POST /v1/web/session (the `OpenWebSession` operationId) request,
// with any type of body and a specified content type.
//
// Trade a code from /v1/web/code for the admin key the TCP listener holds. TCP listener only: it takes the code without a key, on a loopback address only; the unix socket answers 404.
OpenWebSessionWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// OpenWebSession performs a POST /v1/web/session (the `OpenWebSession` operationId) request.
// Takes a body of the `application/json` content type.
//
// Trade a code from /v1/web/code for the admin key the TCP listener holds. TCP listener only: it takes the code without a key, on a loopback address only; the unix socket answers 404.
OpenWebSession(ctx context.Context, body OpenWebSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) ActivateAccountWithResponse ¶
func (c *ClientWithResponses) ActivateAccountWithResponse(ctx context.Context, name string, params *ActivateAccountParams, reqEditors ...RequestEditorFn) (*ActivateAccountResponse, error)
ActivateAccountWithResponse performs a POST /v1/accounts/{name}/activate (the `ActivateAccount` operationId) request.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) AdoptAccountWithBodyWithResponse ¶
func (c *ClientWithResponses) AdoptAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AdoptAccountResponse, error)
AdoptAccountWithBodyWithResponse performs a POST /v1/accounts/adopt (the `AdoptAccount` operationId) request, with any type of body and a specified content type.
Register the login currently in Claude Code as an account.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) AdoptAccountWithResponse ¶
func (c *ClientWithResponses) AdoptAccountWithResponse(ctx context.Context, body AdoptAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AdoptAccountResponse, error)
AdoptAccountWithResponse performs a POST /v1/accounts/adopt (the `AdoptAccount` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Register the login currently in Claude Code as an account.
func (*ClientWithResponses) CancelLoginWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) CancelLoginWithResponse(ctx context.Context, name string, params *CancelLoginParams, reqEditors ...RequestEditorFn) (*CancelLoginResponse, error)
CancelLoginWithResponse performs a DELETE /v1/accounts/{name}/login (the `CancelLogin` operationId) request.
Drop the account's sign-in link of this id and stop its claude auth login, if there is one.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) CreateWebCodeWithResponse ¶
func (c *ClientWithResponses) CreateWebCodeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CreateWebCodeResponse, error)
CreateWebCodeWithResponse performs a POST /v1/web/code (the `CreateWebCode` operationId) request.
A one-time code (single use, valid a minute) that the web page trades for the admin key at /v1/web/session. Unix socket only.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) FinishLoginWithBodyWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) FinishLoginWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishLoginResponse, error)
FinishLoginWithBodyWithResponse performs a POST /v1/accounts/{name}/login/code (the `FinishLogin` operationId) request, with any type of body and a specified content type.
Hand claude auth login of the link with this id the code its sign-in showed (CODE#STATE, or the callback URL) and store the login it gets as the account's. A link takes one code: after any answer but a bad request it is gone, and a new login starts with /v1/accounts/{name}/login again. The login must be the account's own email (wrong_account), and the account must still be here (not_found): this never adds an account.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) FinishLoginWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) FinishLoginWithResponse(ctx context.Context, name string, body FinishLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishLoginResponse, error)
FinishLoginWithResponse performs a POST /v1/accounts/{name}/login/code (the `FinishLogin` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Hand claude auth login of the link with this id the code its sign-in showed (CODE#STATE, or the callback URL) and store the login it gets as the account's. A link takes one code: after any answer but a bad request it is gone, and a new login starts with /v1/accounts/{name}/login again. The login must be the account's own email (wrong_account), and the account must still be here (not_found): this never adds an account.
func (*ClientWithResponses) GetEventsWithResponse ¶
func (c *ClientWithResponses) GetEventsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEventsResponse, error)
GetEventsWithResponse performs a GET /v1/events (the `GetEvents` operationId) request.
Server-sent events: a "state" event whose data is a Snapshot at once and on every change, and a ": ping" comment every 15 s in between.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) GetI18nWithResponse ¶
func (c *ClientWithResponses) GetI18nWithResponse(ctx context.Context, lang string, params *GetI18nParams, reqEditors ...RequestEditorFn) (*GetI18nResponse, error)
GetI18nWithResponse performs a GET /v1/i18n/{lang} (the `GetI18n` operationId) request.
The web page's texts in the language of the tag, else of the tag without its last subtags (pt-BR, then pt); English where that language has none. No key on the TCP listener either: the login screen needs them first, and they hold no secret.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) GetStatusWithResponse ¶
func (c *ClientWithResponses) GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
GetStatusWithResponse performs a GET /v1/status (the `GetStatus` operationId) request.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) ImportAccountWithBodyWithResponse ¶
func (c *ClientWithResponses) ImportAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportAccountResponse, error)
ImportAccountWithBodyWithResponse performs a POST /v1/accounts (the `ImportAccount` operationId) request, with any type of body and a specified content type.
Store the login made in a temporary Claude Code config dir as an account (or re-login an existing one).
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) ImportAccountWithResponse ¶
func (c *ClientWithResponses) ImportAccountWithResponse(ctx context.Context, body ImportAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportAccountResponse, error)
ImportAccountWithResponse performs a POST /v1/accounts (the `ImportAccount` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Store the login made in a temporary Claude Code config dir as an account (or re-login an existing one).
func (*ClientWithResponses) InstallUpdateWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) InstallUpdateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InstallUpdateResponse, error)
InstallUpdateWithResponse performs a POST /v1/update (the `InstallUpdate` operationId) request.
Install the newest release over the binary this daemon runs, then restart the daemon on it: the archive must match the release's checksums.txt and the new binary must run and report the release's version before it replaces the old one. The answer comes once the new binary is in place, and the daemon restarts right after.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) ListAccountsWithResponse ¶
func (c *ClientWithResponses) ListAccountsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAccountsResponse, error)
ListAccountsWithResponse performs a GET /v1/accounts (the `ListAccounts` operationId) request.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) MigrateCancelWithBodyWithResponse ¶
func (c *ClientWithResponses) MigrateCancelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateCancelResponse, error)
MigrateCancelWithBodyWithResponse performs a POST /v1/migrate/cancel (the `MigrateCancel` operationId) request, with any type of body and a specified content type.
Drop an export that is not committed; its accounts stay here and thaw. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) MigrateCancelWithResponse ¶
func (c *ClientWithResponses) MigrateCancelWithResponse(ctx context.Context, body MigrateCancelJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateCancelResponse, error)
MigrateCancelWithResponse performs a POST /v1/migrate/cancel (the `MigrateCancel` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Drop an export that is not committed; its accounts stay here and thaw. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
func (*ClientWithResponses) MigrateCommitWithBodyWithResponse ¶
func (c *ClientWithResponses) MigrateCommitWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateCommitResponse, error)
MigrateCommitWithBodyWithResponse performs a POST /v1/migrate/commit (the `MigrateCommit` operationId) request, with any type of body and a specified content type.
Remove the accounts of an export here, once their logins are checked unchanged since packing; a second commit of the same export answers 204 again. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) MigrateCommitWithResponse ¶
func (c *ClientWithResponses) MigrateCommitWithResponse(ctx context.Context, body MigrateCommitJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateCommitResponse, error)
MigrateCommitWithResponse performs a POST /v1/migrate/commit (the `MigrateCommit` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Remove the accounts of an export here, once their logins are checked unchanged since packing; a second commit of the same export answers 204 again. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
func (*ClientWithResponses) MigrateExportWithBodyWithResponse ¶
func (c *ClientWithResponses) MigrateExportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateExportResponse, error)
MigrateExportWithBodyWithResponse performs a POST /v1/migrate/export (the `MigrateExport` operationId) request, with any type of body and a specified content type.
Pack accounts into an encrypted bundle to move them to another machine, and freeze them (no refresh, no switch to them) until /v1/migrate/commit removes them here or /v1/migrate/cancel, a daemon restart or 5 minutes lift the freeze. The code that opens the bundle is in this answer only. Unix socket only.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) MigrateExportWithResponse ¶
func (c *ClientWithResponses) MigrateExportWithResponse(ctx context.Context, body MigrateExportJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateExportResponse, error)
MigrateExportWithResponse performs a POST /v1/migrate/export (the `MigrateExport` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Pack accounts into an encrypted bundle to move them to another machine, and freeze them (no refresh, no switch to them) until /v1/migrate/commit removes them here or /v1/migrate/cancel, a daemon restart or 5 minutes lift the freeze. The code that opens the bundle is in this answer only. Unix socket only.
func (*ClientWithResponses) MigrateImportWithBodyWithResponse ¶
func (c *ClientWithResponses) MigrateImportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateImportResponse, error)
MigrateImportWithBodyWithResponse performs a POST /v1/migrate/import (the `MigrateImport` operationId) request, with any type of body and a specified content type.
Add the accounts of a bundle from /v1/migrate/export, all or none, and refresh each login at once, which spends the bundle's refresh token: the answer waits on Anthropic and shows the refresh in each account's needs_login and error. With replace, the bundle's login of an account that replaces one here is refreshed first, before anything is written, and only a refreshed login replaces one: bundle_spent and bundle_unchecked refuse the import. A refresh that would keep the answer past about 30 seconds is left to the daemon's next tick. Unix socket only.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) MigrateImportWithResponse ¶
func (c *ClientWithResponses) MigrateImportWithResponse(ctx context.Context, body MigrateImportJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateImportResponse, error)
MigrateImportWithResponse performs a POST /v1/migrate/import (the `MigrateImport` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Add the accounts of a bundle from /v1/migrate/export, all or none, and refresh each login at once, which spends the bundle's refresh token: the answer waits on Anthropic and shows the refresh in each account's needs_login and error. With replace, the bundle's login of an account that replaces one here is refreshed first, before anything is written, and only a refreshed login replaces one: bundle_spent and bundle_unchecked refuse the import. A refresh that would keep the answer past about 30 seconds is left to the daemon's next tick. Unix socket only.
func (*ClientWithResponses) OpenWebSessionWithBodyWithResponse ¶
func (c *ClientWithResponses) OpenWebSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*OpenWebSessionResponse, error)
OpenWebSessionWithBodyWithResponse performs a POST /v1/web/session (the `OpenWebSession` operationId) request, with any type of body and a specified content type.
Trade a code from /v1/web/code for the admin key the TCP listener holds. TCP listener only: it takes the code without a key, on a loopback address only; the unix socket answers 404.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) OpenWebSessionWithResponse ¶
func (c *ClientWithResponses) OpenWebSessionWithResponse(ctx context.Context, body OpenWebSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*OpenWebSessionResponse, error)
OpenWebSessionWithResponse performs a POST /v1/web/session (the `OpenWebSession` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Trade a code from /v1/web/code for the admin key the TCP listener holds. TCP listener only: it takes the code without a key, on a loopback address only; the unix socket answers 404.
func (*ClientWithResponses) PatchAccountWithBodyWithResponse ¶
func (c *ClientWithResponses) PatchAccountWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchAccountResponse, error)
PatchAccountWithBodyWithResponse performs a PATCH /v1/accounts/{name} (the `PatchAccount` operationId) request, with any type of body and a specified content type.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) PatchAccountWithResponse ¶
func (c *ClientWithResponses) PatchAccountWithResponse(ctx context.Context, name string, body PatchAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchAccountResponse, error)
PatchAccountWithResponse performs a PATCH /v1/accounts/{name} (the `PatchAccount` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) RefreshLoginWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) RefreshLoginWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RefreshLoginResponse, error)
RefreshLoginWithResponse performs a POST /v1/accounts/{name}/refresh (the `RefreshLogin` operationId) request.
Refresh the account's login now, as the daemon does 10 minutes before its access token runs out: a new access token, which also proves the login still works. It does not move login_expires_at. Never the login Claude Code uses (claude_owns), which Claude Code refreshes itself. An account refreshed under a minute ago is not asked again.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) RefreshWithResponse ¶
func (c *ClientWithResponses) RefreshWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RefreshResponse, error)
RefreshWithResponse performs a POST /v1/refresh (the `Refresh` operationId) request.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) RemoveAccountWithResponse ¶
func (c *ClientWithResponses) RemoveAccountWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RemoveAccountResponse, error)
RemoveAccountWithResponse performs a DELETE /v1/accounts/{name} (the `RemoveAccount` operationId) request.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) RestartWithBodyWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) RestartWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RestartResponse, error)
RestartWithBodyWithResponse performs a POST /v1/restart (the `Restart` operationId) request, with any type of body and a specified content type.
Restart the daemon on its binary as /v1/update does, when that binary is the one named: ccswap update asks this after it installed a release over itself. A daemon that runs another binary carries on. The answer comes before the daemon stops. Unix socket only.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) RestartWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) RestartWithResponse(ctx context.Context, body RestartJSONRequestBody, reqEditors ...RequestEditorFn) (*RestartResponse, error)
RestartWithResponse performs a POST /v1/restart (the `Restart` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Restart the daemon on its binary as /v1/update does, when that binary is the one named: ccswap update asks this after it installed a release over itself. A daemon that runs another binary carries on. The answer comes before the daemon stops. Unix socket only.
func (*ClientWithResponses) SetAutoWithBodyWithResponse ¶
func (c *ClientWithResponses) SetAutoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetAutoResponse, error)
SetAutoWithBodyWithResponse performs a PUT /v1/auto (the `SetAuto` operationId) request, with any type of body and a specified content type.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SetAutoWithResponse ¶
func (c *ClientWithResponses) SetAutoWithResponse(ctx context.Context, body SetAutoJSONRequestBody, reqEditors ...RequestEditorFn) (*SetAutoResponse, error)
SetAutoWithResponse performs a PUT /v1/auto (the `SetAuto` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SetLangWithBodyWithResponse ¶
func (c *ClientWithResponses) SetLangWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLangResponse, error)
SetLangWithBodyWithResponse performs a PUT /v1/lang (the `SetLang` operationId) request, with any type of body and a specified content type.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SetLangWithResponse ¶
func (c *ClientWithResponses) SetLangWithResponse(ctx context.Context, body SetLangJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLangResponse, error)
SetLangWithResponse performs a PUT /v1/lang (the `SetLang` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SetRemoteWithBodyWithResponse ¶
func (c *ClientWithResponses) SetRemoteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetRemoteResponse, error)
SetRemoteWithBodyWithResponse performs a PUT /v1/remote (the `SetRemote` operationId) request, with any type of body and a specified content type.
Take usage from another ccswap (url and its key) instead of asking Anthropic; an empty url turns it off. Unix socket only.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SetRemoteWithResponse ¶
func (c *ClientWithResponses) SetRemoteWithResponse(ctx context.Context, body SetRemoteJSONRequestBody, reqEditors ...RequestEditorFn) (*SetRemoteResponse, error)
SetRemoteWithResponse performs a PUT /v1/remote (the `SetRemote` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Take usage from another ccswap (url and its key) instead of asking Anthropic; an empty url turns it off. Unix socket only.
func (*ClientWithResponses) SetStrategyWithBodyWithResponse ¶
func (c *ClientWithResponses) SetStrategyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStrategyResponse, error)
SetStrategyWithBodyWithResponse performs a PUT /v1/strategy (the `SetStrategy` operationId) request, with any type of body and a specified content type.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SetStrategyWithResponse ¶
func (c *ClientWithResponses) SetStrategyWithResponse(ctx context.Context, body SetStrategyJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStrategyResponse, error)
SetStrategyWithResponse performs a PUT /v1/strategy (the `SetStrategy` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SetThresholdsWithBodyWithResponse ¶
func (c *ClientWithResponses) SetThresholdsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetThresholdsResponse, error)
SetThresholdsWithBodyWithResponse performs a PUT /v1/thresholds (the `SetThresholds` operationId) request, with any type of body and a specified content type.
Replace the switching thresholds; the daemon writes them to config.toml and applies them at once.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SetThresholdsWithResponse ¶
func (c *ClientWithResponses) SetThresholdsWithResponse(ctx context.Context, body SetThresholdsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetThresholdsResponse, error)
SetThresholdsWithResponse performs a PUT /v1/thresholds (the `SetThresholds` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Replace the switching thresholds; the daemon writes them to config.toml and applies them at once.
func (*ClientWithResponses) SignalWithBodyWithResponse ¶
func (c *ClientWithResponses) SignalWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignalResponse, error)
SignalWithBodyWithResponse performs a POST /v1/signal (the `Signal` operationId) request, with any type of body and a specified content type.
Raw Claude Code hook input.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) SignalWithResponse ¶
func (c *ClientWithResponses) SignalWithResponse(ctx context.Context, body SignalJSONRequestBody, reqEditors ...RequestEditorFn) (*SignalResponse, error)
SignalWithResponse performs a POST /v1/signal (the `Signal` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Raw Claude Code hook input.
func (*ClientWithResponses) StartLoginWithResponse ¶ added in v0.2.0
func (c *ClientWithResponses) StartLoginWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*StartLoginResponse, error)
StartLoginWithResponse performs a POST /v1/accounts/{name}/login (the `StartLogin` operationId) request.
Start a new login of the account, as ccswap login does: the daemon runs claude auth login and answers with the sign-in link it prints and the link's id. Signing in there shows a code, which /v1/accounts/{name}/login/code takes with the id. Signing in on the daemon's machine, in the browser tab claude opens, finishes the login without a code. One link per account: while one waits for its code, a new one is refused (login_pending), except on the unix socket and to the admin key, whose new link replaces it once it is up. Without those, a start under 30 seconds after the account's last one is refused too (429 login_cooldown), as each runs a claude that may open a browser tab on the daemon's machine. A link not used within 10 minutes is dropped. Never the account Claude Code uses (active_account), whose login only Claude Code renews. The TCP listener takes the read key here on any address, as only the account's own sign-in can finish the login, and only as a new login of an account here.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) UseResetWithBodyWithResponse ¶ added in v0.5.0
func (c *ClientWithResponses) UseResetWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UseResetResponse, error)
UseResetWithBodyWithResponse performs a POST /v1/accounts/{name}/reset (the `UseReset` operationId) request, with any type of body and a specified content type.
Spend one of the account's reset credits (Account.resets): Anthropic clears its usage limits at once, as Claude Code offers at a limit. left is the count the caller showed; another count here refuses it (reset_changed), so a second click elsewhere spends no second credit. A retry within 10 minutes of a reset Anthropic gave no sure answer to names the same claim, and Anthropic takes one claim per id, so it spends no second credit. The answer comes once the account's usage was asked again, so it shows the cleared limits when Anthropic allows the ask.
Returns a wrapper object for the known response body format(s).
func (*ClientWithResponses) UseResetWithResponse ¶ added in v0.5.0
func (c *ClientWithResponses) UseResetWithResponse(ctx context.Context, name string, body UseResetJSONRequestBody, reqEditors ...RequestEditorFn) (*UseResetResponse, error)
UseResetWithResponse performs a POST /v1/accounts/{name}/reset (the `UseReset` operationId) request. Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Spend one of the account's reset credits (Account.resets): Anthropic clears its usage limits at once, as Claude Code offers at a limit. left is the count the caller showed; another count here refuses it (reset_changed), so a second click elsewhere spends no second credit. A retry within 10 minutes of a reset Anthropic gave no sure answer to names the same claim, and Anthropic takes one claim per id, so it spends no second credit. The answer comes once the account's usage was asked again, so it shows the cleared limits when Anthropic allows the ask.
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// ListAccountsWithResponse performs a GET /v1/accounts (the `ListAccounts` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
ListAccountsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListAccountsResponse, error)
// ImportAccountWithBodyWithResponse performs a POST /v1/accounts (the `ImportAccount` operationId) request,
// with any type of body and a specified content type.
//
// Store the login made in a temporary Claude Code config dir as an account (or re-login an existing one).
//
// Returns a wrapper object for the known response body format(s).
ImportAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*ImportAccountResponse, error)
// ImportAccountWithResponse performs a POST /v1/accounts (the `ImportAccount` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Store the login made in a temporary Claude Code config dir as an account (or re-login an existing one).
ImportAccountWithResponse(ctx context.Context, body ImportAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*ImportAccountResponse, error)
// AdoptAccountWithBodyWithResponse performs a POST /v1/accounts/adopt (the `AdoptAccount` operationId) request,
// with any type of body and a specified content type.
//
// Register the login currently in Claude Code as an account.
//
// Returns a wrapper object for the known response body format(s).
AdoptAccountWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*AdoptAccountResponse, error)
// AdoptAccountWithResponse performs a POST /v1/accounts/adopt (the `AdoptAccount` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Register the login currently in Claude Code as an account.
AdoptAccountWithResponse(ctx context.Context, body AdoptAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*AdoptAccountResponse, error)
// RemoveAccountWithResponse performs a DELETE /v1/accounts/{name} (the `RemoveAccount` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
RemoveAccountWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RemoveAccountResponse, error)
// PatchAccountWithBodyWithResponse performs a PATCH /v1/accounts/{name} (the `PatchAccount` operationId) request,
// with any type of body and a specified content type.
//
// Returns a wrapper object for the known response body format(s).
PatchAccountWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PatchAccountResponse, error)
// PatchAccountWithResponse performs a PATCH /v1/accounts/{name} (the `PatchAccount` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
PatchAccountWithResponse(ctx context.Context, name string, body PatchAccountJSONRequestBody, reqEditors ...RequestEditorFn) (*PatchAccountResponse, error)
// ActivateAccountWithResponse performs a POST /v1/accounts/{name}/activate (the `ActivateAccount` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
ActivateAccountWithResponse(ctx context.Context, name string, params *ActivateAccountParams, reqEditors ...RequestEditorFn) (*ActivateAccountResponse, error)
// CancelLoginWithResponse performs a DELETE /v1/accounts/{name}/login (the `CancelLogin` operationId) request.
//
// Drop the account's sign-in link of this id and stop its claude auth login, if there is one.
//
// Returns a wrapper object for the known response body format(s).
CancelLoginWithResponse(ctx context.Context, name string, params *CancelLoginParams, reqEditors ...RequestEditorFn) (*CancelLoginResponse, error)
// StartLoginWithResponse performs a POST /v1/accounts/{name}/login (the `StartLogin` operationId) request.
//
// Start a new login of the account, as ccswap login does: the daemon runs claude auth login and answers with the sign-in link it prints and the link's id. Signing in there shows a code, which /v1/accounts/{name}/login/code takes with the id. Signing in on the daemon's machine, in the browser tab claude opens, finishes the login without a code. One link per account: while one waits for its code, a new one is refused (login_pending), except on the unix socket and to the admin key, whose new link replaces it once it is up. Without those, a start under 30 seconds after the account's last one is refused too (429 login_cooldown), as each runs a claude that may open a browser tab on the daemon's machine. A link not used within 10 minutes is dropped. Never the account Claude Code uses (active_account), whose login only Claude Code renews. The TCP listener takes the read key here on any address, as only the account's own sign-in can finish the login, and only as a new login of an account here.
//
// Returns a wrapper object for the known response body format(s).
StartLoginWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*StartLoginResponse, error)
// FinishLoginWithBodyWithResponse performs a POST /v1/accounts/{name}/login/code (the `FinishLogin` operationId) request,
// with any type of body and a specified content type.
//
// Hand claude auth login of the link with this id the code its sign-in showed (CODE#STATE, or the callback URL) and store the login it gets as the account's. A link takes one code: after any answer but a bad request it is gone, and a new login starts with /v1/accounts/{name}/login again. The login must be the account's own email (wrong_account), and the account must still be here (not_found): this never adds an account.
//
// Returns a wrapper object for the known response body format(s).
FinishLoginWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*FinishLoginResponse, error)
// FinishLoginWithResponse performs a POST /v1/accounts/{name}/login/code (the `FinishLogin` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Hand claude auth login of the link with this id the code its sign-in showed (CODE#STATE, or the callback URL) and store the login it gets as the account's. A link takes one code: after any answer but a bad request it is gone, and a new login starts with /v1/accounts/{name}/login again. The login must be the account's own email (wrong_account), and the account must still be here (not_found): this never adds an account.
FinishLoginWithResponse(ctx context.Context, name string, body FinishLoginJSONRequestBody, reqEditors ...RequestEditorFn) (*FinishLoginResponse, error)
// RefreshLoginWithResponse performs a POST /v1/accounts/{name}/refresh (the `RefreshLogin` operationId) request.
//
// Refresh the account's login now, as the daemon does 10 minutes before its access token runs out: a new access token, which also proves the login still works. It does not move login_expires_at. Never the login Claude Code uses (claude_owns), which Claude Code refreshes itself. An account refreshed under a minute ago is not asked again.
//
// Returns a wrapper object for the known response body format(s).
RefreshLoginWithResponse(ctx context.Context, name string, reqEditors ...RequestEditorFn) (*RefreshLoginResponse, error)
// UseResetWithBodyWithResponse performs a POST /v1/accounts/{name}/reset (the `UseReset` operationId) request,
// with any type of body and a specified content type.
//
// Spend one of the account's reset credits (Account.resets): Anthropic clears its usage limits at once, as Claude Code offers at a limit. left is the count the caller showed; another count here refuses it (reset_changed), so a second click elsewhere spends no second credit. A retry within 10 minutes of a reset Anthropic gave no sure answer to names the same claim, and Anthropic takes one claim per id, so it spends no second credit. The answer comes once the account's usage was asked again, so it shows the cleared limits when Anthropic allows the ask.
//
// Returns a wrapper object for the known response body format(s).
UseResetWithBodyWithResponse(ctx context.Context, name string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UseResetResponse, error)
// UseResetWithResponse performs a POST /v1/accounts/{name}/reset (the `UseReset` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Spend one of the account's reset credits (Account.resets): Anthropic clears its usage limits at once, as Claude Code offers at a limit. left is the count the caller showed; another count here refuses it (reset_changed), so a second click elsewhere spends no second credit. A retry within 10 minutes of a reset Anthropic gave no sure answer to names the same claim, and Anthropic takes one claim per id, so it spends no second credit. The answer comes once the account's usage was asked again, so it shows the cleared limits when Anthropic allows the ask.
UseResetWithResponse(ctx context.Context, name string, body UseResetJSONRequestBody, reqEditors ...RequestEditorFn) (*UseResetResponse, error)
// SetAutoWithBodyWithResponse performs a PUT /v1/auto (the `SetAuto` operationId) request,
// with any type of body and a specified content type.
//
// Returns a wrapper object for the known response body format(s).
SetAutoWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetAutoResponse, error)
// SetAutoWithResponse performs a PUT /v1/auto (the `SetAuto` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
SetAutoWithResponse(ctx context.Context, body SetAutoJSONRequestBody, reqEditors ...RequestEditorFn) (*SetAutoResponse, error)
// GetEventsWithResponse performs a GET /v1/events (the `GetEvents` operationId) request.
//
// Server-sent events: a "state" event whose data is a Snapshot at once and on every change, and a ": ping"
// comment every 15 s in between.
//
// Returns a wrapper object for the known response body format(s).
GetEventsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetEventsResponse, error)
// GetI18nWithResponse performs a GET /v1/i18n/{lang} (the `GetI18n` operationId) request.
//
// The web page's texts in the language of the tag, else of the tag without its last subtags (pt-BR, then pt); English where that language has none. No key on the TCP listener either: the login screen needs them first, and they hold no secret.
//
// Returns a wrapper object for the known response body format(s).
GetI18nWithResponse(ctx context.Context, lang string, params *GetI18nParams, reqEditors ...RequestEditorFn) (*GetI18nResponse, error)
// SetLangWithBodyWithResponse performs a PUT /v1/lang (the `SetLang` operationId) request,
// with any type of body and a specified content type.
//
// Returns a wrapper object for the known response body format(s).
SetLangWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetLangResponse, error)
// SetLangWithResponse performs a PUT /v1/lang (the `SetLang` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
SetLangWithResponse(ctx context.Context, body SetLangJSONRequestBody, reqEditors ...RequestEditorFn) (*SetLangResponse, error)
// MigrateCancelWithBodyWithResponse performs a POST /v1/migrate/cancel (the `MigrateCancel` operationId) request,
// with any type of body and a specified content type.
//
// Drop an export that is not committed; its accounts stay here and thaw. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
//
// Returns a wrapper object for the known response body format(s).
MigrateCancelWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateCancelResponse, error)
// MigrateCancelWithResponse performs a POST /v1/migrate/cancel (the `MigrateCancel` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Drop an export that is not committed; its accounts stay here and thaw. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
MigrateCancelWithResponse(ctx context.Context, body MigrateCancelJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateCancelResponse, error)
// MigrateCommitWithBodyWithResponse performs a POST /v1/migrate/commit (the `MigrateCommit` operationId) request,
// with any type of body and a specified content type.
//
// Remove the accounts of an export here, once their logins are checked unchanged since packing; a second commit of the same export answers 204 again. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
//
// Returns a wrapper object for the known response body format(s).
MigrateCommitWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateCommitResponse, error)
// MigrateCommitWithResponse performs a POST /v1/migrate/commit (the `MigrateCommit` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Remove the accounts of an export here, once their logins are checked unchanged since packing; a second commit of the same export answers 204 again. A daemon restart forgets every export, possibly after its commit landed: on export_gone check whether the accounts are still here. Unix socket only.
MigrateCommitWithResponse(ctx context.Context, body MigrateCommitJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateCommitResponse, error)
// MigrateExportWithBodyWithResponse performs a POST /v1/migrate/export (the `MigrateExport` operationId) request,
// with any type of body and a specified content type.
//
// Pack accounts into an encrypted bundle to move them to another machine, and freeze them (no refresh, no switch to them) until /v1/migrate/commit removes them here or /v1/migrate/cancel, a daemon restart or 5 minutes lift the freeze. The code that opens the bundle is in this answer only. Unix socket only.
//
// Returns a wrapper object for the known response body format(s).
MigrateExportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateExportResponse, error)
// MigrateExportWithResponse performs a POST /v1/migrate/export (the `MigrateExport` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Pack accounts into an encrypted bundle to move them to another machine, and freeze them (no refresh, no switch to them) until /v1/migrate/commit removes them here or /v1/migrate/cancel, a daemon restart or 5 minutes lift the freeze. The code that opens the bundle is in this answer only. Unix socket only.
MigrateExportWithResponse(ctx context.Context, body MigrateExportJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateExportResponse, error)
// MigrateImportWithBodyWithResponse performs a POST /v1/migrate/import (the `MigrateImport` operationId) request,
// with any type of body and a specified content type.
//
// Add the accounts of a bundle from /v1/migrate/export, all or none, and refresh each login at once, which spends the bundle's refresh token: the answer waits on Anthropic and shows the refresh in each account's needs_login and error. With replace, the bundle's login of an account that replaces one here is refreshed first, before anything is written, and only a refreshed login replaces one: bundle_spent and bundle_unchecked refuse the import. A refresh that would keep the answer past about 30 seconds is left to the daemon's next tick. Unix socket only.
//
// Returns a wrapper object for the known response body format(s).
MigrateImportWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*MigrateImportResponse, error)
// MigrateImportWithResponse performs a POST /v1/migrate/import (the `MigrateImport` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Add the accounts of a bundle from /v1/migrate/export, all or none, and refresh each login at once, which spends the bundle's refresh token: the answer waits on Anthropic and shows the refresh in each account's needs_login and error. With replace, the bundle's login of an account that replaces one here is refreshed first, before anything is written, and only a refreshed login replaces one: bundle_spent and bundle_unchecked refuse the import. A refresh that would keep the answer past about 30 seconds is left to the daemon's next tick. Unix socket only.
MigrateImportWithResponse(ctx context.Context, body MigrateImportJSONRequestBody, reqEditors ...RequestEditorFn) (*MigrateImportResponse, error)
// RefreshWithResponse performs a POST /v1/refresh (the `Refresh` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
RefreshWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*RefreshResponse, error)
// SetRemoteWithBodyWithResponse performs a PUT /v1/remote (the `SetRemote` operationId) request,
// with any type of body and a specified content type.
//
// Take usage from another ccswap (url and its key) instead of asking Anthropic; an empty url turns it off. Unix socket only.
//
// Returns a wrapper object for the known response body format(s).
SetRemoteWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetRemoteResponse, error)
// SetRemoteWithResponse performs a PUT /v1/remote (the `SetRemote` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Take usage from another ccswap (url and its key) instead of asking Anthropic; an empty url turns it off. Unix socket only.
SetRemoteWithResponse(ctx context.Context, body SetRemoteJSONRequestBody, reqEditors ...RequestEditorFn) (*SetRemoteResponse, error)
// RestartWithBodyWithResponse performs a POST /v1/restart (the `Restart` operationId) request,
// with any type of body and a specified content type.
//
// Restart the daemon on its binary as /v1/update does, when that binary is the one named: ccswap update asks this after it installed a release over itself. A daemon that runs another binary carries on. The answer comes before the daemon stops. Unix socket only.
//
// Returns a wrapper object for the known response body format(s).
RestartWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*RestartResponse, error)
// RestartWithResponse performs a POST /v1/restart (the `Restart` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Restart the daemon on its binary as /v1/update does, when that binary is the one named: ccswap update asks this after it installed a release over itself. A daemon that runs another binary carries on. The answer comes before the daemon stops. Unix socket only.
RestartWithResponse(ctx context.Context, body RestartJSONRequestBody, reqEditors ...RequestEditorFn) (*RestartResponse, error)
// SignalWithBodyWithResponse performs a POST /v1/signal (the `Signal` operationId) request,
// with any type of body and a specified content type.
//
// Raw Claude Code hook input.
//
// Returns a wrapper object for the known response body format(s).
SignalWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SignalResponse, error)
// SignalWithResponse performs a POST /v1/signal (the `Signal` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Raw Claude Code hook input.
SignalWithResponse(ctx context.Context, body SignalJSONRequestBody, reqEditors ...RequestEditorFn) (*SignalResponse, error)
// GetStatusWithResponse performs a GET /v1/status (the `GetStatus` operationId) request.
//
// Returns a wrapper object for the known response body format(s).
GetStatusWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetStatusResponse, error)
// SetStrategyWithBodyWithResponse performs a PUT /v1/strategy (the `SetStrategy` operationId) request,
// with any type of body and a specified content type.
//
// Returns a wrapper object for the known response body format(s).
SetStrategyWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetStrategyResponse, error)
// SetStrategyWithResponse performs a PUT /v1/strategy (the `SetStrategy` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
SetStrategyWithResponse(ctx context.Context, body SetStrategyJSONRequestBody, reqEditors ...RequestEditorFn) (*SetStrategyResponse, error)
// SetThresholdsWithBodyWithResponse performs a PUT /v1/thresholds (the `SetThresholds` operationId) request,
// with any type of body and a specified content type.
//
// Replace the switching thresholds; the daemon writes them to config.toml and applies them at once.
//
// Returns a wrapper object for the known response body format(s).
SetThresholdsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SetThresholdsResponse, error)
// SetThresholdsWithResponse performs a PUT /v1/thresholds (the `SetThresholds` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Replace the switching thresholds; the daemon writes them to config.toml and applies them at once.
SetThresholdsWithResponse(ctx context.Context, body SetThresholdsJSONRequestBody, reqEditors ...RequestEditorFn) (*SetThresholdsResponse, error)
// InstallUpdateWithResponse performs a POST /v1/update (the `InstallUpdate` operationId) request.
//
// Install the newest release over the binary this daemon runs, then restart the daemon on it: the archive must match the release's checksums.txt and the new binary must run and report the release's version before it replaces the old one. The answer comes once the new binary is in place, and the daemon restarts right after.
//
// Returns a wrapper object for the known response body format(s).
InstallUpdateWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*InstallUpdateResponse, error)
// CreateWebCodeWithResponse performs a POST /v1/web/code (the `CreateWebCode` operationId) request.
//
// A one-time code (single use, valid a minute) that the web page trades for the admin key at /v1/web/session. Unix socket only.
//
// Returns a wrapper object for the known response body format(s).
CreateWebCodeWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*CreateWebCodeResponse, error)
// OpenWebSessionWithBodyWithResponse performs a POST /v1/web/session (the `OpenWebSession` operationId) request,
// with any type of body and a specified content type.
//
// Trade a code from /v1/web/code for the admin key the TCP listener holds. TCP listener only: it takes the code without a key, on a loopback address only; the unix socket answers 404.
//
// Returns a wrapper object for the known response body format(s).
OpenWebSessionWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*OpenWebSessionResponse, error)
// OpenWebSessionWithResponse performs a POST /v1/web/session (the `OpenWebSession` operationId) request.
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Trade a code from /v1/web/code for the admin key the TCP listener holds. TCP listener only: it takes the code without a key, on a loopback address only; the unix socket answers 404.
OpenWebSessionWithResponse(ctx context.Context, body OpenWebSessionJSONRequestBody, reqEditors ...RequestEditorFn) (*OpenWebSessionResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateWebCode200JSONResponse ¶
type CreateWebCode200JSONResponse WebCode
func (CreateWebCode200JSONResponse) VisitCreateWebCodeResponse ¶
func (response CreateWebCode200JSONResponse) VisitCreateWebCodeResponse(ctx fiber.Ctx) error
type CreateWebCode500JSONResponse ¶
type CreateWebCode500JSONResponse struct{ ErrorJSONResponse }
func (CreateWebCode500JSONResponse) VisitCreateWebCodeResponse ¶
func (response CreateWebCode500JSONResponse) VisitCreateWebCodeResponse(ctx fiber.Ctx) error
type CreateWebCodeRequestObject ¶
type CreateWebCodeRequestObject struct {
}
type CreateWebCodeResponse ¶
type CreateWebCodeResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *WebCode
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseCreateWebCodeResponse ¶
func ParseCreateWebCodeResponse(rsp *http.Response) (*CreateWebCodeResponse, error)
ParseCreateWebCodeResponse parses an HTTP response from a CreateWebCodeWithResponse call
func (CreateWebCodeResponse) ContentType ¶
func (r CreateWebCodeResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (CreateWebCodeResponse) GetBody ¶
func (r CreateWebCodeResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (CreateWebCodeResponse) GetJSON200 ¶
func (r CreateWebCodeResponse) GetJSON200() *WebCode
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (CreateWebCodeResponse) GetJSON500 ¶
func (r CreateWebCodeResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (CreateWebCodeResponse) Status ¶
func (r CreateWebCodeResponse) Status() string
Status returns HTTPResponse.Status
func (CreateWebCodeResponse) StatusCode ¶
func (r CreateWebCodeResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Error ¶
type Error struct {
// Code Every code, by status; notes in parentheses (the page's test reads the codes from this list).
// 400 bad_request (malformed request, also an empty login code), invalid_name, invalid_thresholds, invalid_strategy, invalid_lang, invalid_remote, invalid_config_dir (import: not a login dir in the ccswap home), login_incomplete,
// not_bundle (migrate import: not a ccswap bundle), bundle_version (migrate import: made by a newer ccswap),
// invalid_code (migrate import: the code is malformed), bad_bundle (migrate import: a wrong code or a damaged bundle),
// code_refused (login: claude got no login for the code; the link is spent);
// 401 unauthorized (TCP listener only: no key or a wrong one);
// 403 bad_code (web session: the code is wrong, used or expired), read_only (TCP listener only: the read key on a change),
// local_only (TCP listener only: a change or a web session on a listener that is not on a loopback address, or under a Host
// that names no loopback address or localhost);
// 404 not_found (also an unknown language of /v1/i18n, and a login code of an account removed meanwhile), no_entry (adopt: Claude Code has no login);
// 409 duplicate (also migrate import: an email here already without replace, or a name here with another email),
// remove_active, active_account (import: re-login the active account in claude),
// claude_owns (refresh login: the login is the one Claude Code uses, and Claude Code refreshes it itself),
// near_refresh, entry_changed (Claude Code kept rewriting its login during the switch), entry_expired (Claude Code's access token expired: it has not run for a while),
// target_refreshing (the target login has no access token yet: the daemon is refreshing it),
// unknown_active, cannot_identify, needs_login,
// migrating (the account is being moved to another machine: an export holds it),
// login_gone (login code: no link of the account with this id waits for a code, as none was started, or it expired,
// was used, was replaced or the daemon restarted), wrong_account (login code: the sign-in was another account's; the link is spent),
// login_pending (login: another link of the account waits for its code, until it is used or its 10 minutes run out),
// no_reset_credit (reset: the account has no reset credit left, as ccswap last saw or as Anthropic says),
// reset_changed (reset: the account's reset credits changed since the caller showed them, or another claim,
// such as Claude Code's, spent the credit first; nothing was spent), not_limited (reset: Anthropic spends
// this credit only at a limit), reset_cooldown (reset: Anthropic wants a pause between resets; the message
// says until when, if Anthropic said),
// migrate_active (migrate: the account, or its login, is the one Claude Code uses), export_gone (migrate: no such
// export: cancelled, expired, or forgotten by a daemon restart, possibly after its commit landed, so check
// whether the accounts are still here), export_done (migrate cancel: the export is committed already),
// tokens_changed (migrate commit: a login changed since packing; the export is cancelled),
// bundle_spent (migrate import with replace: the bundle's login was used already; nothing is imported),
// no_update (update: no release is newer than this build, or this build has no version to compare),
// updating (update, restart: one is running already, or is done and the daemon is restarting);
// 429 login_cooldown (login: a start that cannot replace a link, under 30 seconds after the account's last one;
// the message says when one is taken again);
// 500 internal;
// 502 bundle_unchecked (migrate import with replace: the bundle's login was not refreshed, as Anthropic failed or
// no time was left; nothing is imported, try again), refresh_failed (refresh login: Anthropic did not answer or
// refused for another reason than a spent login; the daemon tries again on its next tick),
// login_failed (login: claude auth login did not start, gave no link or did not answer the code in time),
// update_failed (update: GitHub failed, the download did not match its checksum, the new binary did not run, or
// the old one could not be replaced; nothing changed), reset_failed (reset: Anthropic did not answer, refused
// the login, asked to slow down or could not confirm the reset; trying again is safe).
Code string `json:"code"`
// Message A detail; clients show their own text per code
Message string `json:"message"`
}
Error defines model for Error.
type ErrorJSONResponse ¶
type ErrorJSONResponse Error
type FiberServerOptions ¶
type FiberServerOptions struct {
BaseURL string
Middlewares []MiddlewareFunc
HandlerMiddlewares []HandlerMiddlewareFunc
}
FiberServerOptions provides options for the Fiber server.
type FinishLogin200JSONResponse ¶ added in v0.2.0
type FinishLogin200JSONResponse Account
func (FinishLogin200JSONResponse) VisitFinishLoginResponse ¶ added in v0.2.0
func (response FinishLogin200JSONResponse) VisitFinishLoginResponse(ctx fiber.Ctx) error
type FinishLogin400JSONResponse ¶ added in v0.2.0
type FinishLogin400JSONResponse struct{ ErrorJSONResponse }
func (FinishLogin400JSONResponse) VisitFinishLoginResponse ¶ added in v0.2.0
func (response FinishLogin400JSONResponse) VisitFinishLoginResponse(ctx fiber.Ctx) error
type FinishLogin404JSONResponse ¶ added in v0.2.0
type FinishLogin404JSONResponse Error
func (FinishLogin404JSONResponse) VisitFinishLoginResponse ¶ added in v0.2.0
func (response FinishLogin404JSONResponse) VisitFinishLoginResponse(ctx fiber.Ctx) error
type FinishLogin409JSONResponse ¶ added in v0.2.0
type FinishLogin409JSONResponse Error
func (FinishLogin409JSONResponse) VisitFinishLoginResponse ¶ added in v0.2.0
func (response FinishLogin409JSONResponse) VisitFinishLoginResponse(ctx fiber.Ctx) error
type FinishLogin500JSONResponse ¶ added in v0.2.0
type FinishLogin500JSONResponse Error
func (FinishLogin500JSONResponse) VisitFinishLoginResponse ¶ added in v0.2.0
func (response FinishLogin500JSONResponse) VisitFinishLoginResponse(ctx fiber.Ctx) error
type FinishLogin502JSONResponse ¶ added in v0.2.0
type FinishLogin502JSONResponse Error
func (FinishLogin502JSONResponse) VisitFinishLoginResponse ¶ added in v0.2.0
func (response FinishLogin502JSONResponse) VisitFinishLoginResponse(ctx fiber.Ctx) error
type FinishLoginJSONRequestBody ¶ added in v0.2.0
type FinishLoginJSONRequestBody = LoginCode
FinishLoginJSONRequestBody defines body for FinishLogin for application/json ContentType.
type FinishLoginRequestObject ¶ added in v0.2.0
type FinishLoginRequestObject struct {
Name string `json:"name"`
Body *FinishLoginJSONRequestBody
}
type FinishLoginResponse ¶ added in v0.2.0
type FinishLoginResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Account
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
func ParseFinishLoginResponse ¶ added in v0.2.0
func ParseFinishLoginResponse(rsp *http.Response) (*FinishLoginResponse, error)
ParseFinishLoginResponse parses an HTTP response from a FinishLoginWithResponse call
func (FinishLoginResponse) ContentType ¶ added in v0.2.0
func (r FinishLoginResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (FinishLoginResponse) GetBody ¶ added in v0.2.0
func (r FinishLoginResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (FinishLoginResponse) GetJSON200 ¶ added in v0.2.0
func (r FinishLoginResponse) GetJSON200() *Account
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (FinishLoginResponse) GetJSON400 ¶ added in v0.2.0
func (r FinishLoginResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (FinishLoginResponse) GetJSON404 ¶ added in v0.2.0
func (r FinishLoginResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (FinishLoginResponse) GetJSON409 ¶ added in v0.2.0
func (r FinishLoginResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (FinishLoginResponse) GetJSON500 ¶ added in v0.2.0
func (r FinishLoginResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (FinishLoginResponse) GetJSON502 ¶ added in v0.2.0
func (r FinishLoginResponse) GetJSON502() *Error
GetJSON502 returns the response for an HTTP 502 `application/json` response
func (FinishLoginResponse) Status ¶ added in v0.2.0
func (r FinishLoginResponse) Status() string
Status returns HTTPResponse.Status
func (FinishLoginResponse) StatusCode ¶ added in v0.2.0
func (r FinishLoginResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type FinishLoginResponseObject ¶ added in v0.2.0
type GetEvents200TexteventStreamResponse ¶
func (GetEvents200TexteventStreamResponse) VisitGetEventsResponse ¶
func (response GetEvents200TexteventStreamResponse) VisitGetEventsResponse(ctx fiber.Ctx) error
type GetEvents500JSONResponse ¶
type GetEvents500JSONResponse struct{ ErrorJSONResponse }
func (GetEvents500JSONResponse) VisitGetEventsResponse ¶
func (response GetEvents500JSONResponse) VisitGetEventsResponse(ctx fiber.Ctx) error
type GetEventsRequestObject ¶
type GetEventsRequestObject struct {
}
type GetEventsResponse ¶
type GetEventsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseGetEventsResponse ¶
func ParseGetEventsResponse(rsp *http.Response) (*GetEventsResponse, error)
ParseGetEventsResponse parses an HTTP response from a GetEventsWithResponse call
func (GetEventsResponse) ContentType ¶
func (r GetEventsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetEventsResponse) GetBody ¶
func (r GetEventsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetEventsResponse) GetJSON500 ¶
func (r GetEventsResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (GetEventsResponse) Status ¶
func (r GetEventsResponse) Status() string
Status returns HTTPResponse.Status
func (GetEventsResponse) StatusCode ¶
func (r GetEventsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetEventsResponseObject ¶
type GetI18n200JSONResponse ¶
type GetI18n200JSONResponse struct {
Body Catalog
Headers GetI18n200ResponseHeaders
}
func (GetI18n200JSONResponse) VisitGetI18nResponse ¶
func (response GetI18n200JSONResponse) VisitGetI18nResponse(ctx fiber.Ctx) error
type GetI18n304Response ¶
type GetI18n304Response struct {
Headers GetI18n304ResponseHeaders
}
func (GetI18n304Response) VisitGetI18nResponse ¶
func (response GetI18n304Response) VisitGetI18nResponse(ctx fiber.Ctx) error
type GetI18n404JSONResponse ¶
type GetI18n404JSONResponse struct{ ErrorJSONResponse }
func (GetI18n404JSONResponse) VisitGetI18nResponse ¶
func (response GetI18n404JSONResponse) VisitGetI18nResponse(ctx fiber.Ctx) error
type GetI18nParams ¶
type GetI18nParams struct {
IfNoneMatch *string `json:"If-None-Match,omitempty"`
}
GetI18nParams defines parameters for GetI18n.
type GetI18nRequestObject ¶
type GetI18nRequestObject struct {
Lang string `json:"lang"`
Params GetI18nParams
}
type GetI18nResponse ¶
type GetI18nResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Catalog
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// Headers200 the parsed response headers for an HTTP 200 response
Headers200 *GetI18nResponse200Headers
// Headers304 the parsed response headers for an HTTP 304 response
Headers304 *GetI18nResponse304Headers
}
func ParseGetI18nResponse ¶
func ParseGetI18nResponse(rsp *http.Response) (*GetI18nResponse, error)
ParseGetI18nResponse parses an HTTP response from a GetI18nWithResponse call
func (GetI18nResponse) ContentType ¶
func (r GetI18nResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetI18nResponse) GetBody ¶
func (r GetI18nResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetI18nResponse) GetJSON200 ¶
func (r GetI18nResponse) GetJSON200() *Catalog
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetI18nResponse) GetJSON404 ¶
func (r GetI18nResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (GetI18nResponse) Status ¶
func (r GetI18nResponse) Status() string
Status returns HTTPResponse.Status
func (GetI18nResponse) StatusCode ¶
func (r GetI18nResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetI18nResponse200Headers ¶
GetI18nResponse200Headers the declared response headers of an HTTP 200 response for GetI18n
type GetI18nResponse304Headers ¶
GetI18nResponse304Headers the declared response headers of an HTTP 304 response for GetI18n
type GetI18nResponseObject ¶
type GetStatus200JSONResponse ¶
type GetStatus200JSONResponse Status
func (GetStatus200JSONResponse) VisitGetStatusResponse ¶
func (response GetStatus200JSONResponse) VisitGetStatusResponse(ctx fiber.Ctx) error
type GetStatus500JSONResponse ¶
type GetStatus500JSONResponse struct{ ErrorJSONResponse }
func (GetStatus500JSONResponse) VisitGetStatusResponse ¶
func (response GetStatus500JSONResponse) VisitGetStatusResponse(ctx fiber.Ctx) error
type GetStatusRequestObject ¶
type GetStatusRequestObject struct {
}
type GetStatusResponse ¶
type GetStatusResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Status
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseGetStatusResponse ¶
func ParseGetStatusResponse(rsp *http.Response) (*GetStatusResponse, error)
ParseGetStatusResponse parses an HTTP response from a GetStatusWithResponse call
func (GetStatusResponse) ContentType ¶
func (r GetStatusResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetStatusResponse) GetBody ¶
func (r GetStatusResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetStatusResponse) GetJSON200 ¶
func (r GetStatusResponse) GetJSON200() *Status
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetStatusResponse) GetJSON500 ¶
func (r GetStatusResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (GetStatusResponse) Status ¶
func (r GetStatusResponse) Status() string
Status returns HTTPResponse.Status
func (GetStatusResponse) StatusCode ¶
func (r GetStatusResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetStatusResponseObject ¶
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ImportAccount200JSONResponse ¶
type ImportAccount200JSONResponse Account
func (ImportAccount200JSONResponse) VisitImportAccountResponse ¶
func (response ImportAccount200JSONResponse) VisitImportAccountResponse(ctx fiber.Ctx) error
type ImportAccount400JSONResponse ¶
type ImportAccount400JSONResponse struct{ ErrorJSONResponse }
func (ImportAccount400JSONResponse) VisitImportAccountResponse ¶
func (response ImportAccount400JSONResponse) VisitImportAccountResponse(ctx fiber.Ctx) error
type ImportAccount409JSONResponse ¶
type ImportAccount409JSONResponse Error
func (ImportAccount409JSONResponse) VisitImportAccountResponse ¶
func (response ImportAccount409JSONResponse) VisitImportAccountResponse(ctx fiber.Ctx) error
type ImportAccount500JSONResponse ¶
type ImportAccount500JSONResponse Error
func (ImportAccount500JSONResponse) VisitImportAccountResponse ¶
func (response ImportAccount500JSONResponse) VisitImportAccountResponse(ctx fiber.Ctx) error
type ImportAccountJSONRequestBody ¶
type ImportAccountJSONRequestBody = ImportRequest
ImportAccountJSONRequestBody defines body for ImportAccount for application/json ContentType.
type ImportAccountRequestObject ¶
type ImportAccountRequestObject struct {
Body *ImportAccountJSONRequestBody
}
type ImportAccountResponse ¶
type ImportAccountResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Account
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseImportAccountResponse ¶
func ParseImportAccountResponse(rsp *http.Response) (*ImportAccountResponse, error)
ParseImportAccountResponse parses an HTTP response from a ImportAccountWithResponse call
func (ImportAccountResponse) ContentType ¶
func (r ImportAccountResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ImportAccountResponse) GetBody ¶
func (r ImportAccountResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ImportAccountResponse) GetJSON200 ¶
func (r ImportAccountResponse) GetJSON200() *Account
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (ImportAccountResponse) GetJSON400 ¶
func (r ImportAccountResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (ImportAccountResponse) GetJSON409 ¶
func (r ImportAccountResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (ImportAccountResponse) GetJSON500 ¶
func (r ImportAccountResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (ImportAccountResponse) Status ¶
func (r ImportAccountResponse) Status() string
Status returns HTTPResponse.Status
func (ImportAccountResponse) StatusCode ¶
func (r ImportAccountResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ImportRequest ¶
type ImportRequest struct {
ConfigDir string `json:"config_dir"`
Name string `json:"name"`
Priority *int `json:"priority,omitempty"`
}
ImportRequest defines model for ImportRequest.
type InstallUpdate200JSONResponse ¶ added in v0.2.0
type InstallUpdate200JSONResponse Release
func (InstallUpdate200JSONResponse) VisitInstallUpdateResponse ¶ added in v0.2.0
func (response InstallUpdate200JSONResponse) VisitInstallUpdateResponse(ctx fiber.Ctx) error
type InstallUpdate409JSONResponse ¶ added in v0.2.0
type InstallUpdate409JSONResponse struct{ ErrorJSONResponse }
func (InstallUpdate409JSONResponse) VisitInstallUpdateResponse ¶ added in v0.2.0
func (response InstallUpdate409JSONResponse) VisitInstallUpdateResponse(ctx fiber.Ctx) error
type InstallUpdate500JSONResponse ¶ added in v0.2.0
type InstallUpdate500JSONResponse Error
func (InstallUpdate500JSONResponse) VisitInstallUpdateResponse ¶ added in v0.2.0
func (response InstallUpdate500JSONResponse) VisitInstallUpdateResponse(ctx fiber.Ctx) error
type InstallUpdate502JSONResponse ¶ added in v0.2.0
type InstallUpdate502JSONResponse Error
func (InstallUpdate502JSONResponse) VisitInstallUpdateResponse ¶ added in v0.2.0
func (response InstallUpdate502JSONResponse) VisitInstallUpdateResponse(ctx fiber.Ctx) error
type InstallUpdateRequestObject ¶ added in v0.2.0
type InstallUpdateRequestObject struct {
}
type InstallUpdateResponse ¶ added in v0.2.0
type InstallUpdateResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Release
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
func ParseInstallUpdateResponse ¶ added in v0.2.0
func ParseInstallUpdateResponse(rsp *http.Response) (*InstallUpdateResponse, error)
ParseInstallUpdateResponse parses an HTTP response from a InstallUpdateWithResponse call
func (InstallUpdateResponse) ContentType ¶ added in v0.2.0
func (r InstallUpdateResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (InstallUpdateResponse) GetBody ¶ added in v0.2.0
func (r InstallUpdateResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (InstallUpdateResponse) GetJSON200 ¶ added in v0.2.0
func (r InstallUpdateResponse) GetJSON200() *Release
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (InstallUpdateResponse) GetJSON409 ¶ added in v0.2.0
func (r InstallUpdateResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (InstallUpdateResponse) GetJSON500 ¶ added in v0.2.0
func (r InstallUpdateResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (InstallUpdateResponse) GetJSON502 ¶ added in v0.2.0
func (r InstallUpdateResponse) GetJSON502() *Error
GetJSON502 returns the response for an HTTP 502 `application/json` response
func (InstallUpdateResponse) Status ¶ added in v0.2.0
func (r InstallUpdateResponse) Status() string
Status returns HTTPResponse.Status
func (InstallUpdateResponse) StatusCode ¶ added in v0.2.0
func (r InstallUpdateResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type InstallUpdateResponseObject ¶ added in v0.2.0
type LangRequest ¶
type LangRequest struct {
// Lang A language code ("en", see /v1/i18n) pins the language of messages and notifications in config.toml; "" follows the locale
Lang string `json:"lang"`
}
LangRequest defines model for LangRequest.
type ListAccounts200JSONResponse ¶
type ListAccounts200JSONResponse []Account
func (ListAccounts200JSONResponse) VisitListAccountsResponse ¶
func (response ListAccounts200JSONResponse) VisitListAccountsResponse(ctx fiber.Ctx) error
type ListAccounts500JSONResponse ¶
type ListAccounts500JSONResponse struct{ ErrorJSONResponse }
func (ListAccounts500JSONResponse) VisitListAccountsResponse ¶
func (response ListAccounts500JSONResponse) VisitListAccountsResponse(ctx fiber.Ctx) error
type ListAccountsRequestObject ¶
type ListAccountsRequestObject struct {
}
type ListAccountsResponse ¶
type ListAccountsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *[]Account
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseListAccountsResponse ¶
func ParseListAccountsResponse(rsp *http.Response) (*ListAccountsResponse, error)
ParseListAccountsResponse parses an HTTP response from a ListAccountsWithResponse call
func (ListAccountsResponse) ContentType ¶
func (r ListAccountsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ListAccountsResponse) GetBody ¶
func (r ListAccountsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ListAccountsResponse) GetJSON200 ¶
func (r ListAccountsResponse) GetJSON200() *[]Account
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (ListAccountsResponse) GetJSON500 ¶
func (r ListAccountsResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (ListAccountsResponse) Status ¶
func (r ListAccountsResponse) Status() string
Status returns HTTPResponse.Status
func (ListAccountsResponse) StatusCode ¶
func (r ListAccountsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type LoginCode ¶ added in v0.2.0
type LoginCode struct {
// Code The code the sign-in showed, CODE#STATE, or the callback URL that carries it
Code string `json:"code"`
// Id The id the link came with
Id string `json:"id"`
}
LoginCode defines model for LoginCode.
type LoginLink ¶ added in v0.2.0
type LoginLink struct {
// ExpiresAt The link is dropped then if no code came
ExpiresAt time.Time `json:"expires_at"`
// Id The link's id: only it finishes or cancels this link
Id string `json:"id"`
// Url The sign-in page claude auth login printed
Url string `json:"url"`
}
LoginLink defines model for LoginLink.
type MiddlewareFunc ¶
type MigrateCancel204Response ¶
type MigrateCancel204Response struct {
}
func (MigrateCancel204Response) VisitMigrateCancelResponse ¶
func (response MigrateCancel204Response) VisitMigrateCancelResponse(ctx fiber.Ctx) error
type MigrateCancel400JSONResponse ¶
type MigrateCancel400JSONResponse struct{ ErrorJSONResponse }
func (MigrateCancel400JSONResponse) VisitMigrateCancelResponse ¶
func (response MigrateCancel400JSONResponse) VisitMigrateCancelResponse(ctx fiber.Ctx) error
type MigrateCancel409JSONResponse ¶
type MigrateCancel409JSONResponse Error
func (MigrateCancel409JSONResponse) VisitMigrateCancelResponse ¶
func (response MigrateCancel409JSONResponse) VisitMigrateCancelResponse(ctx fiber.Ctx) error
type MigrateCancel500JSONResponse ¶
type MigrateCancel500JSONResponse Error
func (MigrateCancel500JSONResponse) VisitMigrateCancelResponse ¶
func (response MigrateCancel500JSONResponse) VisitMigrateCancelResponse(ctx fiber.Ctx) error
type MigrateCancelJSONRequestBody ¶
type MigrateCancelJSONRequestBody = MigrateTokenRequest
MigrateCancelJSONRequestBody defines body for MigrateCancel for application/json ContentType.
type MigrateCancelRequestObject ¶
type MigrateCancelRequestObject struct {
Body *MigrateCancelJSONRequestBody
}
type MigrateCancelResponse ¶
type MigrateCancelResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseMigrateCancelResponse ¶
func ParseMigrateCancelResponse(rsp *http.Response) (*MigrateCancelResponse, error)
ParseMigrateCancelResponse parses an HTTP response from a MigrateCancelWithResponse call
func (MigrateCancelResponse) ContentType ¶
func (r MigrateCancelResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (MigrateCancelResponse) GetBody ¶
func (r MigrateCancelResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (MigrateCancelResponse) GetJSON400 ¶
func (r MigrateCancelResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (MigrateCancelResponse) GetJSON409 ¶
func (r MigrateCancelResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (MigrateCancelResponse) GetJSON500 ¶
func (r MigrateCancelResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (MigrateCancelResponse) Status ¶
func (r MigrateCancelResponse) Status() string
Status returns HTTPResponse.Status
func (MigrateCancelResponse) StatusCode ¶
func (r MigrateCancelResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MigrateCommit204Response ¶
type MigrateCommit204Response struct {
}
func (MigrateCommit204Response) VisitMigrateCommitResponse ¶
func (response MigrateCommit204Response) VisitMigrateCommitResponse(ctx fiber.Ctx) error
type MigrateCommit400JSONResponse ¶
type MigrateCommit400JSONResponse struct{ ErrorJSONResponse }
func (MigrateCommit400JSONResponse) VisitMigrateCommitResponse ¶
func (response MigrateCommit400JSONResponse) VisitMigrateCommitResponse(ctx fiber.Ctx) error
type MigrateCommit409JSONResponse ¶
type MigrateCommit409JSONResponse Error
func (MigrateCommit409JSONResponse) VisitMigrateCommitResponse ¶
func (response MigrateCommit409JSONResponse) VisitMigrateCommitResponse(ctx fiber.Ctx) error
type MigrateCommit500JSONResponse ¶
type MigrateCommit500JSONResponse Error
func (MigrateCommit500JSONResponse) VisitMigrateCommitResponse ¶
func (response MigrateCommit500JSONResponse) VisitMigrateCommitResponse(ctx fiber.Ctx) error
type MigrateCommitJSONRequestBody ¶
type MigrateCommitJSONRequestBody = MigrateTokenRequest
MigrateCommitJSONRequestBody defines body for MigrateCommit for application/json ContentType.
type MigrateCommitRequestObject ¶
type MigrateCommitRequestObject struct {
Body *MigrateCommitJSONRequestBody
}
type MigrateCommitResponse ¶
type MigrateCommitResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseMigrateCommitResponse ¶
func ParseMigrateCommitResponse(rsp *http.Response) (*MigrateCommitResponse, error)
ParseMigrateCommitResponse parses an HTTP response from a MigrateCommitWithResponse call
func (MigrateCommitResponse) ContentType ¶
func (r MigrateCommitResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (MigrateCommitResponse) GetBody ¶
func (r MigrateCommitResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (MigrateCommitResponse) GetJSON400 ¶
func (r MigrateCommitResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (MigrateCommitResponse) GetJSON409 ¶
func (r MigrateCommitResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (MigrateCommitResponse) GetJSON500 ¶
func (r MigrateCommitResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (MigrateCommitResponse) Status ¶
func (r MigrateCommitResponse) Status() string
Status returns HTTPResponse.Status
func (MigrateCommitResponse) StatusCode ¶
func (r MigrateCommitResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MigrateExport ¶
type MigrateExport struct {
// Bundle The encrypted accounts as ASCII armor
Bundle string `json:"bundle"`
// Code The one-time code that opens the bundle; show it once, never store it
Code string `json:"code"`
// ExpiresAt The export is cancelled if not committed by then
ExpiresAt time.Time `json:"expires_at"`
// Token Names this export to /v1/migrate/commit and /v1/migrate/cancel
Token string `json:"token"`
}
MigrateExport defines model for MigrateExport.
type MigrateExport200JSONResponse ¶
type MigrateExport200JSONResponse MigrateExport
func (MigrateExport200JSONResponse) VisitMigrateExportResponse ¶
func (response MigrateExport200JSONResponse) VisitMigrateExportResponse(ctx fiber.Ctx) error
type MigrateExport400JSONResponse ¶
type MigrateExport400JSONResponse struct{ ErrorJSONResponse }
func (MigrateExport400JSONResponse) VisitMigrateExportResponse ¶
func (response MigrateExport400JSONResponse) VisitMigrateExportResponse(ctx fiber.Ctx) error
type MigrateExport404JSONResponse ¶
type MigrateExport404JSONResponse Error
func (MigrateExport404JSONResponse) VisitMigrateExportResponse ¶
func (response MigrateExport404JSONResponse) VisitMigrateExportResponse(ctx fiber.Ctx) error
type MigrateExport409JSONResponse ¶
type MigrateExport409JSONResponse Error
func (MigrateExport409JSONResponse) VisitMigrateExportResponse ¶
func (response MigrateExport409JSONResponse) VisitMigrateExportResponse(ctx fiber.Ctx) error
type MigrateExport500JSONResponse ¶
type MigrateExport500JSONResponse Error
func (MigrateExport500JSONResponse) VisitMigrateExportResponse ¶
func (response MigrateExport500JSONResponse) VisitMigrateExportResponse(ctx fiber.Ctx) error
type MigrateExportJSONRequestBody ¶
type MigrateExportJSONRequestBody = MigrateExportRequest
MigrateExportJSONRequestBody defines body for MigrateExport for application/json ContentType.
type MigrateExportRequest ¶
type MigrateExportRequest struct {
Names []string `json:"names"`
}
MigrateExportRequest defines model for MigrateExportRequest.
type MigrateExportRequestObject ¶
type MigrateExportRequestObject struct {
Body *MigrateExportJSONRequestBody
}
type MigrateExportResponse ¶
type MigrateExportResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *MigrateExport
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseMigrateExportResponse ¶
func ParseMigrateExportResponse(rsp *http.Response) (*MigrateExportResponse, error)
ParseMigrateExportResponse parses an HTTP response from a MigrateExportWithResponse call
func (MigrateExportResponse) ContentType ¶
func (r MigrateExportResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (MigrateExportResponse) GetBody ¶
func (r MigrateExportResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (MigrateExportResponse) GetJSON200 ¶
func (r MigrateExportResponse) GetJSON200() *MigrateExport
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (MigrateExportResponse) GetJSON400 ¶
func (r MigrateExportResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (MigrateExportResponse) GetJSON404 ¶
func (r MigrateExportResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (MigrateExportResponse) GetJSON409 ¶
func (r MigrateExportResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (MigrateExportResponse) GetJSON500 ¶
func (r MigrateExportResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (MigrateExportResponse) Status ¶
func (r MigrateExportResponse) Status() string
Status returns HTTPResponse.Status
func (MigrateExportResponse) StatusCode ¶
func (r MigrateExportResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MigrateImport ¶
type MigrateImport struct {
Accounts []Account `json:"accounts"`
}
MigrateImport defines model for MigrateImport.
type MigrateImport200JSONResponse ¶
type MigrateImport200JSONResponse MigrateImport
func (MigrateImport200JSONResponse) VisitMigrateImportResponse ¶
func (response MigrateImport200JSONResponse) VisitMigrateImportResponse(ctx fiber.Ctx) error
type MigrateImport400JSONResponse ¶
type MigrateImport400JSONResponse struct{ ErrorJSONResponse }
func (MigrateImport400JSONResponse) VisitMigrateImportResponse ¶
func (response MigrateImport400JSONResponse) VisitMigrateImportResponse(ctx fiber.Ctx) error
type MigrateImport409JSONResponse ¶
type MigrateImport409JSONResponse Error
func (MigrateImport409JSONResponse) VisitMigrateImportResponse ¶
func (response MigrateImport409JSONResponse) VisitMigrateImportResponse(ctx fiber.Ctx) error
type MigrateImport500JSONResponse ¶
type MigrateImport500JSONResponse Error
func (MigrateImport500JSONResponse) VisitMigrateImportResponse ¶
func (response MigrateImport500JSONResponse) VisitMigrateImportResponse(ctx fiber.Ctx) error
type MigrateImport502JSONResponse ¶
type MigrateImport502JSONResponse Error
func (MigrateImport502JSONResponse) VisitMigrateImportResponse ¶
func (response MigrateImport502JSONResponse) VisitMigrateImportResponse(ctx fiber.Ctx) error
type MigrateImportJSONRequestBody ¶
type MigrateImportJSONRequestBody = MigrateImportRequest
MigrateImportJSONRequestBody defines body for MigrateImport for application/json ContentType.
type MigrateImportRequest ¶
type MigrateImportRequest struct {
Bundle string `json:"bundle"`
Code string `json:"code"`
// Replace Replace the login of an account here with the same email
Replace bool `json:"replace"`
}
MigrateImportRequest defines model for MigrateImportRequest.
type MigrateImportRequestObject ¶
type MigrateImportRequestObject struct {
Body *MigrateImportJSONRequestBody
}
type MigrateImportResponse ¶
type MigrateImportResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *MigrateImport
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
func ParseMigrateImportResponse ¶
func ParseMigrateImportResponse(rsp *http.Response) (*MigrateImportResponse, error)
ParseMigrateImportResponse parses an HTTP response from a MigrateImportWithResponse call
func (MigrateImportResponse) ContentType ¶
func (r MigrateImportResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (MigrateImportResponse) GetBody ¶
func (r MigrateImportResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (MigrateImportResponse) GetJSON200 ¶
func (r MigrateImportResponse) GetJSON200() *MigrateImport
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (MigrateImportResponse) GetJSON400 ¶
func (r MigrateImportResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (MigrateImportResponse) GetJSON409 ¶
func (r MigrateImportResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (MigrateImportResponse) GetJSON500 ¶
func (r MigrateImportResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (MigrateImportResponse) GetJSON502 ¶
func (r MigrateImportResponse) GetJSON502() *Error
GetJSON502 returns the response for an HTTP 502 `application/json` response
func (MigrateImportResponse) Status ¶
func (r MigrateImportResponse) Status() string
Status returns HTTPResponse.Status
func (MigrateImportResponse) StatusCode ¶
func (r MigrateImportResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type MigrateTokenRequest ¶
type MigrateTokenRequest struct {
Token string `json:"token"`
}
MigrateTokenRequest defines model for MigrateTokenRequest.
type ModelWindow ¶
type ModelWindow struct {
Name string `json:"name"`
ResetsAt *time.Time `json:"resets_at,omitempty"`
Utilization float64 `json:"utilization"`
}
ModelWindow defines model for ModelWindow.
type OpenWebSession200JSONResponse ¶
type OpenWebSession200JSONResponse WebSession
func (OpenWebSession200JSONResponse) VisitOpenWebSessionResponse ¶
func (response OpenWebSession200JSONResponse) VisitOpenWebSessionResponse(ctx fiber.Ctx) error
type OpenWebSession400JSONResponse ¶
type OpenWebSession400JSONResponse struct{ ErrorJSONResponse }
func (OpenWebSession400JSONResponse) VisitOpenWebSessionResponse ¶
func (response OpenWebSession400JSONResponse) VisitOpenWebSessionResponse(ctx fiber.Ctx) error
type OpenWebSession403JSONResponse ¶
type OpenWebSession403JSONResponse Error
func (OpenWebSession403JSONResponse) VisitOpenWebSessionResponse ¶
func (response OpenWebSession403JSONResponse) VisitOpenWebSessionResponse(ctx fiber.Ctx) error
type OpenWebSession404JSONResponse ¶
type OpenWebSession404JSONResponse Error
func (OpenWebSession404JSONResponse) VisitOpenWebSessionResponse ¶
func (response OpenWebSession404JSONResponse) VisitOpenWebSessionResponse(ctx fiber.Ctx) error
type OpenWebSession500JSONResponse ¶
type OpenWebSession500JSONResponse Error
func (OpenWebSession500JSONResponse) VisitOpenWebSessionResponse ¶
func (response OpenWebSession500JSONResponse) VisitOpenWebSessionResponse(ctx fiber.Ctx) error
type OpenWebSessionJSONRequestBody ¶
type OpenWebSessionJSONRequestBody = WebSessionRequest
OpenWebSessionJSONRequestBody defines body for OpenWebSession for application/json ContentType.
type OpenWebSessionRequestObject ¶
type OpenWebSessionRequestObject struct {
Body *OpenWebSessionJSONRequestBody
}
type OpenWebSessionResponse ¶
type OpenWebSessionResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *WebSession
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON403 the response for an HTTP 403 `application/json` response
JSON403 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseOpenWebSessionResponse ¶
func ParseOpenWebSessionResponse(rsp *http.Response) (*OpenWebSessionResponse, error)
ParseOpenWebSessionResponse parses an HTTP response from a OpenWebSessionWithResponse call
func (OpenWebSessionResponse) ContentType ¶
func (r OpenWebSessionResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (OpenWebSessionResponse) GetBody ¶
func (r OpenWebSessionResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (OpenWebSessionResponse) GetJSON200 ¶
func (r OpenWebSessionResponse) GetJSON200() *WebSession
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (OpenWebSessionResponse) GetJSON400 ¶
func (r OpenWebSessionResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (OpenWebSessionResponse) GetJSON403 ¶
func (r OpenWebSessionResponse) GetJSON403() *Error
GetJSON403 returns the response for an HTTP 403 `application/json` response
func (OpenWebSessionResponse) GetJSON404 ¶
func (r OpenWebSessionResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (OpenWebSessionResponse) GetJSON500 ¶
func (r OpenWebSessionResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (OpenWebSessionResponse) Status ¶
func (r OpenWebSessionResponse) Status() string
Status returns HTTPResponse.Status
func (OpenWebSessionResponse) StatusCode ¶
func (r OpenWebSessionResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PatchAccount200JSONResponse ¶
type PatchAccount200JSONResponse Account
func (PatchAccount200JSONResponse) VisitPatchAccountResponse ¶
func (response PatchAccount200JSONResponse) VisitPatchAccountResponse(ctx fiber.Ctx) error
type PatchAccount400JSONResponse ¶
type PatchAccount400JSONResponse struct{ ErrorJSONResponse }
func (PatchAccount400JSONResponse) VisitPatchAccountResponse ¶
func (response PatchAccount400JSONResponse) VisitPatchAccountResponse(ctx fiber.Ctx) error
type PatchAccount404JSONResponse ¶
type PatchAccount404JSONResponse Error
func (PatchAccount404JSONResponse) VisitPatchAccountResponse ¶
func (response PatchAccount404JSONResponse) VisitPatchAccountResponse(ctx fiber.Ctx) error
type PatchAccount500JSONResponse ¶
type PatchAccount500JSONResponse Error
func (PatchAccount500JSONResponse) VisitPatchAccountResponse ¶
func (response PatchAccount500JSONResponse) VisitPatchAccountResponse(ctx fiber.Ctx) error
type PatchAccountJSONRequestBody ¶
type PatchAccountJSONRequestBody = AccountPatch
PatchAccountJSONRequestBody defines body for PatchAccount for application/json ContentType.
type PatchAccountRequestObject ¶
type PatchAccountRequestObject struct {
Name string `json:"name"`
Body *PatchAccountJSONRequestBody
}
type PatchAccountResponse ¶
type PatchAccountResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Account
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParsePatchAccountResponse ¶
func ParsePatchAccountResponse(rsp *http.Response) (*PatchAccountResponse, error)
ParsePatchAccountResponse parses an HTTP response from a PatchAccountWithResponse call
func (PatchAccountResponse) ContentType ¶
func (r PatchAccountResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (PatchAccountResponse) GetBody ¶
func (r PatchAccountResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (PatchAccountResponse) GetJSON200 ¶
func (r PatchAccountResponse) GetJSON200() *Account
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (PatchAccountResponse) GetJSON400 ¶
func (r PatchAccountResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (PatchAccountResponse) GetJSON404 ¶
func (r PatchAccountResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (PatchAccountResponse) GetJSON500 ¶
func (r PatchAccountResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (PatchAccountResponse) Status ¶
func (r PatchAccountResponse) Status() string
Status returns HTTPResponse.Status
func (PatchAccountResponse) StatusCode ¶
func (r PatchAccountResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Refresh204Response ¶
type Refresh204Response struct {
}
func (Refresh204Response) VisitRefreshResponse ¶
func (response Refresh204Response) VisitRefreshResponse(ctx fiber.Ctx) error
type Refresh500JSONResponse ¶
type Refresh500JSONResponse struct{ ErrorJSONResponse }
func (Refresh500JSONResponse) VisitRefreshResponse ¶
func (response Refresh500JSONResponse) VisitRefreshResponse(ctx fiber.Ctx) error
type RefreshLogin200JSONResponse ¶ added in v0.2.0
type RefreshLogin200JSONResponse Account
func (RefreshLogin200JSONResponse) VisitRefreshLoginResponse ¶ added in v0.2.0
func (response RefreshLogin200JSONResponse) VisitRefreshLoginResponse(ctx fiber.Ctx) error
type RefreshLogin404JSONResponse ¶ added in v0.2.0
type RefreshLogin404JSONResponse struct{ ErrorJSONResponse }
func (RefreshLogin404JSONResponse) VisitRefreshLoginResponse ¶ added in v0.2.0
func (response RefreshLogin404JSONResponse) VisitRefreshLoginResponse(ctx fiber.Ctx) error
type RefreshLogin409JSONResponse ¶ added in v0.2.0
type RefreshLogin409JSONResponse Error
func (RefreshLogin409JSONResponse) VisitRefreshLoginResponse ¶ added in v0.2.0
func (response RefreshLogin409JSONResponse) VisitRefreshLoginResponse(ctx fiber.Ctx) error
type RefreshLogin500JSONResponse ¶ added in v0.2.0
type RefreshLogin500JSONResponse Error
func (RefreshLogin500JSONResponse) VisitRefreshLoginResponse ¶ added in v0.2.0
func (response RefreshLogin500JSONResponse) VisitRefreshLoginResponse(ctx fiber.Ctx) error
type RefreshLogin502JSONResponse ¶ added in v0.2.0
type RefreshLogin502JSONResponse Error
func (RefreshLogin502JSONResponse) VisitRefreshLoginResponse ¶ added in v0.2.0
func (response RefreshLogin502JSONResponse) VisitRefreshLoginResponse(ctx fiber.Ctx) error
type RefreshLoginRequestObject ¶ added in v0.2.0
type RefreshLoginRequestObject struct {
Name string `json:"name"`
}
type RefreshLoginResponse ¶ added in v0.2.0
type RefreshLoginResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Account
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
func ParseRefreshLoginResponse ¶ added in v0.2.0
func ParseRefreshLoginResponse(rsp *http.Response) (*RefreshLoginResponse, error)
ParseRefreshLoginResponse parses an HTTP response from a RefreshLoginWithResponse call
func (RefreshLoginResponse) ContentType ¶ added in v0.2.0
func (r RefreshLoginResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (RefreshLoginResponse) GetBody ¶ added in v0.2.0
func (r RefreshLoginResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (RefreshLoginResponse) GetJSON200 ¶ added in v0.2.0
func (r RefreshLoginResponse) GetJSON200() *Account
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (RefreshLoginResponse) GetJSON404 ¶ added in v0.2.0
func (r RefreshLoginResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (RefreshLoginResponse) GetJSON409 ¶ added in v0.2.0
func (r RefreshLoginResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (RefreshLoginResponse) GetJSON500 ¶ added in v0.2.0
func (r RefreshLoginResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (RefreshLoginResponse) GetJSON502 ¶ added in v0.2.0
func (r RefreshLoginResponse) GetJSON502() *Error
GetJSON502 returns the response for an HTTP 502 `application/json` response
func (RefreshLoginResponse) Status ¶ added in v0.2.0
func (r RefreshLoginResponse) Status() string
Status returns HTTPResponse.Status
func (RefreshLoginResponse) StatusCode ¶ added in v0.2.0
func (r RefreshLoginResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RefreshLoginResponseObject ¶ added in v0.2.0
type RefreshRequestObject ¶
type RefreshRequestObject struct {
}
type RefreshResponse ¶
type RefreshResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseRefreshResponse ¶
func ParseRefreshResponse(rsp *http.Response) (*RefreshResponse, error)
ParseRefreshResponse parses an HTTP response from a RefreshWithResponse call
func (RefreshResponse) ContentType ¶
func (r RefreshResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (RefreshResponse) GetBody ¶
func (r RefreshResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (RefreshResponse) GetJSON500 ¶
func (r RefreshResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (RefreshResponse) Status ¶
func (r RefreshResponse) Status() string
Status returns HTTPResponse.Status
func (RefreshResponse) StatusCode ¶
func (r RefreshResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RefreshResponseObject ¶
type Release ¶ added in v0.2.0
type Release struct {
// Url Its page on GitHub
Url string `json:"url"`
// Version Its tag
Version string `json:"version"`
}
Release A ccswap release. In Status, the newest one when it is newer than this build, as of the daemon's last check on GitHub; absent before that check, while [update] check is off, and when this build has no version.
type Remote ¶
type Remote struct {
// CheckedAt Last answer
CheckedAt *time.Time `json:"checked_at,omitempty"`
// Error Why the last ask failed; accounts then ask Anthropic directly
Error *string `json:"error,omitempty"`
// Ok The last ask got an answer
Ok bool `json:"ok"`
Url string `json:"url"`
}
Remote The ccswap usage is taken from; absent when this daemon asks Anthropic itself.
type RemoteRequest ¶
type RemoteRequest struct {
// Key The other ccswap's management key; omitted keeps the stored one
Key *string `json:"key,omitempty"`
// Url https://..., or http to a loopback or private address; empty turns remote usage off
Url string `json:"url"`
}
RemoteRequest defines model for RemoteRequest.
type RemoveAccount204Response ¶
type RemoveAccount204Response struct {
}
func (RemoveAccount204Response) VisitRemoveAccountResponse ¶
func (response RemoveAccount204Response) VisitRemoveAccountResponse(ctx fiber.Ctx) error
type RemoveAccount404JSONResponse ¶
type RemoveAccount404JSONResponse struct{ ErrorJSONResponse }
func (RemoveAccount404JSONResponse) VisitRemoveAccountResponse ¶
func (response RemoveAccount404JSONResponse) VisitRemoveAccountResponse(ctx fiber.Ctx) error
type RemoveAccount409JSONResponse ¶
type RemoveAccount409JSONResponse Error
func (RemoveAccount409JSONResponse) VisitRemoveAccountResponse ¶
func (response RemoveAccount409JSONResponse) VisitRemoveAccountResponse(ctx fiber.Ctx) error
type RemoveAccount500JSONResponse ¶
type RemoveAccount500JSONResponse Error
func (RemoveAccount500JSONResponse) VisitRemoveAccountResponse ¶
func (response RemoveAccount500JSONResponse) VisitRemoveAccountResponse(ctx fiber.Ctx) error
type RemoveAccountRequestObject ¶
type RemoveAccountRequestObject struct {
Name string `json:"name"`
}
type RemoveAccountResponse ¶
type RemoveAccountResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseRemoveAccountResponse ¶
func ParseRemoveAccountResponse(rsp *http.Response) (*RemoveAccountResponse, error)
ParseRemoveAccountResponse parses an HTTP response from a RemoveAccountWithResponse call
func (RemoveAccountResponse) ContentType ¶
func (r RemoveAccountResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (RemoveAccountResponse) GetBody ¶
func (r RemoveAccountResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (RemoveAccountResponse) GetJSON404 ¶
func (r RemoveAccountResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (RemoveAccountResponse) GetJSON409 ¶
func (r RemoveAccountResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (RemoveAccountResponse) GetJSON500 ¶
func (r RemoveAccountResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (RemoveAccountResponse) Status ¶
func (r RemoveAccountResponse) Status() string
Status returns HTTPResponse.Status
func (RemoveAccountResponse) StatusCode ¶
func (r RemoveAccountResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type ResetGrant ¶ added in v0.5.0
type ResetGrant struct {
// EndsAt When it runs out; absent when it does not
EndsAt *time.Time `json:"ends_at,omitempty"`
// Id Anthropic's id of the grant
Id string `json:"id"`
// Left Resets left of it
Left int `json:"left"`
}
ResetGrant defines model for ResetGrant.
type Resets ¶ added in v0.5.0
type Resets struct {
// EndsAt When the grant a reset spends next runs out; absent when it does not
EndsAt *time.Time `json:"ends_at,omitempty"`
// Grants The grants left, the one a reset spends next first; ccswap remote takes them from here
Grants []ResetGrant `json:"grants"`
// Left Resets the account can spend now
Left int `json:"left"`
}
Resets The account's reset credits, which /v1/accounts/{name}/reset spends: grants of limit resets Anthropic gave it, such as one at a model launch. Absent when it has none usable now, while it needs a login, and before Anthropic said; Anthropic says only to a recent Claude Code, whose version the daemon sends.
type Restart ¶ added in v0.2.0
type Restart struct {
// Bin The binary the daemon runs; empty when it does not know
Bin string `json:"bin"`
// Restarting The daemon runs bin and is restarting on it
Restarting bool `json:"restarting"`
}
Restart defines model for Restart.
type Restart200JSONResponse ¶ added in v0.2.0
type Restart200JSONResponse Restart
func (Restart200JSONResponse) VisitRestartResponse ¶ added in v0.2.0
func (response Restart200JSONResponse) VisitRestartResponse(ctx fiber.Ctx) error
type Restart400JSONResponse ¶ added in v0.2.0
type Restart400JSONResponse struct{ ErrorJSONResponse }
func (Restart400JSONResponse) VisitRestartResponse ¶ added in v0.2.0
func (response Restart400JSONResponse) VisitRestartResponse(ctx fiber.Ctx) error
type Restart409JSONResponse ¶ added in v0.2.0
type Restart409JSONResponse Error
func (Restart409JSONResponse) VisitRestartResponse ¶ added in v0.2.0
func (response Restart409JSONResponse) VisitRestartResponse(ctx fiber.Ctx) error
type Restart500JSONResponse ¶ added in v0.2.0
type Restart500JSONResponse Error
func (Restart500JSONResponse) VisitRestartResponse ¶ added in v0.2.0
func (response Restart500JSONResponse) VisitRestartResponse(ctx fiber.Ctx) error
type RestartJSONRequestBody ¶ added in v0.2.0
type RestartJSONRequestBody = RestartRequest
RestartJSONRequestBody defines body for Restart for application/json ContentType.
type RestartRequest ¶ added in v0.2.0
type RestartRequest struct {
// Bin The binary ccswap update replaced
Bin string `json:"bin"`
}
RestartRequest defines model for RestartRequest.
type RestartRequestObject ¶ added in v0.2.0
type RestartRequestObject struct {
Body *RestartJSONRequestBody
}
type RestartResponse ¶ added in v0.2.0
type RestartResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Restart
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseRestartResponse ¶ added in v0.2.0
func ParseRestartResponse(rsp *http.Response) (*RestartResponse, error)
ParseRestartResponse parses an HTTP response from a RestartWithResponse call
func (RestartResponse) ContentType ¶ added in v0.2.0
func (r RestartResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (RestartResponse) GetBody ¶ added in v0.2.0
func (r RestartResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (RestartResponse) GetJSON200 ¶ added in v0.2.0
func (r RestartResponse) GetJSON200() *Restart
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (RestartResponse) GetJSON400 ¶ added in v0.2.0
func (r RestartResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (RestartResponse) GetJSON409 ¶ added in v0.2.0
func (r RestartResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (RestartResponse) GetJSON500 ¶ added in v0.2.0
func (r RestartResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (RestartResponse) Status ¶ added in v0.2.0
func (r RestartResponse) Status() string
Status returns HTTPResponse.Status
func (RestartResponse) StatusCode ¶ added in v0.2.0
func (r RestartResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RestartResponseObject ¶ added in v0.2.0
type ServerInterface ¶
type ServerInterface interface {
// (GET /v1/accounts)
ListAccounts(c fiber.Ctx) error
// (POST /v1/accounts)
ImportAccount(c fiber.Ctx) error
// (POST /v1/accounts/adopt)
AdoptAccount(c fiber.Ctx) error
// (DELETE /v1/accounts/{name})
RemoveAccount(c fiber.Ctx, name string) error
// (PATCH /v1/accounts/{name})
PatchAccount(c fiber.Ctx, name string) error
// (POST /v1/accounts/{name}/activate)
ActivateAccount(c fiber.Ctx, name string, params ActivateAccountParams) error
// (DELETE /v1/accounts/{name}/login)
CancelLogin(c fiber.Ctx, name string, params CancelLoginParams) error
// (POST /v1/accounts/{name}/login)
StartLogin(c fiber.Ctx, name string) error
// (POST /v1/accounts/{name}/login/code)
FinishLogin(c fiber.Ctx, name string) error
// (POST /v1/accounts/{name}/refresh)
RefreshLogin(c fiber.Ctx, name string) error
// (POST /v1/accounts/{name}/reset)
UseReset(c fiber.Ctx, name string) error
// (PUT /v1/auto)
SetAuto(c fiber.Ctx) error
// (GET /v1/events)
GetEvents(c fiber.Ctx) error
// (GET /v1/i18n/{lang})
GetI18n(c fiber.Ctx, lang string, params GetI18nParams) error
// (PUT /v1/lang)
SetLang(c fiber.Ctx) error
// (POST /v1/migrate/cancel)
MigrateCancel(c fiber.Ctx) error
// (POST /v1/migrate/commit)
MigrateCommit(c fiber.Ctx) error
// (POST /v1/migrate/export)
MigrateExport(c fiber.Ctx) error
// (POST /v1/migrate/import)
MigrateImport(c fiber.Ctx) error
// (POST /v1/refresh)
Refresh(c fiber.Ctx) error
// (PUT /v1/remote)
SetRemote(c fiber.Ctx) error
// (POST /v1/restart)
Restart(c fiber.Ctx) error
// (POST /v1/signal)
Signal(c fiber.Ctx) error
// (GET /v1/status)
GetStatus(c fiber.Ctx) error
// (PUT /v1/strategy)
SetStrategy(c fiber.Ctx) error
// (PUT /v1/thresholds)
SetThresholds(c fiber.Ctx) error
// (POST /v1/update)
InstallUpdate(c fiber.Ctx) error
// (POST /v1/web/code)
CreateWebCode(c fiber.Ctx) error
// (POST /v1/web/session)
OpenWebSession(c fiber.Ctx) error
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []HandlerMiddlewareFunc
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) ActivateAccount ¶
func (siw *ServerInterfaceWrapper) ActivateAccount(c fiber.Ctx) error
ActivateAccount operation middleware
func (*ServerInterfaceWrapper) AdoptAccount ¶
func (siw *ServerInterfaceWrapper) AdoptAccount(c fiber.Ctx) error
AdoptAccount operation middleware
func (*ServerInterfaceWrapper) CancelLogin ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) CancelLogin(c fiber.Ctx) error
CancelLogin operation middleware
func (*ServerInterfaceWrapper) CreateWebCode ¶
func (siw *ServerInterfaceWrapper) CreateWebCode(c fiber.Ctx) error
CreateWebCode operation middleware
func (*ServerInterfaceWrapper) FinishLogin ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) FinishLogin(c fiber.Ctx) error
FinishLogin operation middleware
func (*ServerInterfaceWrapper) GetEvents ¶
func (siw *ServerInterfaceWrapper) GetEvents(c fiber.Ctx) error
GetEvents operation middleware
func (*ServerInterfaceWrapper) GetI18n ¶
func (siw *ServerInterfaceWrapper) GetI18n(c fiber.Ctx) error
GetI18n operation middleware
func (*ServerInterfaceWrapper) GetStatus ¶
func (siw *ServerInterfaceWrapper) GetStatus(c fiber.Ctx) error
GetStatus operation middleware
func (*ServerInterfaceWrapper) ImportAccount ¶
func (siw *ServerInterfaceWrapper) ImportAccount(c fiber.Ctx) error
ImportAccount operation middleware
func (*ServerInterfaceWrapper) InstallUpdate ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) InstallUpdate(c fiber.Ctx) error
InstallUpdate operation middleware
func (*ServerInterfaceWrapper) ListAccounts ¶
func (siw *ServerInterfaceWrapper) ListAccounts(c fiber.Ctx) error
ListAccounts operation middleware
func (*ServerInterfaceWrapper) MigrateCancel ¶
func (siw *ServerInterfaceWrapper) MigrateCancel(c fiber.Ctx) error
MigrateCancel operation middleware
func (*ServerInterfaceWrapper) MigrateCommit ¶
func (siw *ServerInterfaceWrapper) MigrateCommit(c fiber.Ctx) error
MigrateCommit operation middleware
func (*ServerInterfaceWrapper) MigrateExport ¶
func (siw *ServerInterfaceWrapper) MigrateExport(c fiber.Ctx) error
MigrateExport operation middleware
func (*ServerInterfaceWrapper) MigrateImport ¶
func (siw *ServerInterfaceWrapper) MigrateImport(c fiber.Ctx) error
MigrateImport operation middleware
func (*ServerInterfaceWrapper) OpenWebSession ¶
func (siw *ServerInterfaceWrapper) OpenWebSession(c fiber.Ctx) error
OpenWebSession operation middleware
func (*ServerInterfaceWrapper) PatchAccount ¶
func (siw *ServerInterfaceWrapper) PatchAccount(c fiber.Ctx) error
PatchAccount operation middleware
func (*ServerInterfaceWrapper) Refresh ¶
func (siw *ServerInterfaceWrapper) Refresh(c fiber.Ctx) error
Refresh operation middleware
func (*ServerInterfaceWrapper) RefreshLogin ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) RefreshLogin(c fiber.Ctx) error
RefreshLogin operation middleware
func (*ServerInterfaceWrapper) RemoveAccount ¶
func (siw *ServerInterfaceWrapper) RemoveAccount(c fiber.Ctx) error
RemoveAccount operation middleware
func (*ServerInterfaceWrapper) Restart ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) Restart(c fiber.Ctx) error
Restart operation middleware
func (*ServerInterfaceWrapper) SetAuto ¶
func (siw *ServerInterfaceWrapper) SetAuto(c fiber.Ctx) error
SetAuto operation middleware
func (*ServerInterfaceWrapper) SetLang ¶
func (siw *ServerInterfaceWrapper) SetLang(c fiber.Ctx) error
SetLang operation middleware
func (*ServerInterfaceWrapper) SetRemote ¶
func (siw *ServerInterfaceWrapper) SetRemote(c fiber.Ctx) error
SetRemote operation middleware
func (*ServerInterfaceWrapper) SetStrategy ¶
func (siw *ServerInterfaceWrapper) SetStrategy(c fiber.Ctx) error
SetStrategy operation middleware
func (*ServerInterfaceWrapper) SetThresholds ¶
func (siw *ServerInterfaceWrapper) SetThresholds(c fiber.Ctx) error
SetThresholds operation middleware
func (*ServerInterfaceWrapper) Signal ¶
func (siw *ServerInterfaceWrapper) Signal(c fiber.Ctx) error
Signal operation middleware
func (*ServerInterfaceWrapper) StartLogin ¶ added in v0.2.0
func (siw *ServerInterfaceWrapper) StartLogin(c fiber.Ctx) error
StartLogin operation middleware
type SetAuto204Response ¶
type SetAuto204Response struct {
}
func (SetAuto204Response) VisitSetAutoResponse ¶
func (response SetAuto204Response) VisitSetAutoResponse(ctx fiber.Ctx) error
type SetAuto400JSONResponse ¶
type SetAuto400JSONResponse struct{ ErrorJSONResponse }
func (SetAuto400JSONResponse) VisitSetAutoResponse ¶
func (response SetAuto400JSONResponse) VisitSetAutoResponse(ctx fiber.Ctx) error
type SetAuto500JSONResponse ¶
type SetAuto500JSONResponse Error
func (SetAuto500JSONResponse) VisitSetAutoResponse ¶
func (response SetAuto500JSONResponse) VisitSetAutoResponse(ctx fiber.Ctx) error
type SetAutoJSONRequestBody ¶
type SetAutoJSONRequestBody = AutoRequest
SetAutoJSONRequestBody defines body for SetAuto for application/json ContentType.
type SetAutoRequestObject ¶
type SetAutoRequestObject struct {
Body *SetAutoJSONRequestBody
}
type SetAutoResponse ¶
type SetAutoResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseSetAutoResponse ¶
func ParseSetAutoResponse(rsp *http.Response) (*SetAutoResponse, error)
ParseSetAutoResponse parses an HTTP response from a SetAutoWithResponse call
func (SetAutoResponse) ContentType ¶
func (r SetAutoResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (SetAutoResponse) GetBody ¶
func (r SetAutoResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (SetAutoResponse) GetJSON400 ¶
func (r SetAutoResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (SetAutoResponse) GetJSON500 ¶
func (r SetAutoResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (SetAutoResponse) Status ¶
func (r SetAutoResponse) Status() string
Status returns HTTPResponse.Status
func (SetAutoResponse) StatusCode ¶
func (r SetAutoResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SetAutoResponseObject ¶
type SetLang204Response ¶
type SetLang204Response struct {
}
func (SetLang204Response) VisitSetLangResponse ¶
func (response SetLang204Response) VisitSetLangResponse(ctx fiber.Ctx) error
type SetLang400JSONResponse ¶
type SetLang400JSONResponse struct{ ErrorJSONResponse }
func (SetLang400JSONResponse) VisitSetLangResponse ¶
func (response SetLang400JSONResponse) VisitSetLangResponse(ctx fiber.Ctx) error
type SetLang500JSONResponse ¶
type SetLang500JSONResponse Error
func (SetLang500JSONResponse) VisitSetLangResponse ¶
func (response SetLang500JSONResponse) VisitSetLangResponse(ctx fiber.Ctx) error
type SetLangJSONRequestBody ¶
type SetLangJSONRequestBody = LangRequest
SetLangJSONRequestBody defines body for SetLang for application/json ContentType.
type SetLangRequestObject ¶
type SetLangRequestObject struct {
Body *SetLangJSONRequestBody
}
type SetLangResponse ¶
type SetLangResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseSetLangResponse ¶
func ParseSetLangResponse(rsp *http.Response) (*SetLangResponse, error)
ParseSetLangResponse parses an HTTP response from a SetLangWithResponse call
func (SetLangResponse) ContentType ¶
func (r SetLangResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (SetLangResponse) GetBody ¶
func (r SetLangResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (SetLangResponse) GetJSON400 ¶
func (r SetLangResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (SetLangResponse) GetJSON500 ¶
func (r SetLangResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (SetLangResponse) Status ¶
func (r SetLangResponse) Status() string
Status returns HTTPResponse.Status
func (SetLangResponse) StatusCode ¶
func (r SetLangResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SetLangResponseObject ¶
type SetRemote204Response ¶
type SetRemote204Response struct {
}
func (SetRemote204Response) VisitSetRemoteResponse ¶
func (response SetRemote204Response) VisitSetRemoteResponse(ctx fiber.Ctx) error
type SetRemote400JSONResponse ¶
type SetRemote400JSONResponse struct{ ErrorJSONResponse }
func (SetRemote400JSONResponse) VisitSetRemoteResponse ¶
func (response SetRemote400JSONResponse) VisitSetRemoteResponse(ctx fiber.Ctx) error
type SetRemote500JSONResponse ¶
type SetRemote500JSONResponse Error
func (SetRemote500JSONResponse) VisitSetRemoteResponse ¶
func (response SetRemote500JSONResponse) VisitSetRemoteResponse(ctx fiber.Ctx) error
type SetRemoteJSONRequestBody ¶
type SetRemoteJSONRequestBody = RemoteRequest
SetRemoteJSONRequestBody defines body for SetRemote for application/json ContentType.
type SetRemoteRequestObject ¶
type SetRemoteRequestObject struct {
Body *SetRemoteJSONRequestBody
}
type SetRemoteResponse ¶
type SetRemoteResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseSetRemoteResponse ¶
func ParseSetRemoteResponse(rsp *http.Response) (*SetRemoteResponse, error)
ParseSetRemoteResponse parses an HTTP response from a SetRemoteWithResponse call
func (SetRemoteResponse) ContentType ¶
func (r SetRemoteResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (SetRemoteResponse) GetBody ¶
func (r SetRemoteResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (SetRemoteResponse) GetJSON400 ¶
func (r SetRemoteResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (SetRemoteResponse) GetJSON500 ¶
func (r SetRemoteResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (SetRemoteResponse) Status ¶
func (r SetRemoteResponse) Status() string
Status returns HTTPResponse.Status
func (SetRemoteResponse) StatusCode ¶
func (r SetRemoteResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SetRemoteResponseObject ¶
type SetStrategy204Response ¶
type SetStrategy204Response struct {
}
func (SetStrategy204Response) VisitSetStrategyResponse ¶
func (response SetStrategy204Response) VisitSetStrategyResponse(ctx fiber.Ctx) error
type SetStrategy400JSONResponse ¶
type SetStrategy400JSONResponse struct{ ErrorJSONResponse }
func (SetStrategy400JSONResponse) VisitSetStrategyResponse ¶
func (response SetStrategy400JSONResponse) VisitSetStrategyResponse(ctx fiber.Ctx) error
type SetStrategy500JSONResponse ¶
type SetStrategy500JSONResponse Error
func (SetStrategy500JSONResponse) VisitSetStrategyResponse ¶
func (response SetStrategy500JSONResponse) VisitSetStrategyResponse(ctx fiber.Ctx) error
type SetStrategyJSONRequestBody ¶
type SetStrategyJSONRequestBody = StrategyRequest
SetStrategyJSONRequestBody defines body for SetStrategy for application/json ContentType.
type SetStrategyRequestObject ¶
type SetStrategyRequestObject struct {
Body *SetStrategyJSONRequestBody
}
type SetStrategyResponse ¶
type SetStrategyResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseSetStrategyResponse ¶
func ParseSetStrategyResponse(rsp *http.Response) (*SetStrategyResponse, error)
ParseSetStrategyResponse parses an HTTP response from a SetStrategyWithResponse call
func (SetStrategyResponse) ContentType ¶
func (r SetStrategyResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (SetStrategyResponse) GetBody ¶
func (r SetStrategyResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (SetStrategyResponse) GetJSON400 ¶
func (r SetStrategyResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (SetStrategyResponse) GetJSON500 ¶
func (r SetStrategyResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (SetStrategyResponse) Status ¶
func (r SetStrategyResponse) Status() string
Status returns HTTPResponse.Status
func (SetStrategyResponse) StatusCode ¶
func (r SetStrategyResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SetThresholds200JSONResponse ¶
type SetThresholds200JSONResponse Thresholds
func (SetThresholds200JSONResponse) VisitSetThresholdsResponse ¶
func (response SetThresholds200JSONResponse) VisitSetThresholdsResponse(ctx fiber.Ctx) error
type SetThresholds400JSONResponse ¶
type SetThresholds400JSONResponse struct{ ErrorJSONResponse }
func (SetThresholds400JSONResponse) VisitSetThresholdsResponse ¶
func (response SetThresholds400JSONResponse) VisitSetThresholdsResponse(ctx fiber.Ctx) error
type SetThresholds500JSONResponse ¶
type SetThresholds500JSONResponse Error
func (SetThresholds500JSONResponse) VisitSetThresholdsResponse ¶
func (response SetThresholds500JSONResponse) VisitSetThresholdsResponse(ctx fiber.Ctx) error
type SetThresholdsJSONRequestBody ¶
type SetThresholdsJSONRequestBody = Thresholds
SetThresholdsJSONRequestBody defines body for SetThresholds for application/json ContentType.
type SetThresholdsRequestObject ¶
type SetThresholdsRequestObject struct {
Body *SetThresholdsJSONRequestBody
}
type SetThresholdsResponse ¶
type SetThresholdsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Thresholds
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseSetThresholdsResponse ¶
func ParseSetThresholdsResponse(rsp *http.Response) (*SetThresholdsResponse, error)
ParseSetThresholdsResponse parses an HTTP response from a SetThresholdsWithResponse call
func (SetThresholdsResponse) ContentType ¶
func (r SetThresholdsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (SetThresholdsResponse) GetBody ¶
func (r SetThresholdsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (SetThresholdsResponse) GetJSON200 ¶
func (r SetThresholdsResponse) GetJSON200() *Thresholds
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (SetThresholdsResponse) GetJSON400 ¶
func (r SetThresholdsResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (SetThresholdsResponse) GetJSON500 ¶
func (r SetThresholdsResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (SetThresholdsResponse) Status ¶
func (r SetThresholdsResponse) Status() string
Status returns HTTPResponse.Status
func (SetThresholdsResponse) StatusCode ¶
func (r SetThresholdsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type Shift ¶
type Shift struct {
Account string `json:"account"`
// From May be more than 24 hours ago
From time.Time `json:"from"`
// To Absent for the current holder
To *time.Time `json:"to,omitempty"`
}
Shift defines model for Shift.
type Signal204Response ¶
type Signal204Response struct {
}
func (Signal204Response) VisitSignalResponse ¶
func (response Signal204Response) VisitSignalResponse(ctx fiber.Ctx) error
type Signal400JSONResponse ¶
type Signal400JSONResponse struct{ ErrorJSONResponse }
func (Signal400JSONResponse) VisitSignalResponse ¶
func (response Signal400JSONResponse) VisitSignalResponse(ctx fiber.Ctx) error
type Signal500JSONResponse ¶
type Signal500JSONResponse Error
func (Signal500JSONResponse) VisitSignalResponse ¶
func (response Signal500JSONResponse) VisitSignalResponse(ctx fiber.Ctx) error
type SignalJSONRequestBody ¶
type SignalJSONRequestBody = SignalRequest
SignalJSONRequestBody defines body for Signal for application/json ContentType.
type SignalRequest ¶
type SignalRequest struct {
Payload map[string]interface{} `json:"payload"`
}
SignalRequest defines model for SignalRequest.
type SignalRequestObject ¶
type SignalRequestObject struct {
Body *SignalJSONRequestBody
}
type SignalResponse ¶
type SignalResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON400 the response for an HTTP 400 `application/json` response
JSON400 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
}
func ParseSignalResponse ¶
func ParseSignalResponse(rsp *http.Response) (*SignalResponse, error)
ParseSignalResponse parses an HTTP response from a SignalWithResponse call
func (SignalResponse) ContentType ¶
func (r SignalResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (SignalResponse) GetBody ¶
func (r SignalResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (SignalResponse) GetJSON400 ¶
func (r SignalResponse) GetJSON400() *Error
GetJSON400 returns the response for an HTTP 400 `application/json` response
func (SignalResponse) GetJSON500 ¶
func (r SignalResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (SignalResponse) Status ¶
func (r SignalResponse) Status() string
Status returns HTTPResponse.Status
func (SignalResponse) StatusCode ¶
func (r SignalResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SignalResponseObject ¶
type StartLogin200JSONResponse ¶ added in v0.2.0
type StartLogin200JSONResponse LoginLink
func (StartLogin200JSONResponse) VisitStartLoginResponse ¶ added in v0.2.0
func (response StartLogin200JSONResponse) VisitStartLoginResponse(ctx fiber.Ctx) error
type StartLogin404JSONResponse ¶ added in v0.2.0
type StartLogin404JSONResponse struct{ ErrorJSONResponse }
func (StartLogin404JSONResponse) VisitStartLoginResponse ¶ added in v0.2.0
func (response StartLogin404JSONResponse) VisitStartLoginResponse(ctx fiber.Ctx) error
type StartLogin409JSONResponse ¶ added in v0.2.0
type StartLogin409JSONResponse Error
func (StartLogin409JSONResponse) VisitStartLoginResponse ¶ added in v0.2.0
func (response StartLogin409JSONResponse) VisitStartLoginResponse(ctx fiber.Ctx) error
type StartLogin429JSONResponse ¶ added in v0.2.0
type StartLogin429JSONResponse Error
func (StartLogin429JSONResponse) VisitStartLoginResponse ¶ added in v0.2.0
func (response StartLogin429JSONResponse) VisitStartLoginResponse(ctx fiber.Ctx) error
type StartLogin500JSONResponse ¶ added in v0.2.0
type StartLogin500JSONResponse Error
func (StartLogin500JSONResponse) VisitStartLoginResponse ¶ added in v0.2.0
func (response StartLogin500JSONResponse) VisitStartLoginResponse(ctx fiber.Ctx) error
type StartLogin502JSONResponse ¶ added in v0.2.0
type StartLogin502JSONResponse Error
func (StartLogin502JSONResponse) VisitStartLoginResponse ¶ added in v0.2.0
func (response StartLogin502JSONResponse) VisitStartLoginResponse(ctx fiber.Ctx) error
type StartLoginRequestObject ¶ added in v0.2.0
type StartLoginRequestObject struct {
Name string `json:"name"`
}
type StartLoginResponse ¶ added in v0.2.0
type StartLoginResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *LoginLink
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON429 the response for an HTTP 429 `application/json` response
JSON429 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
func ParseStartLoginResponse ¶ added in v0.2.0
func ParseStartLoginResponse(rsp *http.Response) (*StartLoginResponse, error)
ParseStartLoginResponse parses an HTTP response from a StartLoginWithResponse call
func (StartLoginResponse) ContentType ¶ added in v0.2.0
func (r StartLoginResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (StartLoginResponse) GetBody ¶ added in v0.2.0
func (r StartLoginResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (StartLoginResponse) GetJSON200 ¶ added in v0.2.0
func (r StartLoginResponse) GetJSON200() *LoginLink
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (StartLoginResponse) GetJSON404 ¶ added in v0.2.0
func (r StartLoginResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (StartLoginResponse) GetJSON409 ¶ added in v0.2.0
func (r StartLoginResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (StartLoginResponse) GetJSON429 ¶ added in v0.2.0
func (r StartLoginResponse) GetJSON429() *Error
GetJSON429 returns the response for an HTTP 429 `application/json` response
func (StartLoginResponse) GetJSON500 ¶ added in v0.2.0
func (r StartLoginResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (StartLoginResponse) GetJSON502 ¶ added in v0.2.0
func (r StartLoginResponse) GetJSON502() *Error
GetJSON502 returns the response for an HTTP 502 `application/json` response
func (StartLoginResponse) Status ¶ added in v0.2.0
func (r StartLoginResponse) Status() string
Status returns HTTPResponse.Status
func (StartLoginResponse) StatusCode ¶ added in v0.2.0
func (r StartLoginResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type StartLoginResponseObject ¶ added in v0.2.0
type Status ¶
type Status struct {
// Active Active account name
Active string `json:"active"`
// AdminUrl [web] admin_url: the address where the page takes changes besides loopback, and where ccswap web sends you; absent when unset, while the listener is off, and on the TCP listener, where it is no key holder's business
AdminUrl *string `json:"admin_url,omitempty"`
Auto bool `json:"auto"`
// FirstFree When every account is at its limit: the one that frees up first, which auto-switch moves to or stays on (its free_at says when), never one past its own weekly_threshold; absent otherwise or when no time is known
FirstFree *string `json:"first_free,omitempty"`
// Host Computer this ccswap runs on; its settings and switches apply to Claude Code there only
Host string `json:"host"`
// LastActivityAt Newest Claude Code transcript write; absent when unknown
LastActivityAt *time.Time `json:"last_activity_at,omitempty"`
LastPollAt *time.Time `json:"last_poll_at,omitempty"`
// LastSwitchAt Last switch ccswap made; absent before the first
LastSwitchAt *time.Time `json:"last_switch_at,omitempty"`
// Listen The address the TCP listener (T3 Code, the web page) is bound to, such as 127.0.0.1:8318; absent while it is off
Listen *string `json:"listen,omitempty"`
// Next Account auto-switch moves to once the active one runs out; absent when auto is off or none is usable
Next *string `json:"next,omitempty"`
// Remote The ccswap usage is taken from; absent when this daemon asks Anthropic itself.
Remote *Remote `json:"remote,omitempty"`
// Shifts Who held Claude Code over the last 24 hours, oldest first; the current holder's shift has no end, and time it held no known account has no shift
Shifts []Shift `json:"shifts"`
// Strategy Both put a higher priority first.
// fill-first: within a priority, the account with the most room; back to a higher priority as soon as it recovers.
// cache-aware: back to a higher priority as soon as it recovers, like fill-first; within a priority, the account whose
// weekly room (the week, per-model weeks) resets soonest, so it is spent before it is lost; the 5-hour window counts only
// for running out. While prompt caches are warm it moves within a priority only
// for room that resets within a day and at least an hour before the current account's; once Claude Code has been idle
// for an hour the move is free.
Strategy Strategy `json:"strategy"`
TargetService string `json:"target_service"`
Thresholds Thresholds `json:"thresholds"`
UnknownActive bool `json:"unknown_active"`
// Update A ccswap release. In Status, the newest one when it is newer than this build, as of the daemon's last check on GitHub; absent before that check, while [update] check is off, and when this build has no version.
Update *Release `json:"update,omitempty"`
Version string `json:"version"`
// Warning Non-fatal warning of the last operation
Warning *string `json:"warning,omitempty"`
}
Status defines model for Status.
type Strategy ¶
type Strategy string
Strategy Both put a higher priority first. fill-first: within a priority, the account with the most room; back to a higher priority as soon as it recovers. cache-aware: back to a higher priority as soon as it recovers, like fill-first; within a priority, the account whose weekly room (the week, per-model weeks) resets soonest, so it is spent before it is lost; the 5-hour window counts only for running out. While prompt caches are warm it moves within a priority only for room that resets within a day and at least an hour before the current account's; once Claude Code has been idle for an hour the move is free.
Defines values for Strategy.
type StrategyRequest ¶
type StrategyRequest struct {
// Strategy Both put a higher priority first.
// fill-first: within a priority, the account with the most room; back to a higher priority as soon as it recovers.
// cache-aware: back to a higher priority as soon as it recovers, like fill-first; within a priority, the account whose
// weekly room (the week, per-model weeks) resets soonest, so it is spent before it is lost; the 5-hour window counts only
// for running out. While prompt caches are warm it moves within a priority only
// for room that resets within a day and at least an hour before the current account's; once Claude Code has been idle
// for an hour the move is free.
Strategy Strategy `json:"strategy"`
}
StrategyRequest defines model for StrategyRequest.
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// (GET /v1/accounts)
ListAccounts(ctx context.Context, request ListAccountsRequestObject) (ListAccountsResponseObject, error)
// (POST /v1/accounts)
ImportAccount(ctx context.Context, request ImportAccountRequestObject) (ImportAccountResponseObject, error)
// (POST /v1/accounts/adopt)
AdoptAccount(ctx context.Context, request AdoptAccountRequestObject) (AdoptAccountResponseObject, error)
// (DELETE /v1/accounts/{name})
RemoveAccount(ctx context.Context, request RemoveAccountRequestObject) (RemoveAccountResponseObject, error)
// (PATCH /v1/accounts/{name})
PatchAccount(ctx context.Context, request PatchAccountRequestObject) (PatchAccountResponseObject, error)
// (POST /v1/accounts/{name}/activate)
ActivateAccount(ctx context.Context, request ActivateAccountRequestObject) (ActivateAccountResponseObject, error)
// (DELETE /v1/accounts/{name}/login)
CancelLogin(ctx context.Context, request CancelLoginRequestObject) (CancelLoginResponseObject, error)
// (POST /v1/accounts/{name}/login)
StartLogin(ctx context.Context, request StartLoginRequestObject) (StartLoginResponseObject, error)
// (POST /v1/accounts/{name}/login/code)
FinishLogin(ctx context.Context, request FinishLoginRequestObject) (FinishLoginResponseObject, error)
// (POST /v1/accounts/{name}/refresh)
RefreshLogin(ctx context.Context, request RefreshLoginRequestObject) (RefreshLoginResponseObject, error)
// (POST /v1/accounts/{name}/reset)
UseReset(ctx context.Context, request UseResetRequestObject) (UseResetResponseObject, error)
// (PUT /v1/auto)
SetAuto(ctx context.Context, request SetAutoRequestObject) (SetAutoResponseObject, error)
// (GET /v1/events)
GetEvents(ctx context.Context, request GetEventsRequestObject) (GetEventsResponseObject, error)
// (GET /v1/i18n/{lang})
GetI18n(ctx context.Context, request GetI18nRequestObject) (GetI18nResponseObject, error)
// (PUT /v1/lang)
SetLang(ctx context.Context, request SetLangRequestObject) (SetLangResponseObject, error)
// (POST /v1/migrate/cancel)
MigrateCancel(ctx context.Context, request MigrateCancelRequestObject) (MigrateCancelResponseObject, error)
// (POST /v1/migrate/commit)
MigrateCommit(ctx context.Context, request MigrateCommitRequestObject) (MigrateCommitResponseObject, error)
// (POST /v1/migrate/export)
MigrateExport(ctx context.Context, request MigrateExportRequestObject) (MigrateExportResponseObject, error)
// (POST /v1/migrate/import)
MigrateImport(ctx context.Context, request MigrateImportRequestObject) (MigrateImportResponseObject, error)
// (POST /v1/refresh)
Refresh(ctx context.Context, request RefreshRequestObject) (RefreshResponseObject, error)
// (PUT /v1/remote)
SetRemote(ctx context.Context, request SetRemoteRequestObject) (SetRemoteResponseObject, error)
// (POST /v1/restart)
Restart(ctx context.Context, request RestartRequestObject) (RestartResponseObject, error)
// (POST /v1/signal)
Signal(ctx context.Context, request SignalRequestObject) (SignalResponseObject, error)
// (GET /v1/status)
GetStatus(ctx context.Context, request GetStatusRequestObject) (GetStatusResponseObject, error)
// (PUT /v1/strategy)
SetStrategy(ctx context.Context, request SetStrategyRequestObject) (SetStrategyResponseObject, error)
// (PUT /v1/thresholds)
SetThresholds(ctx context.Context, request SetThresholdsRequestObject) (SetThresholdsResponseObject, error)
// (POST /v1/update)
InstallUpdate(ctx context.Context, request InstallUpdateRequestObject) (InstallUpdateResponseObject, error)
// (POST /v1/web/code)
CreateWebCode(ctx context.Context, request CreateWebCodeRequestObject) (CreateWebCodeResponseObject, error)
// (POST /v1/web/session)
OpenWebSession(ctx context.Context, request OpenWebSessionRequestObject) (OpenWebSessionResponseObject, error)
}
StrictServerInterface represents all server handlers.
type Thresholds ¶
type Thresholds struct {
// CheckActiveSeconds How often Anthropic is asked for the usage of the account in use
CheckActiveSeconds int `json:"check_active_seconds"`
// CheckOthersSeconds How often it is asked for every other account's
CheckOthersSeconds int `json:"check_others_seconds"`
FiveHour float64 `json:"five_hour"`
// Hysteresis Points under a threshold an account drops to before auto-switch returns to it; under five_hour, seven_day and every account's own weekly_threshold
Hysteresis float64 `json:"hysteresis"`
MinDwellSeconds int `json:"min_dwell_seconds"`
SevenDay float64 `json:"seven_day"`
}
Thresholds defines model for Thresholds.
type UseReset200JSONResponse ¶ added in v0.5.0
type UseReset200JSONResponse Account
func (UseReset200JSONResponse) VisitUseResetResponse ¶ added in v0.5.0
func (response UseReset200JSONResponse) VisitUseResetResponse(ctx fiber.Ctx) error
type UseReset404JSONResponse ¶ added in v0.5.0
type UseReset404JSONResponse struct{ ErrorJSONResponse }
func (UseReset404JSONResponse) VisitUseResetResponse ¶ added in v0.5.0
func (response UseReset404JSONResponse) VisitUseResetResponse(ctx fiber.Ctx) error
type UseReset409JSONResponse ¶ added in v0.5.0
type UseReset409JSONResponse Error
func (UseReset409JSONResponse) VisitUseResetResponse ¶ added in v0.5.0
func (response UseReset409JSONResponse) VisitUseResetResponse(ctx fiber.Ctx) error
type UseReset500JSONResponse ¶ added in v0.5.0
type UseReset500JSONResponse Error
func (UseReset500JSONResponse) VisitUseResetResponse ¶ added in v0.5.0
func (response UseReset500JSONResponse) VisitUseResetResponse(ctx fiber.Ctx) error
type UseReset502JSONResponse ¶ added in v0.5.0
type UseReset502JSONResponse Error
func (UseReset502JSONResponse) VisitUseResetResponse ¶ added in v0.5.0
func (response UseReset502JSONResponse) VisitUseResetResponse(ctx fiber.Ctx) error
type UseResetJSONRequestBody ¶ added in v0.5.0
type UseResetJSONRequestBody = UseResetRequest
UseResetJSONRequestBody defines body for UseReset for application/json ContentType.
type UseResetRequest ¶ added in v0.5.0
type UseResetRequest struct {
// Left The resets.left the caller showed
Left int `json:"left"`
}
UseResetRequest defines model for UseResetRequest.
type UseResetRequestObject ¶ added in v0.5.0
type UseResetRequestObject struct {
Name string `json:"name"`
Body *UseResetJSONRequestBody
}
type UseResetResponse ¶ added in v0.5.0
type UseResetResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *Account
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *Error
// JSON409 the response for an HTTP 409 `application/json` response
JSON409 *Error
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *Error
// JSON502 the response for an HTTP 502 `application/json` response
JSON502 *Error
}
func ParseUseResetResponse ¶ added in v0.5.0
func ParseUseResetResponse(rsp *http.Response) (*UseResetResponse, error)
ParseUseResetResponse parses an HTTP response from a UseResetWithResponse call
func (UseResetResponse) ContentType ¶ added in v0.5.0
func (r UseResetResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (UseResetResponse) GetBody ¶ added in v0.5.0
func (r UseResetResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (UseResetResponse) GetJSON200 ¶ added in v0.5.0
func (r UseResetResponse) GetJSON200() *Account
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (UseResetResponse) GetJSON404 ¶ added in v0.5.0
func (r UseResetResponse) GetJSON404() *Error
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (UseResetResponse) GetJSON409 ¶ added in v0.5.0
func (r UseResetResponse) GetJSON409() *Error
GetJSON409 returns the response for an HTTP 409 `application/json` response
func (UseResetResponse) GetJSON500 ¶ added in v0.5.0
func (r UseResetResponse) GetJSON500() *Error
GetJSON500 returns the response for an HTTP 500 `application/json` response
func (UseResetResponse) GetJSON502 ¶ added in v0.5.0
func (r UseResetResponse) GetJSON502() *Error
GetJSON502 returns the response for an HTTP 502 `application/json` response
func (UseResetResponse) Status ¶ added in v0.5.0
func (r UseResetResponse) Status() string
Status returns HTTPResponse.Status
func (UseResetResponse) StatusCode ¶ added in v0.5.0
func (r UseResetResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type UseResetResponseObject ¶ added in v0.5.0
type WebSession ¶
type WebSession struct {
// Key The admin key; the page keeps it for its tab only
Key string `json:"key"`
}
WebSession defines model for WebSession.
type WebSessionRequest ¶
type WebSessionRequest struct {
Code string `json:"code"`
}
WebSessionRequest defines model for WebSessionRequest.