--- tocdepth: 2 --- # Go API reference Package `github.com/nebius/contree-client/go/v1`. Generated from the exported Go declarations and doc comments, including client methods, models, helpers, and test doubles. See the [Go client guide](api.md) for usage. Package contree provides a generated, typed client for the Contree v1 API. Construct a Client with NewClient, or use ResolveProfile and NewClientFromProfile for saved credentials. Pass contexts to every operation, and close byte download streams. Event and pagination methods return iter.Seq2 iterators; check their errors inside the range loop. Event streams close automatically when iteration ends. ## Constants (go-authtypejwt)= (go-profilesectionprefix)= (go-defaultprofilename)= (go-defaultiamurl)= (go-authtypeiam)= ### const AuthTypeIAM (group) ```go const ( // AuthTypeIAM identifies an IAM token profile. AuthTypeIAM = "iam" // AuthTypeJWT identifies a JWT token profile. AuthTypeJWT = "jwt" // ProfileSectionPrefix prefixes profile sections in Contree INI files. ProfileSectionPrefix = "profile:" // DefaultProfileName is selected when the configuration has no active profile. DefaultProfileName = "default" // DefaultIAMURL is used when an IAM profile does not specify a URL. DefaultIAMURL = DefaultBaseURL ) ``` (go-closablestreamreprencodingascii)= ### const ClosableStreamReprEncodingAscii ClosableStreamReprEncodingAscii is a documented ClosableStreamReprEncoding value. ```go const ClosableStreamReprEncodingAscii = "ascii" ``` (go-closablestreamreprencodingbase64)= ### const ClosableStreamReprEncodingBase64 ClosableStreamReprEncodingBase64 is a documented ClosableStreamReprEncoding value. ```go const ClosableStreamReprEncodingBase64 = "base64" ``` (go-defaultbaseurl)= ### const DefaultBaseURL ```go const DefaultBaseURL = "https://api.tokenfactory.nebius.com/sandboxes" ``` (go-eventdatafileuploadstatuscancelled)= ### const EventDataFileUploadStatusCancelled EventDataFileUploadStatusCancelled is a documented EventDataFileUploadStatus value. ```go const EventDataFileUploadStatusCancelled = "cancelled" ``` (go-eventdatafileuploadstatuserror)= ### const EventDataFileUploadStatusError EventDataFileUploadStatusError is a documented EventDataFileUploadStatus value. ```go const EventDataFileUploadStatusError = "error" ``` (go-eventdatafileuploadstatussuccess)= ### const EventDataFileUploadStatusSuccess EventDataFileUploadStatusSuccess is a documented EventDataFileUploadStatus value. ```go const EventDataFileUploadStatusSuccess = "success" ``` (go-eventdatafileuploadstatustimeout)= ### const EventDataFileUploadStatusTimeout EventDataFileUploadStatusTimeout is a documented EventDataFileUploadStatus value. ```go const EventDataFileUploadStatusTimeout = "timeout" ``` (go-eventdatainspectmethodarchive)= ### const EventDataInspectMethodArchive EventDataInspectMethodArchive is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodArchive = "archive" ``` (go-eventdatainspectmethodclose)= ### const EventDataInspectMethodClose EventDataInspectMethodClose is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodClose = "close" ``` (go-eventdatainspectmethodfinish)= ### const EventDataInspectMethodFinish EventDataInspectMethodFinish is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodFinish = "finish" ``` (go-eventdatainspectmethodgrep)= ### const EventDataInspectMethodGrep EventDataInspectMethodGrep is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodGrep = "grep" ``` (go-eventdatainspectmethodlist)= ### const EventDataInspectMethodList EventDataInspectMethodList is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodList = "list" ``` (go-eventdatainspectmethodopen)= ### const EventDataInspectMethodOpen EventDataInspectMethodOpen is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodOpen = "open" ``` (go-eventdatainspectmethodread)= ### const EventDataInspectMethodRead EventDataInspectMethodRead is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodRead = "read" ``` (go-eventdatainspectmethodstat)= ### const EventDataInspectMethodStat EventDataInspectMethodStat is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodStat = "stat" ``` (go-eventdatainspectmethodupload)= ### const EventDataInspectMethodUpload EventDataInspectMethodUpload is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodUpload = "upload" ``` (go-eventdatainspectmethodwrite)= ### const EventDataInspectMethodWrite EventDataInspectMethodWrite is a documented EventDataInspectMethod value. ```go const EventDataInspectMethodWrite = "write" ``` (go-eventdatainspectphasecompleted)= ### const EventDataInspectPhaseCompleted EventDataInspectPhaseCompleted is a documented EventDataInspectPhase value. ```go const EventDataInspectPhaseCompleted = "completed" ``` (go-eventdatainspectphasestarted)= ### const EventDataInspectPhaseStarted EventDataInspectPhaseStarted is a documented EventDataInspectPhase value. ```go const EventDataInspectPhaseStarted = "started" ``` (go-eventdatainspectstatuscancelled)= ### const EventDataInspectStatusCancelled EventDataInspectStatusCancelled is a documented EventDataInspectStatus value. ```go const EventDataInspectStatusCancelled = "cancelled" ``` (go-eventdatainspectstatuserror)= ### const EventDataInspectStatusError EventDataInspectStatusError is a documented EventDataInspectStatus value. ```go const EventDataInspectStatusError = "error" ``` (go-eventdatainspectstatussuccess)= ### const EventDataInspectStatusSuccess EventDataInspectStatusSuccess is a documented EventDataInspectStatus value. ```go const EventDataInspectStatusSuccess = "success" ``` (go-eventdatainspectstatustimeout)= ### const EventDataInspectStatusTimeout EventDataInspectStatusTimeout is a documented EventDataInspectStatus value. ```go const EventDataInspectStatusTimeout = "timeout" ``` (go-eventdatashutdownreasonjobcomplete)= ### const EventDataShutdownReasonJobComplete EventDataShutdownReasonJobComplete is a documented EventDataShutdownReason value. ```go const EventDataShutdownReasonJobComplete = "job_complete" ``` (go-eventdatashutdownreasonsignal)= ### const EventDataShutdownReasonSignal EventDataShutdownReasonSignal is a documented EventDataShutdownReason value. ```go const EventDataShutdownReasonSignal = "signal" ``` (go-eventdatashutdownreasonspawnfailed)= ### const EventDataShutdownReasonSpawnFailed EventDataShutdownReasonSpawnFailed is a documented EventDataShutdownReason value. ```go const EventDataShutdownReasonSpawnFailed = "spawn_failed" ``` (go-eventdatashutdownreasontimeout)= ### const EventDataShutdownReasonTimeout EventDataShutdownReasonTimeout is a documented EventDataShutdownReason value. ```go const EventDataShutdownReasonTimeout = "timeout" ``` (go-eventdatastreamencodingascii)= ### const EventDataStreamEncodingAscii EventDataStreamEncodingAscii is a documented EventDataStreamEncoding value. ```go const EventDataStreamEncodingAscii = "ascii" ``` (go-eventdatastreamencodingbase64)= ### const EventDataStreamEncodingBase64 EventDataStreamEncodingBase64 is a documented EventDataStreamEncoding value. ```go const EventDataStreamEncodingBase64 = "base64" ``` (go-eventdatatruncatedstreamstderr)= ### const EventDataTruncatedStreamStderr EventDataTruncatedStreamStderr is a documented EventDataTruncatedStream value. ```go const EventDataTruncatedStreamStderr = "stderr" ``` (go-eventdatatruncatedstreamstdin)= ### const EventDataTruncatedStreamStdin EventDataTruncatedStreamStdin is a documented EventDataTruncatedStream value. ```go const EventDataTruncatedStreamStdin = "stdin" ``` (go-eventdatatruncatedstreamstdout)= ### const EventDataTruncatedStreamStdout EventDataTruncatedStreamStdout is a documented EventDataTruncatedStream value. ```go const EventDataTruncatedStreamStdout = "stdout" ``` (go-grepmatchtypecontext)= ### const GrepMatchTypeContext GrepMatchTypeContext is a documented GrepMatchType value. ```go const GrepMatchTypeContext = "context" ``` (go-grepmatchtypematch)= ### const GrepMatchTypeMatch GrepMatchTypeMatch is a documented GrepMatchType value. ```go const GrepMatchTypeMatch = "match" ``` (go-inspectimagegrepcaseinsensitive)= ### const InspectImageGrepCaseInsensitive InspectImageGrepCaseInsensitive is a documented InspectImageGrepCase value. ```go const InspectImageGrepCaseInsensitive = "insensitive" ``` (go-inspectimagegrepcasesensitive)= ### const InspectImageGrepCaseSensitive InspectImageGrepCaseSensitive is a documented InspectImageGrepCase value. ```go const InspectImageGrepCaseSensitive = "sensitive" ``` (go-inspectimagegrepcasesmart)= ### const InspectImageGrepCaseSmart InspectImageGrepCaseSmart is a documented InspectImageGrepCase value. ```go const InspectImageGrepCaseSmart = "smart" ``` (go-inspectinstancegrepcaseinsensitive)= ### const InspectInstanceGrepCaseInsensitive InspectInstanceGrepCaseInsensitive is a documented InspectInstanceGrepCase value. ```go const InspectInstanceGrepCaseInsensitive = "insensitive" ``` (go-inspectinstancegrepcasesensitive)= ### const InspectInstanceGrepCaseSensitive InspectInstanceGrepCaseSensitive is a documented InspectInstanceGrepCase value. ```go const InspectInstanceGrepCaseSensitive = "sensitive" ``` (go-inspectinstancegrepcasesmart)= ### const InspectInstanceGrepCaseSmart InspectInstanceGrepCaseSmart is a documented InspectInstanceGrepCase value. ```go const InspectInstanceGrepCaseSmart = "smart" ``` (go-listoperationskindimageimport)= ### const ListOperationsKindImageImport ListOperationsKindImageImport is a documented ListOperationsKind value. ```go const ListOperationsKindImageImport = "image_import" ``` (go-listoperationskindinstance)= ### const ListOperationsKindInstance ListOperationsKindInstance is a documented ListOperationsKind value. ```go const ListOperationsKindInstance = "instance" ``` (go-networkpolicycidrruleprototcp)= ### const NetworkPolicyCidrRuleProtoTcp NetworkPolicyCidrRuleProtoTcp is a documented NetworkPolicyCidrRuleProto value. ```go const NetworkPolicyCidrRuleProtoTcp = "tcp" ``` (go-networkpolicycidrruleprotoudp)= ### const NetworkPolicyCidrRuleProtoUdp NetworkPolicyCidrRuleProtoUdp is a documented NetworkPolicyCidrRuleProto value. ```go const NetworkPolicyCidrRuleProtoUdp = "udp" ``` (go-operationresponsekindimageimport)= ### const OperationResponseKindImageImport OperationResponseKindImageImport is a documented OperationResponseKind value. ```go const OperationResponseKindImageImport = "image_import" ``` (go-operationresponsekindinstance)= ### const OperationResponseKindInstance OperationResponseKindInstance is a documented OperationResponseKind value. ```go const OperationResponseKindInstance = "instance" ``` (go-operationsubprocessstdinencodingascii)= ### const OperationSubprocessStdinEncodingAscii OperationSubprocessStdinEncodingAscii is a documented OperationSubprocessStdinEncoding value. ```go const OperationSubprocessStdinEncodingAscii = "ascii" ``` (go-operationsubprocessstdinencodingbase64)= ### const OperationSubprocessStdinEncodingBase64 OperationSubprocessStdinEncodingBase64 is a documented OperationSubprocessStdinEncoding value. ```go const OperationSubprocessStdinEncodingBase64 = "base64" ``` (go-operationsummarykindimageimport)= ### const OperationSummaryKindImageImport OperationSummaryKindImageImport is a documented OperationSummaryKind value. ```go const OperationSummaryKindImageImport = "image_import" ``` (go-operationsummarykindinstance)= ### const OperationSummaryKindInstance OperationSummaryKindInstance is a documented OperationSummaryKind value. ```go const OperationSummaryKindInstance = "instance" ``` (go-specsha256)= ### const SpecSHA256 SpecSHA256 identifies the exact OpenAPI input document. ```go const SpecSHA256 = "0c77136174a41b99c59fb4b98e5d8b1e660dee2243a24cff2da56fa84b836a0d" ``` (go-streamreprencodingascii)= ### const StreamReprEncodingAscii StreamReprEncodingAscii is a documented StreamReprEncoding value. ```go const StreamReprEncodingAscii = "ascii" ``` (go-streamreprencodingbase64)= ### const StreamReprEncodingBase64 StreamReprEncodingBase64 is a documented StreamReprEncoding value. ```go const StreamReprEncodingBase64 = "base64" ``` ## Variables (go-opapplyinstancefile)= ### var OpApplyInstanceFile OpApplyInstanceFile configures the mock result for ApplyInstanceFile. ```go var OpApplyInstanceFile Operation[struct{}] ``` (go-opcanceloperation)= ### var OpCancelOperation OpCancelOperation configures the mock result for CancelOperation. ```go var OpCancelOperation Operation[struct{}] ``` (go-opcheckfileexists)= ### var OpCheckFileExists OpCheckFileExists configures the mock result for CheckFileExists. ```go var OpCheckFileExists Operation[bool] ``` (go-opcheckimagearchive)= ### var OpCheckImageArchive OpCheckImageArchive configures the mock result for CheckImageArchive. ```go var OpCheckImageArchive Operation[bool] ``` (go-opcheckimagefile)= ### var OpCheckImageFile OpCheckImageFile configures the mock result for CheckImageFile. ```go var OpCheckImageFile Operation[bool] ``` (go-opcheckinstancearchive)= ### var OpCheckInstanceArchive OpCheckInstanceArchive configures the mock result for CheckInstanceArchive. ```go var OpCheckInstanceArchive Operation[bool] ``` (go-opcheckinstancefile)= ### var OpCheckInstanceFile OpCheckInstanceFile configures the mock result for CheckInstanceFile. ```go var OpCheckInstanceFile Operation[bool] ``` (go-opcreatenetworkpolicy)= ### var OpCreateNetworkPolicy OpCreateNetworkPolicy configures the mock result for CreateNetworkPolicy. ```go var OpCreateNetworkPolicy Operation[NetworkPolicy] ``` (go-opdeleteimagetag)= ### var OpDeleteImageTag OpDeleteImageTag configures the mock result for DeleteImageTag. ```go var OpDeleteImageTag Operation[struct{}] ``` (go-opdeletenetworkpolicy)= ### var OpDeleteNetworkPolicy OpDeleteNetworkPolicy configures the mock result for DeleteNetworkPolicy. ```go var OpDeleteNetworkPolicy Operation[struct{}] ``` (go-opdeletenetworkpolicytag)= ### var OpDeleteNetworkPolicyTag OpDeleteNetworkPolicyTag configures the mock result for DeleteNetworkPolicyTag. ```go var OpDeleteNetworkPolicyTag Operation[struct{}] ``` (go-opgetfile)= ### var OpGetFile OpGetFile configures the mock result for GetFile. ```go var OpGetFile Operation[File] ``` (go-opgetnetworkpolicy)= ### var OpGetNetworkPolicy OpGetNetworkPolicy configures the mock result for GetNetworkPolicy. ```go var OpGetNetworkPolicy Operation[NetworkPolicy] ``` (go-opgetnetworkpolicytag)= ### var OpGetNetworkPolicyTag OpGetNetworkPolicyTag configures the mock result for GetNetworkPolicyTag. ```go var OpGetNetworkPolicyTag Operation[NetworkPolicyTag] ``` (go-opgetoperationstatus)= ### var OpGetOperationStatus OpGetOperationStatus configures the mock result for GetOperationStatus. ```go var OpGetOperationStatus Operation[OperationResponse] ``` (go-opimportimage)= ### var OpImportImage OpImportImage configures the mock result for ImportImage. ```go var OpImportImage Operation[string] ``` (go-opinspectfindimagebytag)= ### var OpInspectFindImageByTag OpInspectFindImageByTag configures the mock result for InspectFindImageByTag. ```go var OpInspectFindImageByTag Operation[string] ``` (go-opinspectimage)= ### var OpInspectImage OpInspectImage configures the mock result for InspectImage. ```go var OpInspectImage Operation[Image] ``` (go-opinspectimagearchive)= ### var OpInspectImageArchive OpInspectImageArchive configures the mock result for InspectImageArchive. ```go var OpInspectImageArchive Operation[[]byte] ``` (go-opinspectimagedownload)= ### var OpInspectImageDownload OpInspectImageDownload configures the mock result for InspectImageDownload. ```go var OpInspectImageDownload Operation[[]byte] ``` (go-opinspectimagegrep)= ### var OpInspectImageGrep OpInspectImageGrep configures the mock result for InspectImageGrep. ```go var OpInspectImageGrep Operation[GrepResult] ``` (go-opinspectimagelist)= ### var OpInspectImageList OpInspectImageList configures the mock result for InspectImageList. ```go var OpInspectImageList Operation[DirectoryList] ``` (go-opinspectinstancearchive)= ### var OpInspectInstanceArchive OpInspectInstanceArchive configures the mock result for InspectInstanceArchive. ```go var OpInspectInstanceArchive Operation[[]byte] ``` (go-opinspectinstancedownload)= ### var OpInspectInstanceDownload OpInspectInstanceDownload configures the mock result for InspectInstanceDownload. ```go var OpInspectInstanceDownload Operation[[]byte] ``` (go-opinspectinstancegrep)= ### var OpInspectInstanceGrep OpInspectInstanceGrep configures the mock result for InspectInstanceGrep. ```go var OpInspectInstanceGrep Operation[GrepResult] ``` (go-opinspectinstancelist)= ### var OpInspectInstanceList OpInspectInstanceList configures the mock result for InspectInstanceList. ```go var OpInspectInstanceList Operation[DirectoryList] ``` (go-opiteroperationevents)= ### var OpIterOperationEvents OpIterOperationEvents configures the mock result for IterOperationEvents. ```go var OpIterOperationEvents Operation[[]OperationEvent] ``` (go-oplistfiles)= ### var OpListFiles OpListFiles configures the mock result for ListFiles. ```go var OpListFiles Operation[FilesListResponse] ``` (go-oplistimages)= ### var OpListImages OpListImages configures the mock result for ListImages. ```go var OpListImages Operation[ImageListResponse] ``` (go-oplistnetworkpolicies)= ### var OpListNetworkPolicies OpListNetworkPolicies configures the mock result for ListNetworkPolicies. ```go var OpListNetworkPolicies Operation[NetworkPolicyListResponse] ``` (go-oplistnetworkpolicytags)= ### var OpListNetworkPolicyTags OpListNetworkPolicyTags configures the mock result for ListNetworkPolicyTags. ```go var OpListNetworkPolicyTags Operation[ListNetworkPolicyTagsResponse] ``` (go-oplistoperations)= ### var OpListOperations OpListOperations configures the mock result for ListOperations. ```go var OpListOperations Operation[[]OperationSummary] ``` (go-opoperationsubprocess)= ### var OpOperationSubprocess OpOperationSubprocess configures the mock result for OperationSubprocess. ```go var OpOperationSubprocess Operation[InstanceResult] ``` (go-opoperationsubprocesscreate)= ### var OpOperationSubprocessCreate OpOperationSubprocessCreate configures the mock result for OperationSubprocessCreate. ```go var OpOperationSubprocessCreate Operation[int64] ``` (go-opoperationsubprocesskill)= ### var OpOperationSubprocessKill OpOperationSubprocessKill configures the mock result for OperationSubprocessKill. ```go var OpOperationSubprocessKill Operation[struct{}] ``` (go-opoperationsubprocessstdin)= ### var OpOperationSubprocessStdin OpOperationSubprocessStdin configures the mock result for OperationSubprocessStdin. ```go var OpOperationSubprocessStdin Operation[struct{}] ``` (go-opsetnetworkpolicytag)= ### var OpSetNetworkPolicyTag OpSetNetworkPolicyTag configures the mock result for SetNetworkPolicyTag. ```go var OpSetNetworkPolicyTag Operation[NetworkPolicyTag] ``` (go-opspawninstance)= ### var OpSpawnInstance OpSpawnInstance configures the mock result for SpawnInstance. ```go var OpSpawnInstance Operation[InstanceSpawnResponse] ``` (go-opupdateimagetag)= ### var OpUpdateImageTag OpUpdateImageTag configures the mock result for UpdateImageTag. ```go var OpUpdateImageTag Operation[Image] ``` (go-opuploadfile)= ### var OpUploadFile OpUploadFile configures the mock result for UploadFile. ```go var OpUploadFile Operation[FileResponse] ``` (go-opwhoami)= ### var OpWhoAmI OpWhoAmI configures the mock result for WhoAmI. ```go var OpWhoAmI Operation[WhoAmIResponse] ``` ## Functions (go-contreehome)= ### ContreeHome ContreeHome returns the directory that contains Contree configuration files. CONTREE\_HOME has priority over XDG\_CONFIG\_HOME and ~/.config/contree. ```go func ContreeHome() (string, error) ``` (go-decodechunk)= ### DecodeChunk DecodeChunk decodes a typed stream payload, raw JSON, or a raw object to bytes. Unknown shapes and invalid base64 return empty bytes so a live stream can continue. ```go func DecodeChunk(data any) []byte ``` (go-decodestream)= ### DecodeStream DecodeStream decodes a stream payload to text, replacing invalid UTF-8. ```go func DecodeStream(data any) string ``` (go-isterminalstatus)= ### IsTerminalStatus IsTerminalStatus reports whether status cannot change again. ```go func IsTerminalStatus(status OperationStatus) bool ``` (go-loadprofiles)= ### LoadProfiles LoadProfiles reads cli.ini and auth.ini and returns profiles and the active profile name. auth.ini values override cli.ini values. Pass no path to use the default auth.ini location, or pass one explicit auth.ini path. ```go func LoadProfiles(path ...string) (map[string]Profile, string, error) ``` (go-newtestclient)= ### NewTestClient NewTestClient constructs a normal Client and its offline MockTransport. It uses "test-token" and [https://contree.test](https://contree.test) by default. Options can change normal client settings; the mock HTTP transport is always installed last. No request can fall back to a network transport. For code that constructs its own client, supply a zero-value MockTransport through WithHTTPClient instead. ```go func NewTestClient(options ...ClientOption) (*Client, *MockTransport, error) ``` **Example** ```go package main import ( "context" "fmt" "log" contree "github.com/nebius/contree-client/go/v1" ) func permissions(ctx context.Context, client *contree.Client) (map[string]bool, error) { me, err := client.WhoAmI(ctx) if err != nil { return nil, fmt.Errorf("get token permissions: %w", err) } return me.Permissions, nil } func main() { client, mock, err := contree.NewTestClient() if err != nil { log.Fatalf("create test client: %v", err) } err = mock.Mock(contree.OpWhoAmI, contree.WhoAmIResponse{ Permissions: map[string]bool{"spawn": true}, OperationsStat: map[string]int64{}, }) if err != nil { log.Fatalf("mock token permissions: %v", err) } allowed, err := permissions(context.Background(), client) if err != nil { log.Fatalf("load permissions: %v", err) } fmt.Println(allowed["spawn"]) fmt.Println(len(mock.CallsFor("WhoAmI"))) } ``` Output: ```text true 1 ``` ## Types (go-apiconnectionerror)= ### type APIConnectionError APIConnectionError reports a connection or response-read failure. TimedOut distinguishes deadline and socket timeout failures. ```go type APIConnectionError struct { Method string URL string TimedOut bool Err error } ``` (go-apiconnectionerror-error)= #### APIConnectionError.Error ```go func (e *APIConnectionError) Error() string ``` (go-apiconnectionerror-timeout)= #### APIConnectionError.Timeout Timeout reports whether the transport failure was caused by a deadline or socket timeout. ```go func (e *APIConnectionError) Timeout() bool ``` (go-apiconnectionerror-unwrap)= #### APIConnectionError.Unwrap Unwrap returns the original transport error. ```go func (e *APIConnectionError) Unwrap() error ``` (go-apierror)= ### type APIError APIError identifies normalized connection, HTTP status, and SSE errors. Use errors.As with this interface to recognize them through wrapped errors. ```go type APIError interface { error // contains filtered or unexported methods } ``` (go-apistatuserror)= ### type APIStatusError APIStatusError reports an HTTP response that the operation did not accept. Body contains at most the runtime error-body limit. Details contains the decoded "error" property when present, or the decoded response otherwise. A non-nil RetryAfter preserves the header even when its value is zero. ```go type APIStatusError struct { StatusCode int Method string URL string RequestID string Body []byte Details any Traceback []string RetryAfter *time.Duration } ``` (go-apistatuserror-error)= #### APIStatusError.Error ```go func (e *APIStatusError) Error() string ``` (go-applyinstancefileoptions)= ### type ApplyInstanceFileOptions ApplyInstanceFileOptions contains optional arguments for ApplyInstanceFile. ```go type ApplyInstanceFileOptions struct { Unpack Optional[bool] Replace Optional[bool] Merge Optional[bool] } ``` (go-authenticationerror)= ### type AuthenticationError AuthenticationError is returned for an unexpected HTTP 401 response. ```go type AuthenticationError struct{ *APIStatusError } ``` (go-authenticationerror-error)= #### AuthenticationError.Error ```go func (e AuthenticationError) Error() string ``` (go-authenticationerror-unwrap)= #### AuthenticationError.Unwrap ```go func (e *AuthenticationError) Unwrap() error ``` (go-badrequesterror)= ### type BadRequestError BadRequestError is returned for an unexpected HTTP 400 response. ```go type BadRequestError struct{ *APIStatusError } ``` (go-badrequesterror-error)= #### BadRequestError.Error ```go func (e BadRequestError) Error() string ``` (go-badrequesterror-unwrap)= #### BadRequestError.Unwrap ```go func (e *BadRequestError) Unwrap() error ``` (go-client)= ### type Client Client calls the generated Contree API surface through net/http. ```go type Client struct { // contains filtered or unexported fields } ``` (go-newclient)= #### NewClient NewClient constructs a client. An empty token omits Authorization for public endpoints. ```go func NewClient(token string, options ...ClientOption) (*Client, error) ``` (go-newclientfromprofile)= #### NewClientFromProfile NewClientFromProfile constructs a client from a loaded profile. Resolve and construct a saved profile as follows: profile, err := ResolveProfile("") if err != nil { return err } client, err := NewClientFromProfile(profile) ClientOption values are applied after the profile settings. Thus, caller options override the profile URL and project. ```go func NewClientFromProfile(profile Profile, options ...ClientOption) (*Client, error) ``` (go-client-applyinstancefile)= #### Client.ApplyInstanceFile ApplyInstanceFile calls POST /operations/{operation\_uuid}/files. ```go func (c *Client) ApplyInstanceFile( ctx context.Context, operationUUID string, fileUUID string, path string, options *ApplyInstanceFileOptions, ) error ``` (go-client-baseurl)= #### Client.BaseURL BaseURL returns the normalized service origin. ```go func (c *Client) BaseURL() string ``` (go-client-canceloperation)= #### Client.CancelOperation CancelOperation calls DELETE /operations/{operationId}. ```go func (c *Client) CancelOperation( ctx context.Context, operationID string, ) error ``` (go-client-checkfileexists)= #### Client.CheckFileExists CheckFileExists calls HEAD /files/{sha256}. ```go func (c *Client) CheckFileExists( ctx context.Context, sha256 string, ) (bool, error) ``` (go-client-checkimagearchive)= #### Client.CheckImageArchive CheckImageArchive calls HEAD /inspect/{image\_uuid}/archive. ```go func (c *Client) CheckImageArchive( ctx context.Context, imageUUID string, path string, ) (bool, error) ``` (go-client-checkimagefile)= #### Client.CheckImageFile CheckImageFile calls HEAD /inspect/{image\_uuid}/download. ```go func (c *Client) CheckImageFile( ctx context.Context, imageUUID string, path string, ) (bool, error) ``` (go-client-checkinstancearchive)= #### Client.CheckInstanceArchive CheckInstanceArchive calls HEAD /operations/{operation\_uuid}/inspect/archive. ```go func (c *Client) CheckInstanceArchive( ctx context.Context, operationUUID string, path string, ) (bool, error) ``` (go-client-checkinstancefile)= #### Client.CheckInstanceFile CheckInstanceFile calls HEAD /operations/{operation\_uuid}/inspect/download. ```go func (c *Client) CheckInstanceFile( ctx context.Context, operationUUID string, path string, ) (bool, error) ``` (go-client-createnetworkpolicy)= #### Client.CreateNetworkPolicy CreateNetworkPolicy calls POST /network/policies. ```go func (c *Client) CreateNetworkPolicy( ctx context.Context, cidrs []NetworkPolicyCidrRule, ) (NetworkPolicy, error) ``` (go-client-deleteimagetag)= #### Client.DeleteImageTag DeleteImageTag calls DELETE /images/{imageUUID}/tag. ```go func (c *Client) DeleteImageTag( ctx context.Context, imageUUID string, options *DeleteImageTagOptions, ) error ``` (go-client-deletenetworkpolicy)= #### Client.DeleteNetworkPolicy DeleteNetworkPolicy calls DELETE /network/policies/{uuid}. ```go func (c *Client) DeleteNetworkPolicy( ctx context.Context, uuid string, ) error ``` (go-client-deletenetworkpolicytag)= #### Client.DeleteNetworkPolicyTag DeleteNetworkPolicyTag calls DELETE /network/tags/{tag}. ```go func (c *Client) DeleteNetworkPolicyTag( ctx context.Context, tag string, ) error ``` (go-client-ensurefile)= #### Client.EnsureFile EnsureFile returns the existing file with the content digest, or uploads content when the server returns NotFoundError for that digest. If options does not contain SHA256, EnsureFile hashes seekable readers from their current position and restores that position before the server probe. Non-seekable readers upload directly. Therefore, callers can pass \*os.File without loading the file into memory. ```go func (c *Client) EnsureFile( ctx context.Context, content io.Reader, options *EnsureFileOptions, ) (EnsureFileResult, error) ``` (go-client-followoperationevents)= #### Client.FollowOperationEvents FollowOperationEvents lazily yields events and reconnects interrupted streams. Each traversal starts from the supplied options. A terminal error is yielded once with a zero event. Ending iteration closes the active response body. ```go func (c *Client) FollowOperationEvents( ctx context.Context, operationID string, options *FollowOperationEventsOptions, ) iter.Seq2[OperationEvent, error] ``` (go-client-getfile)= #### Client.GetFile GetFile calls GET /files/{sha256}. ```go func (c *Client) GetFile( ctx context.Context, sha256 string, ) (File, error) ``` (go-client-getnetworkpolicy)= #### Client.GetNetworkPolicy GetNetworkPolicy calls GET /network/policies/{uuid}. ```go func (c *Client) GetNetworkPolicy( ctx context.Context, uuid string, ) (NetworkPolicy, error) ``` (go-client-getnetworkpolicytag)= #### Client.GetNetworkPolicyTag GetNetworkPolicyTag calls GET /network/tags/{tag}. ```go func (c *Client) GetNetworkPolicyTag( ctx context.Context, tag string, ) (NetworkPolicyTag, error) ``` (go-client-getoperationstatus)= #### Client.GetOperationStatus GetOperationStatus calls GET /operations/{operationId}. ```go func (c *Client) GetOperationStatus( ctx context.Context, operationID string, options *GetOperationStatusOptions, ) (OperationResponse, error) ``` (go-client-importimage)= #### Client.ImportImage ImportImage calls POST /images/import. ```go func (c *Client) ImportImage( ctx context.Context, registry ImageImportRegistry, options *ImportImageOptions, ) (string, error) ``` (go-client-inspectfindimagebytag)= #### Client.InspectFindImageByTag InspectFindImageByTag calls GET /inspect/. ```go func (c *Client) InspectFindImageByTag( ctx context.Context, tag string, ) (string, error) ``` (go-client-inspectimage)= #### Client.InspectImage InspectImage calls GET /inspect/{image\_uuid}/. ```go func (c *Client) InspectImage( ctx context.Context, imageUUID string, ) (Image, error) ``` (go-client-inspectimagearchive)= #### Client.InspectImageArchive InspectImageArchive calls GET /inspect/{image\_uuid}/archive. ```go func (c *Client) InspectImageArchive( ctx context.Context, imageUUID string, path string, ) (io.ReadCloser, error) ``` (go-client-inspectimagearchiveraw)= #### Client.InspectImageArchiveRaw InspectImageArchiveRaw streams the encoded response body from InspectImageArchive. ```go func (c *Client) InspectImageArchiveRaw( ctx context.Context, imageUUID string, path string, ) (io.ReadCloser, error) ``` (go-client-inspectimagedownload)= #### Client.InspectImageDownload InspectImageDownload calls GET /inspect/{image\_uuid}/download. ```go func (c *Client) InspectImageDownload( ctx context.Context, imageUUID string, path string, ) ([]byte, error) ``` (go-client-inspectimagedownloadstream)= #### Client.InspectImageDownloadStream InspectImageDownloadStream streams the response body from InspectImageDownload. ```go func (c *Client) InspectImageDownloadStream( ctx context.Context, imageUUID string, path string, ) (io.ReadCloser, error) ``` (go-client-inspectimagegrep)= #### Client.InspectImageGrep InspectImageGrep calls GET /inspect/{image\_uuid}/grep. ```go func (c *Client) InspectImageGrep( ctx context.Context, imageUUID string, pattern []string, options *InspectImageGrepOptions, ) (GrepResult, error) ``` (go-client-inspectimagelist)= #### Client.InspectImageList InspectImageList calls GET /inspect/{image\_uuid}/list. ```go func (c *Client) InspectImageList( ctx context.Context, imageUUID string, path string, ) (DirectoryList, error) ``` (go-client-inspectinstancearchive)= #### Client.InspectInstanceArchive InspectInstanceArchive calls GET /operations/{operation\_uuid}/inspect/archive. ```go func (c *Client) InspectInstanceArchive( ctx context.Context, operationUUID string, path string, ) (io.ReadCloser, error) ``` (go-client-inspectinstancearchiveraw)= #### Client.InspectInstanceArchiveRaw InspectInstanceArchiveRaw streams the encoded response body from InspectInstanceArchive. ```go func (c *Client) InspectInstanceArchiveRaw( ctx context.Context, operationUUID string, path string, ) (io.ReadCloser, error) ``` (go-client-inspectinstancedownload)= #### Client.InspectInstanceDownload InspectInstanceDownload calls GET /operations/{operation\_uuid}/inspect/download. ```go func (c *Client) InspectInstanceDownload( ctx context.Context, operationUUID string, path string, ) ([]byte, error) ``` (go-client-inspectinstancedownloadstream)= #### Client.InspectInstanceDownloadStream InspectInstanceDownloadStream streams the response body from InspectInstanceDownload. ```go func (c *Client) InspectInstanceDownloadStream( ctx context.Context, operationUUID string, path string, ) (io.ReadCloser, error) ``` (go-client-inspectinstancegrep)= #### Client.InspectInstanceGrep InspectInstanceGrep calls GET /operations/{operation\_uuid}/inspect/grep. ```go func (c *Client) InspectInstanceGrep( ctx context.Context, operationUUID string, pattern []string, options *InspectInstanceGrepOptions, ) (GrepResult, error) ``` (go-client-inspectinstancelist)= #### Client.InspectInstanceList InspectInstanceList calls GET /operations/{operation\_uuid}/inspect/list. ```go func (c *Client) InspectInstanceList( ctx context.Context, operationUUID string, path string, ) (DirectoryList, error) ``` (go-client-iterfiles)= #### Client.IterFiles IterFiles lazily iterates ListFiles pages. Each traversal starts from the first page. The first error is yielded with a zero item, then iteration stops. Break stops fetching pages. ```go func (c *Client) IterFiles( ctx context.Context, options *IterFilesOptions, ) iter.Seq2[File, error] ``` (go-client-iterimages)= #### Client.IterImages IterImages lazily iterates ListImages pages. Each traversal starts from the first page. The first error is yielded with a zero item, then iteration stops. Break stops fetching pages. ```go func (c *Client) IterImages( ctx context.Context, options *IterImagesOptions, ) iter.Seq2[Image, error] ``` (go-client-iteroperationevents)= #### Client.IterOperationEvents IterOperationEvents lazily yields operation events. Each traversal opens a new stream and closes it when iteration ends. The first error is yielded with a zero event, then iteration stops. ```go func (c *Client) IterOperationEvents( ctx context.Context, operationID string, options *IterOperationEventsOptions, ) iter.Seq2[OperationEvent, error] ``` (go-client-iteroperations)= #### Client.IterOperations IterOperations lazily iterates ListOperations pages. Each traversal starts from the first page. The first error is yielded with a zero item, then iteration stops. Break stops fetching pages. ```go func (c *Client) IterOperations( ctx context.Context, options *IterOperationsOptions, ) iter.Seq2[OperationSummary, error] ``` (go-client-listfiles)= #### Client.ListFiles ListFiles calls GET /files. ```go func (c *Client) ListFiles( ctx context.Context, options *ListFilesOptions, ) (FilesListResponse, error) ``` (go-client-listimages)= #### Client.ListImages ListImages calls GET /images. ```go func (c *Client) ListImages( ctx context.Context, options *ListImagesOptions, ) (ImageListResponse, error) ``` (go-client-listnetworkpolicies)= #### Client.ListNetworkPolicies ListNetworkPolicies calls GET /network/policies. ```go func (c *Client) ListNetworkPolicies( ctx context.Context, options *ListNetworkPoliciesOptions, ) (NetworkPolicyListResponse, error) ``` (go-client-listnetworkpolicytags)= #### Client.ListNetworkPolicyTags ListNetworkPolicyTags calls GET /network/tags. ```go func (c *Client) ListNetworkPolicyTags( ctx context.Context, options *ListNetworkPolicyTagsOptions, ) (ListNetworkPolicyTagsResponse, error) ``` (go-client-listoperations)= #### Client.ListOperations ListOperations calls GET /operations. ```go func (c *Client) ListOperations( ctx context.Context, options *ListOperationsOptions, ) ([]OperationSummary, error) ``` (go-client-operationsubprocess)= #### Client.OperationSubprocess OperationSubprocess calls GET /operations/{operationId}/subprocesses/{spid}. ```go func (c *Client) OperationSubprocess( ctx context.Context, operationID string, spid int64, ) (InstanceResult, error) ``` (go-client-operationsubprocesscreate)= #### Client.OperationSubprocessCreate OperationSubprocessCreate calls POST /operations/{operationId}/subprocesses. ```go func (c *Client) OperationSubprocessCreate( ctx context.Context, operationID string, command string, options *OperationSubprocessCreateOptions, ) (int64, error) ``` (go-client-operationsubprocesskill)= #### Client.OperationSubprocessKill OperationSubprocessKill calls DELETE /operations/{operationId}/subprocesses/{spid}. ```go func (c *Client) OperationSubprocessKill( ctx context.Context, operationID string, spid int64, options *OperationSubprocessKillOptions, ) error ``` (go-client-operationsubprocessstdin)= #### Client.OperationSubprocessStdin OperationSubprocessStdin calls POST /operations/{operationId}/subprocesses/{spid}/stdin. ```go func (c *Client) OperationSubprocessStdin( ctx context.Context, operationID string, spid int64, valueArg string, options *OperationSubprocessStdinOptions, ) error ``` (go-client-operationterminal)= #### Client.OperationTerminal OperationTerminal reports whether an operation has reached a terminal status. Transient transport and server failures return false without an error, so callers can retry the probe. ```go func (c *Client) OperationTerminal( ctx context.Context, operationID string, ) (bool, error) ``` (go-client-resolveimage)= #### Client.ResolveImage ResolveImage resolves a UUID, a tag:NAME reference, or a bare tag to an image UUID. UUID references do not make a request. ```go func (c *Client) ResolveImage(ctx context.Context, ref string) (string, error) ``` (go-client-setnetworkpolicytag)= #### Client.SetNetworkPolicyTag SetNetworkPolicyTag calls PUT /network/tags/{tag}. ```go func (c *Client) SetNetworkPolicyTag( ctx context.Context, tag string, uuid string, ) (NetworkPolicyTag, error) ``` (go-client-spawninstance)= #### Client.SpawnInstance SpawnInstance starts an instance and returns the full response without waiting for execution to finish. Image accepts a tag:NAME reference or a bare image UUID. Pass SpawnInstanceOptions{} to use the server defaults. The response preserves all documented fields and their absent, null, and value states. Check response.UUID before using it to wait for or follow the operation. Use SpawnInstanceWithResponse for exact JSON states in request options. ```go func (c *Client) SpawnInstance( ctx context.Context, command string, image string, options SpawnInstanceOptions, ) (InstanceSpawnResponse, error) ``` **Example** ```go package main import ( "context" "fmt" "log" "time" contree "github.com/nebius/contree-client/go/v1" ) func main() { client, mock, err := contree.NewTestClient() if err != nil { log.Fatalf("create test client: %v", err) } if err := mock.Mock(contree.OpSpawnInstance, contree.InstanceSpawnResponse{UUID: contree.Some("operation-1")}); err != nil { log.Fatalf("mock instance creation: %v", err) } response, err := client.SpawnInstance( context.Background(), "wc -l < /work/data.txt", "tag:ubuntu:latest", contree.SpawnInstanceOptions{ Shell: true, Env: map[string]string{"LC_ALL": "C"}, Cwd: "/work", Timeout: time.Minute, Disposable: true, }, ) if err != nil { log.Fatalf("spawn word-count command: %v", err) } operationID, ok := response.UUID.Value() if !ok || operationID == "" { log.Fatal("spawn response has no operation ID") } fmt.Println(operationID) } ``` Output: ```text operation-1 ``` (go-client-spawninstancewithresponse)= #### Client.SpawnInstanceWithResponse SpawnInstanceWithResponse calls POST /instances. ```go func (c *Client) SpawnInstanceWithResponse( ctx context.Context, command string, image string, options *SpawnInstanceWithResponseOptions, ) (InstanceSpawnResponse, error) ``` (go-client-updateimagetag)= #### Client.UpdateImageTag UpdateImageTag calls PATCH /images/{imageUUID}/tag. ```go func (c *Client) UpdateImageTag( ctx context.Context, imageUUID string, tag string, ) (Image, error) ``` (go-client-uploadfile)= #### Client.UploadFile UploadFile calls POST /files. ```go func (c *Client) UploadFile( ctx context.Context, content io.Reader, ) (FileResponse, error) ``` (go-client-useragent)= #### Client.UserAgent UserAgent returns the value sent by this client. ```go func (c *Client) UserAgent() string ``` (go-client-waitoperation)= #### Client.WaitOperation WaitOperation returns the terminal response, including failed and cancelled responses unchanged. By default it reads the operation kind, follows instance events, and polls image imports every 500 milliseconds. An unknown kind uses events. Supply at most one options value to select a mode explicitly. The event stream stays open until completion, EOF, a transport error, or context cancellation, or an inactivity timeout. Ping frames keep it open. IdleTimeout defaults to 15 seconds and resets on incoming data, including ping frames. It never extends the overall context deadline. A completion event still requires a terminal status response. The context bounds the entire wait, including status reads and polling delays. ```go func (c *Client) WaitOperation( ctx context.Context, operationID string, options ...WaitOperationOptions, ) (OperationResponse, error) ``` (go-client-whoami)= #### Client.WhoAmI WhoAmI calls GET /whoami. ```go func (c *Client) WhoAmI( ctx context.Context, ) (WhoAmIResponse, error) ``` (go-clientoption)= ### type ClientOption ClientOption changes one Client setting. ```go type ClientOption func(*clientConfig) error ``` (go-withbaseurl)= #### WithBaseURL WithBaseURL overrides the service origin. The client appends /v1 and the generated operation path. ```go func WithBaseURL(value string) ClientOption ``` (go-withhttpclient)= #### WithHTTPClient WithHTTPClient supplies the transport settings used by the client. NewClient copies the value and disables automatic redirects so generated 3xx responses remain observable. Callers retain ownership of the supplied client. ```go func WithHTTPClient(value *http.Client) ClientOption ``` (go-withidentity)= #### WithIdentity WithIdentity prepends an application product token to the User-Agent. ```go func WithIdentity(value string) ClientOption ``` (go-withproject)= #### WithProject WithProject sets the Project request header. An empty value omits it. ```go func WithProject(value string) ClientOption ``` (go-withretry)= #### WithRetry WithRetry enables retries for idempotent buffered requests. ```go func WithRetry(policy RetryPolicy) ClientOption ``` (go-withtimeout)= #### WithTimeout WithTimeout sets the whole-request deadline for buffered operations, including retries and response reads. Caller-owned streams use their context. A zero value disables the client deadline. ```go func WithTimeout(value time.Duration) ClientOption ``` (go-withuseragent)= #### WithUserAgent WithUserAgent replaces the complete generated User-Agent value. ```go func WithUserAgent(value string) ClientOption ``` (go-withoutretry)= #### WithoutRetry WithoutRetry disables retries. This is the default. ```go func WithoutRetry() ClientOption ``` (go-closablestreamrepr)= ### type ClosableStreamRepr ClosableStreamRepr is generated from the ClosableStreamRepr schema. ```go type ClosableStreamRepr struct { Value string `json:"value"` Encoding Optional[string] `json:"encoding"` Close Optional[bool] `json:"close"` } ``` (go-newclosablestreamreprfrombytes)= #### NewClosableStreamReprFromBytes NewClosableStreamReprFromBytes constructs a stream payload from bytes. ```go func NewClosableStreamReprFromBytes(value []byte) ClosableStreamRepr ``` (go-newclosablestreamreprfromtext)= #### NewClosableStreamReprFromText NewClosableStreamReprFromText constructs a stream payload from text. ```go func NewClosableStreamReprFromText(value string) ClosableStreamRepr ``` (go-closablestreamrepr-asbytes)= #### ClosableStreamRepr.AsBytes AsBytes decodes the stream payload to bytes. ```go func (m ClosableStreamRepr) AsBytes() []byte ``` (go-closablestreamrepr-astext)= #### ClosableStreamRepr.AsText AsText decodes the stream payload to valid UTF-8 text. ```go func (m ClosableStreamRepr) AsText() string ``` (go-closablestreamrepr-marshaljson)= #### ClosableStreamRepr.MarshalJSON MarshalJSON encodes ClosableStreamRepr with exact wire names. ```go func (m ClosableStreamRepr) MarshalJSON() ([]byte, error) ``` (go-closablestreamrepr-string)= #### ClosableStreamRepr.String String returns the decoded payload text. ```go func (m ClosableStreamRepr) String() string ``` (go-closablestreamrepr-unmarshaljson)= #### ClosableStreamRepr.UnmarshalJSON UnmarshalJSON decodes ClosableStreamRepr and checks required fields. ```go func (m *ClosableStreamRepr) UnmarshalJSON(data []byte) error ``` (go-conflicterror)= ### type ConflictError ConflictError is returned for an unexpected HTTP 409 response. ```go type ConflictError struct{ *APIStatusError } ``` (go-conflicterror-error)= #### ConflictError.Error ```go func (e ConflictError) Error() string ``` (go-conflicterror-unwrap)= #### ConflictError.Unwrap ```go func (e *ConflictError) Unwrap() error ``` (go-deleteimagetagoptions)= ### type DeleteImageTagOptions DeleteImageTagOptions contains optional arguments for DeleteImageTag. ```go type DeleteImageTagOptions struct { Tag *string } ``` (go-directorylist)= ### type DirectoryList DirectoryList is generated from the DirectoryList schema. ```go type DirectoryList struct { Path string `json:"path"` Files []FileItem `json:"files"` } ``` (go-directorylist-astext)= #### DirectoryList.AsText AsText formats entries like ls -l; pass true to return one path per line. ```go func (m DirectoryList) AsText(short ...bool) string ``` (go-directorylist-marshaljson)= #### DirectoryList.MarshalJSON MarshalJSON encodes DirectoryList with exact wire names. ```go func (m DirectoryList) MarshalJSON() ([]byte, error) ``` (go-directorylist-string)= #### DirectoryList.String String returns the detailed directory listing. ```go func (m DirectoryList) String() string ``` (go-directorylist-unmarshaljson)= #### DirectoryList.UnmarshalJSON UnmarshalJSON decodes DirectoryList and checks required fields. ```go func (m *DirectoryList) UnmarshalJSON(data []byte) error ``` (go-ensurefileoptions)= ### type EnsureFileOptions EnsureFileOptions configures EnsureFile. ```go type EnsureFileOptions struct { // SHA256 is a known content digest. EnsureFile trusts a non-empty value // and does not read content before the server probe. SHA256 string } ``` (go-ensurefileresult)= ### type EnsureFileResult EnsureFileResult identifies a stored file. CreatedAt and UpdatedAt are set when the server returns an existing file. Upload responses omit them. ```go type EnsureFileResult struct { UUID string `json:"uuid"` SHA256 string `json:"sha256"` Size int64 `json:"size"` CreatedAt Optional[time.Time] `json:"created_at"` UpdatedAt Optional[time.Time] `json:"updated_at"` } ``` (go-error)= ### type Error Error is generated from the Error schema. ```go type Error struct { Error any `json:"error"` Status Optional[int64] `json:"status"` Traceback Optional[[]string] `json:"traceback"` } ``` (go-error-marshaljson)= #### Error.MarshalJSON MarshalJSON encodes Error with exact wire names. ```go func (m Error) MarshalJSON() ([]byte, error) ``` (go-error-unmarshaljson)= #### Error.UnmarshalJSON UnmarshalJSON decodes Error and checks required fields. ```go func (m *Error) UnmarshalJSON(data []byte) error ``` (go-eventdata)= ### type EventData EventData contains typed event data or a raw fallback value. ```go type EventData interface{} ``` (go-eventdatacompletion)= ### type EventDataCompletion EventDataCompletion is generated from the EventDataCompletion schema. ```go type EventDataCompletion struct { Status OperationStatus `json:"status"` ResultImageUUID Optional[string] `json:"result_image_uuid"` Error Optional[string] `json:"error"` DurationMs int64 `json:"duration_ms"` ImageSizeBytes Optional[int64] `json:"image_size_bytes"` ConsumedCPU Optional[float64] `json:"consumed_cpu"` ConsumedMemory Optional[int64] `json:"consumed_memory"` } ``` (go-eventdatacompletion-marshaljson)= #### EventDataCompletion.MarshalJSON MarshalJSON encodes EventDataCompletion with exact wire names. ```go func (m EventDataCompletion) MarshalJSON() ([]byte, error) ``` (go-eventdatacompletion-unmarshaljson)= #### EventDataCompletion.UnmarshalJSON UnmarshalJSON decodes EventDataCompletion and checks required fields. ```go func (m *EventDataCompletion) UnmarshalJSON(data []byte) error ``` (go-eventdataexit)= ### type EventDataExit EventDataExit is generated from the EventDataExit schema. ```go type EventDataExit struct { OomKilled Optional[bool] `json:"oom_killed"` Pid int64 `json:"pid"` Code int64 `json:"code"` Signal int64 `json:"signal"` CoreDump Optional[bool] `json:"core_dump"` TimedOut bool `json:"timed_out"` DurationMs int64 `json:"duration_ms"` Resources EventResources `json:"resources"` } ``` (go-eventdataexit-marshaljson)= #### EventDataExit.MarshalJSON MarshalJSON encodes EventDataExit with exact wire names. ```go func (m EventDataExit) MarshalJSON() ([]byte, error) ``` (go-eventdataexit-unmarshaljson)= #### EventDataExit.UnmarshalJSON UnmarshalJSON decodes EventDataExit and checks required fields. ```go func (m *EventDataExit) UnmarshalJSON(data []byte) error ``` (go-eventdatafileupload)= ### type EventDataFileUpload EventDataFileUpload is generated from the EventDataFileUpload schema. ```go type EventDataFileUpload struct { Handle string `json:"handle"` FileUUID string `json:"file_uuid"` Path string `json:"path"` Unpack bool `json:"unpack"` Replace bool `json:"replace"` Merge bool `json:"merge"` Bytes int64 `json:"bytes"` Status string `json:"status"` Error *string `json:"error"` } ``` (go-eventdatafileupload-marshaljson)= #### EventDataFileUpload.MarshalJSON MarshalJSON encodes EventDataFileUpload with exact wire names. ```go func (m EventDataFileUpload) MarshalJSON() ([]byte, error) ``` (go-eventdatafileupload-unmarshaljson)= #### EventDataFileUpload.UnmarshalJSON UnmarshalJSON decodes EventDataFileUpload and checks required fields. ```go func (m *EventDataFileUpload) UnmarshalJSON(data []byte) error ``` (go-eventdatainit)= ### type EventDataInit EventDataInit is generated from the EventDataInit schema. ```go type EventDataInit struct { StartedAt time.Time `json:"started_at"` RuntimePath string `json:"runtime_path"` Verbose bool `json:"verbose"` InitPid int64 `json:"init_pid"` Hostname Optional[string] `json:"hostname"` Kernel Optional[string] `json:"kernel"` Machine Optional[string] `json:"machine"` BootID Optional[string] `json:"boot_id"` } ``` (go-eventdatainit-marshaljson)= #### EventDataInit.MarshalJSON MarshalJSON encodes EventDataInit with exact wire names. ```go func (m EventDataInit) MarshalJSON() ([]byte, error) ``` (go-eventdatainit-unmarshaljson)= #### EventDataInit.UnmarshalJSON UnmarshalJSON decodes EventDataInit and checks required fields. ```go func (m *EventDataInit) UnmarshalJSON(data []byte) error ``` (go-eventdatainspect)= ### type EventDataInspect EventDataInspect is generated from the EventDataInspect schema. ```go type EventDataInspect struct { RequestID string `json:"request_id"` Method string `json:"method"` Phase string `json:"phase"` Params Optional[EventInspectParameters] `json:"params"` Status Optional[string] `json:"status"` Error Optional[string] `json:"error"` Handle Optional[string] `json:"handle"` Bytes Optional[int64] `json:"bytes"` Eof Optional[bool] `json:"eof"` } ``` (go-eventdatainspect-marshaljson)= #### EventDataInspect.MarshalJSON MarshalJSON encodes EventDataInspect with exact wire names. ```go func (m EventDataInspect) MarshalJSON() ([]byte, error) ``` (go-eventdatainspect-unmarshaljson)= #### EventDataInspect.UnmarshalJSON UnmarshalJSON decodes EventDataInspect and checks required fields. ```go func (m *EventDataInspect) UnmarshalJSON(data []byte) error ``` (go-eventdatanetwork)= ### type EventDataNetwork EventDataNetwork is generated from the EventDataNetwork schema. ```go type EventDataNetwork struct { Interfaces []NetworkInterface `json:"interfaces"` Configured Optional[EventDataNetworkConfigured] `json:"configured"` Error Optional[string] `json:"error"` } ``` (go-eventdatanetwork-marshaljson)= #### EventDataNetwork.MarshalJSON MarshalJSON encodes EventDataNetwork with exact wire names. ```go func (m EventDataNetwork) MarshalJSON() ([]byte, error) ``` (go-eventdatanetwork-unmarshaljson)= #### EventDataNetwork.UnmarshalJSON UnmarshalJSON decodes EventDataNetwork and checks required fields. ```go func (m *EventDataNetwork) UnmarshalJSON(data []byte) error ``` (go-eventdatanetworkconfigured)= ### type EventDataNetworkConfigured EventDataNetworkConfigured is generated from the EventDataNetworkConfigured schema. ```go type EventDataNetworkConfigured struct { IP4 Optional[string] `json:"ip4"` IP4Gw Optional[string] `json:"ip4_gw"` IP6 Optional[string] `json:"ip6"` IP6Gw Optional[string] `json:"ip6_gw"` GwMac Optional[string] `json:"gw_mac"` Nameserver Optional[string] `json:"nameserver"` } ``` (go-eventdatanetworkconfigured-marshaljson)= #### EventDataNetworkConfigured.MarshalJSON MarshalJSON encodes EventDataNetworkConfigured with exact wire names. ```go func (m EventDataNetworkConfigured) MarshalJSON() ([]byte, error) ``` (go-eventdatanetworkconfigured-unmarshaljson)= #### EventDataNetworkConfigured.UnmarshalJSON UnmarshalJSON decodes EventDataNetworkConfigured and checks required fields. ```go func (m *EventDataNetworkConfigured) UnmarshalJSON(data []byte) error ``` (go-eventdatashutdown)= ### type EventDataShutdown EventDataShutdown is generated from the EventDataShutdown schema. ```go type EventDataShutdown struct { StoppedAt time.Time `json:"stopped_at"` Reason string `json:"reason"` } ``` (go-eventdatashutdown-marshaljson)= #### EventDataShutdown.MarshalJSON MarshalJSON encodes EventDataShutdown with exact wire names. ```go func (m EventDataShutdown) MarshalJSON() ([]byte, error) ``` (go-eventdatashutdown-unmarshaljson)= #### EventDataShutdown.UnmarshalJSON UnmarshalJSON decodes EventDataShutdown and checks required fields. ```go func (m *EventDataShutdown) UnmarshalJSON(data []byte) error ``` (go-eventdatasizecap)= ### type EventDataSizeCap EventDataSizeCap is generated from the EventDataSizeCap schema. ```go type EventDataSizeCap struct { LimitBytes int64 `json:"limit_bytes"` FileSize int64 `json:"file_size"` } ``` (go-eventdatasizecap-marshaljson)= #### EventDataSizeCap.MarshalJSON MarshalJSON encodes EventDataSizeCap with exact wire names. ```go func (m EventDataSizeCap) MarshalJSON() ([]byte, error) ``` (go-eventdatasizecap-unmarshaljson)= #### EventDataSizeCap.UnmarshalJSON UnmarshalJSON decodes EventDataSizeCap and checks required fields. ```go func (m *EventDataSizeCap) UnmarshalJSON(data []byte) error ``` (go-eventdataspawn)= ### type EventDataSpawn EventDataSpawn is generated from the EventDataSpawn schema. ```go type EventDataSpawn struct { ResourcesLimits Optional[ProcessResourcesLimits] `json:"resources_limits"` CPUAffinity Optional[[]int64] `json:"cpu_affinity"` Pid int64 `json:"pid"` Command string `json:"command"` Args []string `json:"args"` Shell bool `json:"shell"` Cwd string `json:"cwd"` UID int64 `json:"uid"` GID int64 `json:"gid"` Timeout int64 `json:"timeout"` TruncateAt int64 `json:"truncate_at"` Env Optional[map[string]string] `json:"env"` } ``` (go-eventdataspawn-marshaljson)= #### EventDataSpawn.MarshalJSON MarshalJSON encodes EventDataSpawn with exact wire names. ```go func (m EventDataSpawn) MarshalJSON() ([]byte, error) ``` (go-eventdataspawn-unmarshaljson)= #### EventDataSpawn.UnmarshalJSON UnmarshalJSON decodes EventDataSpawn and checks required fields. ```go func (m *EventDataSpawn) UnmarshalJSON(data []byte) error ``` (go-eventdatastream)= ### type EventDataStream EventDataStream is generated from the EventDataStream schema. ```go type EventDataStream struct { Value string `json:"value"` Encoding string `json:"encoding"` Truncated Optional[bool] `json:"truncated"` } ``` (go-neweventdatastreamfrombytes)= #### NewEventDataStreamFromBytes NewEventDataStreamFromBytes constructs a stream payload from bytes. ```go func NewEventDataStreamFromBytes(value []byte) EventDataStream ``` (go-neweventdatastreamfromtext)= #### NewEventDataStreamFromText NewEventDataStreamFromText constructs a stream payload from text. ```go func NewEventDataStreamFromText(value string) EventDataStream ``` (go-eventdatastream-asbytes)= #### EventDataStream.AsBytes AsBytes decodes the stream payload to bytes. ```go func (m EventDataStream) AsBytes() []byte ``` (go-eventdatastream-astext)= #### EventDataStream.AsText AsText decodes the stream payload to valid UTF-8 text. ```go func (m EventDataStream) AsText() string ``` (go-eventdatastream-marshaljson)= #### EventDataStream.MarshalJSON MarshalJSON encodes EventDataStream with exact wire names. ```go func (m EventDataStream) MarshalJSON() ([]byte, error) ``` (go-eventdatastream-string)= #### EventDataStream.String String returns the decoded payload text. ```go func (m EventDataStream) String() string ``` (go-eventdatastream-unmarshaljson)= #### EventDataStream.UnmarshalJSON UnmarshalJSON decodes EventDataStream and checks required fields. ```go func (m *EventDataStream) UnmarshalJSON(data []byte) error ``` (go-eventdatatruncated)= ### type EventDataTruncated EventDataTruncated is generated from the EventDataTruncated schema. ```go type EventDataTruncated struct { Stream string `json:"stream"` BytesEmitted int64 `json:"bytes_emitted"` BytesDropped int64 `json:"bytes_dropped"` } ``` (go-eventdatatruncated-marshaljson)= #### EventDataTruncated.MarshalJSON MarshalJSON encodes EventDataTruncated with exact wire names. ```go func (m EventDataTruncated) MarshalJSON() ([]byte, error) ``` (go-eventdatatruncated-unmarshaljson)= #### EventDataTruncated.UnmarshalJSON UnmarshalJSON decodes EventDataTruncated and checks required fields. ```go func (m *EventDataTruncated) UnmarshalJSON(data []byte) error ``` (go-eventinspectparameters)= ### type EventInspectParameters EventInspectParameters is generated from the EventInspectParameters schema. ```go type EventInspectParameters struct { Path Optional[string] `json:"path"` FileUUID Optional[string] `json:"file_uuid"` Unpack Optional[bool] `json:"unpack"` Replace Optional[bool] `json:"replace"` Merge Optional[bool] `json:"merge"` Handle Optional[string] `json:"handle"` Offset Optional[int64] `json:"offset"` Size Optional[int64] `json:"size"` Options Optional[EventInspectParametersOptions] `json:"options"` } ``` (go-eventinspectparameters-marshaljson)= #### EventInspectParameters.MarshalJSON MarshalJSON encodes EventInspectParameters with exact wire names. ```go func (m EventInspectParameters) MarshalJSON() ([]byte, error) ``` (go-eventinspectparameters-unmarshaljson)= #### EventInspectParameters.UnmarshalJSON UnmarshalJSON decodes EventInspectParameters and checks required fields. ```go func (m *EventInspectParameters) UnmarshalJSON(data []byte) error ``` (go-eventinspectparametersoptions)= ### type EventInspectParametersOptions EventInspectParametersOptions is generated from the EventInspectParametersOptions schema. ```go type EventInspectParametersOptions struct { Patterns *[]string `json:"patterns"` Globs *[]string `json:"globs"` Case string `json:"case"` MaxCount int64 `json:"max_count"` MaxTotal int64 `json:"max_total"` Before int64 `json:"before"` After int64 `json:"after"` } ``` (go-eventinspectparametersoptions-marshaljson)= #### EventInspectParametersOptions.MarshalJSON MarshalJSON encodes EventInspectParametersOptions with exact wire names. ```go func (m EventInspectParametersOptions) MarshalJSON() ([]byte, error) ``` (go-eventinspectparametersoptions-unmarshaljson)= #### EventInspectParametersOptions.UnmarshalJSON UnmarshalJSON decodes EventInspectParametersOptions and checks required fields. ```go func (m *EventInspectParametersOptions) UnmarshalJSON(data []byte) error ``` (go-eventresources)= ### type EventResources EventResources is generated from the EventResources schema. ```go type EventResources struct { UserTimeUs int64 `json:"user_time_us"` SysTimeUs int64 `json:"sys_time_us"` MaxRssKb int64 `json:"max_rss_kb"` SharedMemory int64 `json:"shared_memory"` UnsharedMemory int64 `json:"unshared_memory"` Swaps int64 `json:"swaps"` MinorFaults int64 `json:"minor_faults"` MajorFaults int64 `json:"major_faults"` VoluntaryCtxSwitches int64 `json:"voluntary_ctx_switches"` InvoluntaryCtxSwitches int64 `json:"involuntary_ctx_switches"` BlockInputOps int64 `json:"block_input_ops"` BlockOutputOps int64 `json:"block_output_ops"` IpcMsgsSent int64 `json:"ipc_msgs_sent"` IpcMsgsReceived int64 `json:"ipc_msgs_received"` SignalsReceived int64 `json:"signals_received"` } ``` (go-eventresources-marshaljson)= #### EventResources.MarshalJSON MarshalJSON encodes EventResources with exact wire names. ```go func (m EventResources) MarshalJSON() ([]byte, error) ``` (go-eventresources-unmarshaljson)= #### EventResources.UnmarshalJSON UnmarshalJSON decodes EventResources and checks required fields. ```go func (m *EventResources) UnmarshalJSON(data []byte) error ``` (go-execspec)= ### type ExecSpec ExecSpec is generated from the ExecSpec schema. ```go type ExecSpec struct { ResourcesLimits Optional[ProcessResourcesLimits] `json:"resources_limits"` Command string `json:"command"` Args Optional[[]string] `json:"args"` Shell Optional[bool] `json:"shell"` Env Optional[map[string]string] `json:"env"` Cwd Optional[string] `json:"cwd"` UID Optional[int64] `json:"uid"` GID Optional[int64] `json:"gid"` Stdin Optional[ClosableStreamRepr] `json:"stdin"` TruncateOutputAt Optional[int64] `json:"truncate_output_at"` } ``` (go-execspec-marshaljson)= #### ExecSpec.MarshalJSON MarshalJSON encodes ExecSpec with exact wire names. ```go func (m ExecSpec) MarshalJSON() ([]byte, error) ``` (go-execspec-unmarshaljson)= #### ExecSpec.UnmarshalJSON UnmarshalJSON decodes ExecSpec and checks required fields. ```go func (m *ExecSpec) UnmarshalJSON(data []byte) error ``` (go-file)= ### type File File is generated from the File schema. ```go type File struct { UUID string `json:"uuid"` SHA256 string `json:"sha256"` Size int64 `json:"size"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` } ``` (go-file-marshaljson)= #### File.MarshalJSON MarshalJSON encodes File with exact wire names. ```go func (m File) MarshalJSON() ([]byte, error) ``` (go-file-unmarshaljson)= #### File.UnmarshalJSON UnmarshalJSON decodes File and checks required fields. ```go func (m *File) UnmarshalJSON(data []byte) error ``` (go-fileitem)= ### type FileItem FileItem is generated from the FileItem schema. ```go type FileItem struct { Size int64 `json:"size"` Path string `json:"path"` Owner StringOrInt64 `json:"owner"` Group StringOrInt64 `json:"group"` UID int64 `json:"uid"` GID int64 `json:"gid"` Mode int64 `json:"mode"` Mtime int64 `json:"mtime"` Nlink int64 `json:"nlink"` IsDir bool `json:"is_dir"` IsRegular bool `json:"is_regular"` IsSymlink bool `json:"is_symlink"` IsSocket bool `json:"is_socket"` IsFifo bool `json:"is_fifo"` SymlinkTo string `json:"symlink_to"` } ``` (go-fileitem-marshaljson)= #### FileItem.MarshalJSON MarshalJSON encodes FileItem with exact wire names. ```go func (m FileItem) MarshalJSON() ([]byte, error) ``` (go-fileitem-unmarshaljson)= #### FileItem.UnmarshalJSON UnmarshalJSON decodes FileItem and checks required fields. ```go func (m *FileItem) UnmarshalJSON(data []byte) error ``` (go-fileresponse)= ### type FileResponse FileResponse is generated from the FileResponse schema. ```go type FileResponse struct { UUID string `json:"uuid"` SHA256 string `json:"sha256"` Size int64 `json:"size"` } ``` (go-fileresponse-marshaljson)= #### FileResponse.MarshalJSON MarshalJSON encodes FileResponse with exact wire names. ```go func (m FileResponse) MarshalJSON() ([]byte, error) ``` (go-fileresponse-unmarshaljson)= #### FileResponse.UnmarshalJSON UnmarshalJSON decodes FileResponse and checks required fields. ```go func (m *FileResponse) UnmarshalJSON(data []byte) error ``` (go-filespec)= ### type FileSpec FileSpec is generated from the FileSpec schema. ```go type FileSpec struct { UUID Optional[string] `json:"uuid"` UID Optional[int64] `json:"uid"` GID Optional[int64] `json:"gid"` Mode Optional[StringOrInt64] `json:"mode"` } ``` (go-filespec-marshaljson)= #### FileSpec.MarshalJSON MarshalJSON encodes FileSpec with exact wire names. ```go func (m FileSpec) MarshalJSON() ([]byte, error) ``` (go-filespec-normalizemode)= #### FileSpec.NormalizeMode NormalizeMode converts an integer mode to its wire-format octal string. ```go func (m *FileSpec) NormalizeMode() ``` (go-filespec-setmode)= #### FileSpec.SetMode SetMode stores mode in the wire-format octal representation. ```go func (m *FileSpec) SetMode(mode int64) ``` (go-filespec-unmarshaljson)= #### FileSpec.UnmarshalJSON UnmarshalJSON decodes FileSpec and checks required fields. ```go func (m *FileSpec) UnmarshalJSON(data []byte) error ``` (go-fileslistresponse)= ### type FilesListResponse FilesListResponse is generated from the FilesListResponse schema. ```go type FilesListResponse struct { Files Optional[[]File] `json:"files"` } ``` (go-fileslistresponse-marshaljson)= #### FilesListResponse.MarshalJSON MarshalJSON encodes FilesListResponse with exact wire names. ```go func (m FilesListResponse) MarshalJSON() ([]byte, error) ``` (go-fileslistresponse-unmarshaljson)= #### FilesListResponse.UnmarshalJSON UnmarshalJSON decodes FilesListResponse and checks required fields. ```go func (m *FilesListResponse) UnmarshalJSON(data []byte) error ``` (go-followoperationeventsoptions)= ### type FollowOperationEventsOptions FollowOperationEventsOptions controls a reconnecting operation event stream. Live following switches to a finite retained-event read after terminal status. ```go type FollowOperationEventsOptions struct { SPID *int64 Since *int64 LastEventID *int64 // IdleTimeout is the maximum gap between incoming SSE data in seconds. // Nil uses 15 seconds. Zero disables the limit. Ping frames reset it. IdleTimeout *float64 } ``` (go-getoperationstatusoptions)= ### type GetOperationStatusOptions GetOperationStatusOptions contains optional arguments for GetOperationStatus. ```go type GetOperationStatusOptions struct { Inflight bool } ``` (go-goneerror)= ### type GoneError GoneError is returned for an unexpected HTTP 410 response. ```go type GoneError struct{ *APIStatusError } ``` (go-goneerror-error)= #### GoneError.Error ```go func (e GoneError) Error() string ``` (go-goneerror-unwrap)= #### GoneError.Unwrap ```go func (e *GoneError) Unwrap() error ``` (go-grepmatch)= ### type GrepMatch GrepMatch is generated from the GrepMatch schema. ```go type GrepMatch struct { Path string `json:"path"` LineNumber int64 `json:"line_number"` AbsoluteOffset int64 `json:"absolute_offset"` LineText string `json:"line_text"` LineBytes int64 `json:"line_bytes"` Submatches []GrepSubmatch `json:"submatches"` Type string `json:"type"` } ``` (go-grepmatch-astext)= #### GrepMatch.AsText AsText formats one grep row with its path, line number, and trailing newline. ```go func (m GrepMatch) AsText() string ``` (go-grepmatch-marshaljson)= #### GrepMatch.MarshalJSON MarshalJSON encodes GrepMatch with exact wire names. ```go func (m GrepMatch) MarshalJSON() ([]byte, error) ``` (go-grepmatch-string)= #### GrepMatch.String String returns the formatted grep row. ```go func (m GrepMatch) String() string ``` (go-grepmatch-unmarshaljson)= #### GrepMatch.UnmarshalJSON UnmarshalJSON decodes GrepMatch and checks required fields. ```go func (m *GrepMatch) UnmarshalJSON(data []byte) error ``` (go-grepresult)= ### type GrepResult GrepResult is generated from the GrepResult schema. ```go type GrepResult struct { Path string `json:"path"` Patterns []string `json:"patterns"` Matches []GrepMatch `json:"matches"` Truncated bool `json:"truncated"` } ``` (go-grepresult-astext)= #### GrepResult.AsText AsText formats grep rows in response order, separating disjoint context groups. ```go func (m GrepResult) AsText() string ``` (go-grepresult-marshaljson)= #### GrepResult.MarshalJSON MarshalJSON encodes GrepResult with exact wire names. ```go func (m GrepResult) MarshalJSON() ([]byte, error) ``` (go-grepresult-string)= #### GrepResult.String String returns the formatted grep results. ```go func (m GrepResult) String() string ``` (go-grepresult-unmarshaljson)= #### GrepResult.UnmarshalJSON UnmarshalJSON decodes GrepResult and checks required fields. ```go func (m *GrepResult) UnmarshalJSON(data []byte) error ``` (go-grepsubmatch)= ### type GrepSubmatch GrepSubmatch is generated from the GrepSubmatch schema. ```go type GrepSubmatch struct { Text string `json:"text"` Start int64 `json:"start"` End int64 `json:"end"` } ``` (go-grepsubmatch-marshaljson)= #### GrepSubmatch.MarshalJSON MarshalJSON encodes GrepSubmatch with exact wire names. ```go func (m GrepSubmatch) MarshalJSON() ([]byte, error) ``` (go-grepsubmatch-unmarshaljson)= #### GrepSubmatch.UnmarshalJSON UnmarshalJSON decodes GrepSubmatch and checks required fields. ```go func (m *GrepSubmatch) UnmarshalJSON(data []byte) error ``` (go-image)= ### type Image Image is generated from the Image schema. ```go type Image struct { UUID Optional[string] `json:"uuid"` Tag Optional[string] `json:"tag"` CreatedAt Optional[string] `json:"created_at"` OperationUUID Optional[string] `json:"operation_uuid"` } ``` (go-image-marshaljson)= #### Image.MarshalJSON MarshalJSON encodes Image with exact wire names. ```go func (m Image) MarshalJSON() ([]byte, error) ``` (go-image-unmarshaljson)= #### Image.UnmarshalJSON UnmarshalJSON decodes Image and checks required fields. ```go func (m *Image) UnmarshalJSON(data []byte) error ``` (go-imageimportmetadata)= ### type ImageImportMetadata ImageImportMetadata is generated from the ImageImportMetadata schema. ```go type ImageImportMetadata struct { Registry Optional[ImageImportMetadataRegistry] `json:"registry"` Tag Optional[string] `json:"tag"` Timeout Optional[int64] `json:"timeout"` } ``` (go-imageimportmetadata-marshaljson)= #### ImageImportMetadata.MarshalJSON MarshalJSON encodes ImageImportMetadata with exact wire names. ```go func (m ImageImportMetadata) MarshalJSON() ([]byte, error) ``` (go-imageimportmetadata-unmarshaljson)= #### ImageImportMetadata.UnmarshalJSON UnmarshalJSON decodes ImageImportMetadata and checks required fields. ```go func (m *ImageImportMetadata) UnmarshalJSON(data []byte) error ``` (go-imageimportmetadataregistry)= ### type ImageImportMetadataRegistry ImageImportMetadataRegistry is generated from the ImageImportMetadataRegistry schema. ```go type ImageImportMetadataRegistry struct { URL Optional[string] `json:"url"` Credentials Optional[ImageImportMetadataRegistryCredentials] `json:"credentials"` } ``` (go-imageimportmetadataregistry-marshaljson)= #### ImageImportMetadataRegistry.MarshalJSON MarshalJSON encodes ImageImportMetadataRegistry with exact wire names. ```go func (m ImageImportMetadataRegistry) MarshalJSON() ([]byte, error) ``` (go-imageimportmetadataregistry-unmarshaljson)= #### ImageImportMetadataRegistry.UnmarshalJSON UnmarshalJSON decodes ImageImportMetadataRegistry and checks required fields. ```go func (m *ImageImportMetadataRegistry) UnmarshalJSON(data []byte) error ``` (go-imageimportmetadataregistrycredentials)= ### type ImageImportMetadataRegistryCredentials ImageImportMetadataRegistryCredentials is generated from the ImageImportMetadataRegistryCredentials schema. ```go type ImageImportMetadataRegistryCredentials struct { Username Optional[string] `json:"username"` Password Optional[string] `json:"password"` } ``` (go-imageimportmetadataregistrycredentials-marshaljson)= #### ImageImportMetadataRegistryCredentials.MarshalJSON MarshalJSON encodes ImageImportMetadataRegistryCredentials with exact wire names. ```go func (m ImageImportMetadataRegistryCredentials) MarshalJSON() ([]byte, error) ``` (go-imageimportmetadataregistrycredentials-unmarshaljson)= #### ImageImportMetadataRegistryCredentials.UnmarshalJSON UnmarshalJSON decodes ImageImportMetadataRegistryCredentials and checks required fields. ```go func (m *ImageImportMetadataRegistryCredentials) UnmarshalJSON(data []byte) error ``` (go-imageimportregistry)= ### type ImageImportRegistry ImageImportRegistry is generated from the ImageImportRegistry schema. ```go type ImageImportRegistry struct { URL string `json:"url"` Credentials Optional[ImageImportRegistryCredentials] `json:"credentials"` } ``` (go-imageimportregistry-marshaljson)= #### ImageImportRegistry.MarshalJSON MarshalJSON encodes ImageImportRegistry with exact wire names. ```go func (m ImageImportRegistry) MarshalJSON() ([]byte, error) ``` (go-imageimportregistry-unmarshaljson)= #### ImageImportRegistry.UnmarshalJSON UnmarshalJSON decodes ImageImportRegistry and checks required fields. ```go func (m *ImageImportRegistry) UnmarshalJSON(data []byte) error ``` (go-imageimportregistrycredentials)= ### type ImageImportRegistryCredentials ImageImportRegistryCredentials is generated from the ImageImportRegistryCredentials schema. ```go type ImageImportRegistryCredentials struct { Username Optional[string] `json:"username"` Password Optional[string] `json:"password"` } ``` (go-imageimportregistrycredentials-marshaljson)= #### ImageImportRegistryCredentials.MarshalJSON MarshalJSON encodes ImageImportRegistryCredentials with exact wire names. ```go func (m ImageImportRegistryCredentials) MarshalJSON() ([]byte, error) ``` (go-imageimportregistrycredentials-unmarshaljson)= #### ImageImportRegistryCredentials.UnmarshalJSON UnmarshalJSON decodes ImageImportRegistryCredentials and checks required fields. ```go func (m *ImageImportRegistryCredentials) UnmarshalJSON(data []byte) error ``` (go-imageimportrequest)= ### type ImageImportRequest ImageImportRequest is generated from the ImageImportRequest schema. ```go type ImageImportRequest struct { Registry ImageImportRegistry `json:"registry"` Tag Optional[string] `json:"tag"` Timeout Optional[int64] `json:"timeout"` } ``` (go-imageimportrequest-marshaljson)= #### ImageImportRequest.MarshalJSON MarshalJSON encodes ImageImportRequest with exact wire names. ```go func (m ImageImportRequest) MarshalJSON() ([]byte, error) ``` (go-imageimportrequest-unmarshaljson)= #### ImageImportRequest.UnmarshalJSON UnmarshalJSON decodes ImageImportRequest and checks required fields. ```go func (m *ImageImportRequest) UnmarshalJSON(data []byte) error ``` (go-imagelistresponse)= ### type ImageListResponse ImageListResponse is generated from the ImageListResponse schema. ```go type ImageListResponse struct { Images Optional[[]Image] `json:"images"` } ``` (go-imagelistresponse-marshaljson)= #### ImageListResponse.MarshalJSON MarshalJSON encodes ImageListResponse with exact wire names. ```go func (m ImageListResponse) MarshalJSON() ([]byte, error) ``` (go-imagelistresponse-unmarshaljson)= #### ImageListResponse.UnmarshalJSON UnmarshalJSON decodes ImageListResponse and checks required fields. ```go func (m *ImageListResponse) UnmarshalJSON(data []byte) error ``` (go-importimageoptions)= ### type ImportImageOptions ImportImageOptions contains optional arguments for ImportImage. ```go type ImportImageOptions struct { Tag Optional[string] Timeout Optional[int64] } ``` (go-inspectimagegrepoptions)= ### type InspectImageGrepOptions InspectImageGrepOptions contains optional arguments for InspectImageGrep. ```go type InspectImageGrepOptions struct { Path *[]string Glob *[]string MaxCount *int64 MaxTotal *int64 Case *string Before *int64 After *int64 } ``` (go-inspectinstancegrepoptions)= ### type InspectInstanceGrepOptions InspectInstanceGrepOptions contains optional arguments for InspectInstanceGrep. ```go type InspectInstanceGrepOptions struct { Path *[]string Glob *[]string MaxCount *int64 MaxTotal *int64 Case *string Before *int64 After *int64 } ``` (go-instancenetworking)= ### type InstanceNetworking InstanceNetworking is generated from the InstanceNetworking schema. ```go type InstanceNetworking struct { Enabled Optional[bool] `json:"enabled"` Policy Optional[[]string] `json:"policy"` } ``` (go-instancenetworking-marshaljson)= #### InstanceNetworking.MarshalJSON MarshalJSON encodes InstanceNetworking with exact wire names. ```go func (m InstanceNetworking) MarshalJSON() ([]byte, error) ``` (go-instancenetworking-unmarshaljson)= #### InstanceNetworking.UnmarshalJSON UnmarshalJSON decodes InstanceNetworking and checks required fields. ```go func (m *InstanceNetworking) UnmarshalJSON(data []byte) error ``` (go-instancenetworkingresponse)= ### type InstanceNetworkingResponse InstanceNetworkingResponse is generated from the InstanceNetworkingResponse schema. ```go type InstanceNetworkingResponse struct { Enabled Optional[bool] `json:"enabled"` Policy Optional[[]string] `json:"policy"` EffectivePolicy Optional[NetworkPolicyCreateRequest] `json:"effective_policy"` } ``` (go-instancenetworkingresponse-marshaljson)= #### InstanceNetworkingResponse.MarshalJSON MarshalJSON encodes InstanceNetworkingResponse with exact wire names. ```go func (m InstanceNetworkingResponse) MarshalJSON() ([]byte, error) ``` (go-instancenetworkingresponse-unmarshaljson)= #### InstanceNetworkingResponse.UnmarshalJSON UnmarshalJSON decodes InstanceNetworkingResponse and checks required fields. ```go func (m *InstanceNetworkingResponse) UnmarshalJSON(data []byte) error ``` (go-instanceresourceslimits)= ### type InstanceResourcesLimits InstanceResourcesLimits is generated from the InstanceResourcesLimits schema. ```go type InstanceResourcesLimits struct { CPU Optional[int64] `json:"cpu"` MemoryMib Optional[int64] `json:"memory_mib"` MaxLayerBytes Optional[int64] `json:"max_layer_bytes"` } ``` (go-instanceresourceslimits-marshaljson)= #### InstanceResourcesLimits.MarshalJSON MarshalJSON encodes InstanceResourcesLimits with exact wire names. ```go func (m InstanceResourcesLimits) MarshalJSON() ([]byte, error) ``` (go-instanceresourceslimits-unmarshaljson)= #### InstanceResourcesLimits.UnmarshalJSON UnmarshalJSON decodes InstanceResourcesLimits and checks required fields. ```go func (m *InstanceResourcesLimits) UnmarshalJSON(data []byte) error ``` (go-instanceresult)= ### type InstanceResult InstanceResult is generated from the InstanceResult schema. ```go type InstanceResult struct { Resources Optional[InstanceResultResources] `json:"resources"` State Optional[InstanceResultState] `json:"state"` Stdout Optional[StreamRepr] `json:"stdout"` Stderr Optional[StreamRepr] `json:"stderr"` } ``` (go-instanceresult-marshaljson)= #### InstanceResult.MarshalJSON MarshalJSON encodes InstanceResult with exact wire names. ```go func (m InstanceResult) MarshalJSON() ([]byte, error) ``` (go-instanceresult-unmarshaljson)= #### InstanceResult.UnmarshalJSON UnmarshalJSON decodes InstanceResult and checks required fields. ```go func (m *InstanceResult) UnmarshalJSON(data []byte) error ``` (go-instanceresultresources)= ### type InstanceResultResources InstanceResultResources is generated from the InstanceResultResources schema. ```go type InstanceResultResources struct { BlockInput Optional[int64] `json:"block_input"` BlockOutput Optional[int64] `json:"block_output"` Cost Optional[float64] `json:"cost"` ElapsedTime Optional[float64] `json:"elapsed_time"` InvoluntarySwitches Optional[int64] `json:"involuntary_switches"` MaxRss Optional[int64] `json:"max_rss"` MonotonicTime Optional[float64] `json:"monotonic_time"` PageFaults Optional[int64] `json:"page_faults"` PageFaultsIo Optional[int64] `json:"page_faults_io"` SharedMemory Optional[int64] `json:"shared_memory"` Signals Optional[int64] `json:"signals"` Swaps Optional[int64] `json:"swaps"` SystemCPUTime Optional[float64] `json:"system_cpu_time"` UnsharedMemory Optional[int64] `json:"unshared_memory"` UserCPUTime Optional[float64] `json:"user_cpu_time"` VoluntarySwitches Optional[int64] `json:"voluntary_switches"` } ``` (go-instanceresultresources-marshaljson)= #### InstanceResultResources.MarshalJSON MarshalJSON encodes InstanceResultResources with exact wire names. ```go func (m InstanceResultResources) MarshalJSON() ([]byte, error) ``` (go-instanceresultresources-unmarshaljson)= #### InstanceResultResources.UnmarshalJSON UnmarshalJSON decodes InstanceResultResources and checks required fields. ```go func (m *InstanceResultResources) UnmarshalJSON(data []byte) error ``` (go-instanceresultstate)= ### type InstanceResultState InstanceResultState is generated from the InstanceResultState schema. ```go type InstanceResultState struct { Continued Optional[bool] `json:"continued"` CoreDump Optional[bool] `json:"core_dump"` ExitCode Optional[int64] `json:"exit_code"` Pid Optional[int64] `json:"pid"` Signal Optional[int64] `json:"signal"` Stopped Optional[bool] `json:"stopped"` TimedOut Optional[bool] `json:"timed_out"` OomKilled Optional[bool] `json:"oom_killed"` } ``` (go-instanceresultstate-marshaljson)= #### InstanceResultState.MarshalJSON MarshalJSON encodes InstanceResultState with exact wire names. ```go func (m InstanceResultState) MarshalJSON() ([]byte, error) ``` (go-instanceresultstate-unmarshaljson)= #### InstanceResultState.UnmarshalJSON UnmarshalJSON decodes InstanceResultState and checks required fields. ```go func (m *InstanceResultState) UnmarshalJSON(data []byte) error ``` (go-instancespawnrequest)= ### type InstanceSpawnRequest InstanceSpawnRequest is generated from the InstanceSpawnRequest schema. ```go type InstanceSpawnRequest struct { Command string `json:"command"` Disposable Optional[bool] `json:"disposable"` Hostname Optional[string] `json:"hostname"` Image string `json:"image"` Args Optional[[]string] `json:"args"` Shell Optional[bool] `json:"shell"` Env Optional[map[string]string] `json:"env"` PreserveEnv Optional[bool] `json:"preserve_env"` PreserveCwd Optional[bool] `json:"preserve_cwd"` Cwd Optional[string] `json:"cwd"` UID Optional[int64] `json:"uid"` GID Optional[int64] `json:"gid"` ResourcesLimits Optional[InstanceResourcesLimits] `json:"resources_limits"` Networking Optional[InstanceNetworking] `json:"networking"` Stdin Optional[ClosableStreamRepr] `json:"stdin"` Timeout Optional[int64] `json:"timeout"` TruncateOutputAt Optional[int64] `json:"truncate_output_at"` Files Optional[map[string]FileSpec] `json:"files"` } ``` (go-instancespawnrequest-marshaljson)= #### InstanceSpawnRequest.MarshalJSON MarshalJSON encodes InstanceSpawnRequest with exact wire names. ```go func (m InstanceSpawnRequest) MarshalJSON() ([]byte, error) ``` (go-instancespawnrequest-unmarshaljson)= #### InstanceSpawnRequest.UnmarshalJSON UnmarshalJSON decodes InstanceSpawnRequest and checks required fields. ```go func (m *InstanceSpawnRequest) UnmarshalJSON(data []byte) error ``` (go-instancespawnresponse)= ### type InstanceSpawnResponse InstanceSpawnResponse is generated from the InstanceSpawnResponse schema. ```go type InstanceSpawnResponse struct { UUID Optional[string] `json:"uuid"` Command Optional[string] `json:"command"` Image Optional[string] `json:"image"` Hostname Optional[string] `json:"hostname"` Args Optional[[]string] `json:"args"` Shell Optional[bool] `json:"shell"` Env Optional[map[string]string] `json:"env"` PreserveEnv Optional[bool] `json:"preserve_env"` Cwd Optional[string] `json:"cwd"` UID Optional[int64] `json:"uid"` GID Optional[int64] `json:"gid"` ResourcesLimits Optional[InstanceResourcesLimits] `json:"resources_limits"` Networking Optional[InstanceNetworkingResponse] `json:"networking"` Stdin Optional[ClosableStreamRepr] `json:"stdin"` Timeout Optional[int64] `json:"timeout"` TruncateOutputAt Optional[int64] `json:"truncate_output_at"` Disposable Optional[bool] `json:"disposable"` Files Optional[map[string]FileSpec] `json:"files"` Result Optional[InstanceResult] `json:"result"` } ``` (go-instancespawnresponse-marshaljson)= #### InstanceSpawnResponse.MarshalJSON MarshalJSON encodes InstanceSpawnResponse with exact wire names. ```go func (m InstanceSpawnResponse) MarshalJSON() ([]byte, error) ``` (go-instancespawnresponse-unmarshaljson)= #### InstanceSpawnResponse.UnmarshalJSON UnmarshalJSON decodes InstanceSpawnResponse and checks required fields. ```go func (m *InstanceSpawnResponse) UnmarshalJSON(data []byte) error ``` (go-iterfilesoptions)= ### type IterFilesOptions IterFilesOptions configures IterFiles. ```go type IterFilesOptions struct { // PageSize is the number of items requested per page. Zero uses 1000. PageSize int64 // Limit bounds the total item count. Nil requests all items. Limit *int64 Since *any Until *any } ``` (go-iterimagesoptions)= ### type IterImagesOptions IterImagesOptions configures IterImages. ```go type IterImagesOptions struct { // PageSize is the number of items requested per page. Zero uses 1000. PageSize int64 // Limit bounds the total item count. Nil requests all items. Limit *int64 Tagged bool Tag *string UUID *string Since *any Until *any } ``` (go-iteroperationeventsoptions)= ### type IterOperationEventsOptions IterOperationEventsOptions contains optional arguments for IterOperationEvents. ```go type IterOperationEventsOptions struct { Follow bool Spid *int64 Since *int64 LastEventID *int64 } ``` (go-iteroperationsoptions)= ### type IterOperationsOptions IterOperationsOptions configures IterOperations. ```go type IterOperationsOptions struct { // PageSize is the number of items requested per page. Zero uses 1000. PageSize int64 // Limit bounds the total item count. Nil requests all items. Limit *int64 Status *OperationStatus Kind *string Since *any Until *any } ``` (go-listfilesoptions)= ### type ListFilesOptions ListFilesOptions contains optional arguments for ListFiles. ```go type ListFilesOptions struct { Limit *int64 Offset *int64 Since *any Until *any } ``` (go-listimagesoptions)= ### type ListImagesOptions ListImagesOptions contains optional arguments for ListImages. ```go type ListImagesOptions struct { Limit *int64 Offset *int64 Tagged bool Tag *string UUID *string Since *any Until *any } ``` (go-listnetworkpoliciesoptions)= ### type ListNetworkPoliciesOptions ListNetworkPoliciesOptions contains optional arguments for ListNetworkPolicies. ```go type ListNetworkPoliciesOptions struct { Search *string Limit *int64 Offset *int64 } ``` (go-listnetworkpolicytagsoptions)= ### type ListNetworkPolicyTagsOptions ListNetworkPolicyTagsOptions contains optional arguments for ListNetworkPolicyTags. ```go type ListNetworkPolicyTagsOptions struct { Limit *int64 Offset *int64 } ``` (go-listnetworkpolicytagsresponse)= ### type ListNetworkPolicyTagsResponse ListNetworkPolicyTagsResponse is generated from the ListNetworkPolicyTagsResponse schema. ```go type ListNetworkPolicyTagsResponse struct { Tags []NetworkPolicyTag `json:"tags"` } ``` (go-listnetworkpolicytagsresponse-marshaljson)= #### ListNetworkPolicyTagsResponse.MarshalJSON MarshalJSON encodes ListNetworkPolicyTagsResponse with exact wire names. ```go func (m ListNetworkPolicyTagsResponse) MarshalJSON() ([]byte, error) ``` (go-listnetworkpolicytagsresponse-unmarshaljson)= #### ListNetworkPolicyTagsResponse.UnmarshalJSON UnmarshalJSON decodes ListNetworkPolicyTagsResponse and checks required fields. ```go func (m *ListNetworkPolicyTagsResponse) UnmarshalJSON(data []byte) error ``` (go-listoperationsoptions)= ### type ListOperationsOptions ListOperationsOptions contains optional arguments for ListOperations. ```go type ListOperationsOptions struct { Limit *int64 Offset *int64 Status *OperationStatus Kind *string Since *any Until *any } ``` (go-mockcall)= ### type MockCall MockCall records an HTTP attempt, including attempts made by helpers and retries. Operation is the canonical generated method name. PathParams uses the wire parameter names. Body contains the serialized request body. ```go type MockCall struct { Operation string Method string URL string Path string PathParams map[string]string Query url.Values Header http.Header Body []byte } ``` (go-mockresponse)= ### type MockResponse MockResponse supplies a wire response for MockHTTP. BodyError, when set, is returned after all Body bytes have been read. StatusCode must be explicit. ```go type MockResponse struct { StatusCode int Header http.Header Body []byte BodyError error } ``` (go-mocktransport)= ### type MockTransport MockTransport is an offline HTTP transport with outcome queues and a call log. Its zero value is ready to use. Configuration, requests, and log access are safe for concurrent use. Each queue repeats its last outcome. Mock operation names, such as SpawnInstance or ListImages. Helpers such as SpawnInstance, EnsureFile, and IterImages execute normally through those mocks. Full-response and byte-stream aliases share the operation's queue and call log. ```go type MockTransport struct { // contains filtered or unexported fields } ``` (go-mocktransport-calls)= #### MockTransport.Calls Calls returns an independent snapshot of all recorded HTTP attempts. ```go func (m *MockTransport) Calls() []MockCall ``` (go-mocktransport-callsfor)= #### MockTransport.CallsFor CallsFor returns a snapshot for one generated operation, in request order. Unknown names return an empty snapshot. Stream aliases use the canonical name. ```go func (m *MockTransport) CallsFor(operation string) []MockCall ``` (go-mocktransport-mock)= #### MockTransport.Mock Mock queues a typed result for a generated operation. Use an Op descriptor, model values for JSON, struct{}{} for empty responses, \[]byte for byte responses, and \[]OperationEvent for SSE responses. Results are serialized now and decoded by the real client when called. ```go func (m *MockTransport) Mock[T any](operation Operation[T], result T) error ``` (go-mocktransport-mockerror)= #### MockTransport.MockError MockError queues an error. APIStatusError and its typed wrappers become HTTP responses, so status handling and retries run normally. Other errors become transport failures wrapped in APIConnectionError and remain accessible through errors.Is and errors.As. Nil errors are rejected. ```go func (m *MockTransport) MockError(operation string, err error) error ``` (go-mocktransport-mockhttp)= #### MockTransport.MockHTTP MockHTTP queues an exact HTTP response. Use it for malformed JSON, specific status codes or headers, and encoded bodies such as gzip. Input bytes and headers are copied, and each call receives a fresh response body. ```go func (m *MockTransport) MockHTTP(operation string, response MockResponse) error ``` (go-mocktransport-mockstream)= #### MockTransport.MockStream MockStream queues byte or SSE results followed by a read error. Result uses the same representation as Mock. A nil error produces normal end-of-stream. ```go func (m *MockTransport) MockStream[T any](operation Operation[T], result T, err error) error ``` (go-mocktransport-roundtrip)= #### MockTransport.RoundTrip RoundTrip records the request and returns its next configured outcome. It never opens a connection. Unconfigured requests return NotMockedError. ```go func (m *MockTransport) RoundTrip(request *http.Request) (*http.Response, error) ``` (go-networkinterface)= ### type NetworkInterface NetworkInterface is generated from the NetworkInterface schema. ```go type NetworkInterface struct { Name string `json:"name"` RxBytes int64 `json:"rx_bytes"` RxPackets int64 `json:"rx_packets"` RxErrs int64 `json:"rx_errs"` RxDrop int64 `json:"rx_drop"` TxBytes int64 `json:"tx_bytes"` TxPackets int64 `json:"tx_packets"` TxErrs int64 `json:"tx_errs"` TxDrop int64 `json:"tx_drop"` } ``` (go-networkinterface-marshaljson)= #### NetworkInterface.MarshalJSON MarshalJSON encodes NetworkInterface with exact wire names. ```go func (m NetworkInterface) MarshalJSON() ([]byte, error) ``` (go-networkinterface-unmarshaljson)= #### NetworkInterface.UnmarshalJSON UnmarshalJSON decodes NetworkInterface and checks required fields. ```go func (m *NetworkInterface) UnmarshalJSON(data []byte) error ``` (go-networkpolicy)= ### type NetworkPolicy NetworkPolicy is generated from the NetworkPolicy schema. ```go type NetworkPolicy struct { UUID string `json:"uuid"` Cidrs []NetworkPolicyCidrRule `json:"cidrs"` } ``` (go-networkpolicy-marshaljson)= #### NetworkPolicy.MarshalJSON MarshalJSON encodes NetworkPolicy with exact wire names. ```go func (m NetworkPolicy) MarshalJSON() ([]byte, error) ``` (go-networkpolicy-unmarshaljson)= #### NetworkPolicy.UnmarshalJSON UnmarshalJSON decodes NetworkPolicy and checks required fields. ```go func (m *NetworkPolicy) UnmarshalJSON(data []byte) error ``` (go-networkpolicycidrrule)= ### type NetworkPolicyCidrRule NetworkPolicyCidrRule is generated from the NetworkPolicyCIDRRule schema. ```go type NetworkPolicyCidrRule struct { Cidr string `json:"cidr"` Proto string `json:"proto"` Ports Optional[[]int64] `json:"ports"` } ``` (go-networkpolicycidrrule-marshaljson)= #### NetworkPolicyCidrRule.MarshalJSON MarshalJSON encodes NetworkPolicyCidrRule with exact wire names. ```go func (m NetworkPolicyCidrRule) MarshalJSON() ([]byte, error) ``` (go-networkpolicycidrrule-unmarshaljson)= #### NetworkPolicyCidrRule.UnmarshalJSON UnmarshalJSON decodes NetworkPolicyCidrRule and checks required fields. ```go func (m *NetworkPolicyCidrRule) UnmarshalJSON(data []byte) error ``` (go-networkpolicycreaterequest)= ### type NetworkPolicyCreateRequest NetworkPolicyCreateRequest is generated from the NetworkPolicyCreateRequest schema. ```go type NetworkPolicyCreateRequest struct { Cidrs []NetworkPolicyCidrRule `json:"cidrs"` } ``` (go-networkpolicycreaterequest-marshaljson)= #### NetworkPolicyCreateRequest.MarshalJSON MarshalJSON encodes NetworkPolicyCreateRequest with exact wire names. ```go func (m NetworkPolicyCreateRequest) MarshalJSON() ([]byte, error) ``` (go-networkpolicycreaterequest-unmarshaljson)= #### NetworkPolicyCreateRequest.UnmarshalJSON UnmarshalJSON decodes NetworkPolicyCreateRequest and checks required fields. ```go func (m *NetworkPolicyCreateRequest) UnmarshalJSON(data []byte) error ``` (go-networkpolicylistitem)= ### type NetworkPolicyListItem NetworkPolicyListItem is generated from the NetworkPolicyListItem schema. ```go type NetworkPolicyListItem struct { UUID string `json:"uuid"` CreatedAt time.Time `json:"created_at"` Tags []string `json:"tags"` Summary NetworkPolicyListItemSummary `json:"summary"` } ``` (go-networkpolicylistitem-marshaljson)= #### NetworkPolicyListItem.MarshalJSON MarshalJSON encodes NetworkPolicyListItem with exact wire names. ```go func (m NetworkPolicyListItem) MarshalJSON() ([]byte, error) ``` (go-networkpolicylistitem-unmarshaljson)= #### NetworkPolicyListItem.UnmarshalJSON UnmarshalJSON decodes NetworkPolicyListItem and checks required fields. ```go func (m *NetworkPolicyListItem) UnmarshalJSON(data []byte) error ``` (go-networkpolicylistitemsummary)= ### type NetworkPolicyListItemSummary NetworkPolicyListItemSummary is generated from the NetworkPolicyListItemSummary schema. ```go type NetworkPolicyListItemSummary struct { Cidrs int64 `json:"cidrs"` } ``` (go-networkpolicylistitemsummary-marshaljson)= #### NetworkPolicyListItemSummary.MarshalJSON MarshalJSON encodes NetworkPolicyListItemSummary with exact wire names. ```go func (m NetworkPolicyListItemSummary) MarshalJSON() ([]byte, error) ``` (go-networkpolicylistitemsummary-unmarshaljson)= #### NetworkPolicyListItemSummary.UnmarshalJSON UnmarshalJSON decodes NetworkPolicyListItemSummary and checks required fields. ```go func (m *NetworkPolicyListItemSummary) UnmarshalJSON(data []byte) error ``` (go-networkpolicylistresponse)= ### type NetworkPolicyListResponse NetworkPolicyListResponse is generated from the NetworkPolicyListResponse schema. ```go type NetworkPolicyListResponse struct { Policies []NetworkPolicyListItem `json:"policies"` } ``` (go-networkpolicylistresponse-marshaljson)= #### NetworkPolicyListResponse.MarshalJSON MarshalJSON encodes NetworkPolicyListResponse with exact wire names. ```go func (m NetworkPolicyListResponse) MarshalJSON() ([]byte, error) ``` (go-networkpolicylistresponse-unmarshaljson)= #### NetworkPolicyListResponse.UnmarshalJSON UnmarshalJSON decodes NetworkPolicyListResponse and checks required fields. ```go func (m *NetworkPolicyListResponse) UnmarshalJSON(data []byte) error ``` (go-networkpolicytag)= ### type NetworkPolicyTag NetworkPolicyTag is generated from the NetworkPolicyTag schema. ```go type NetworkPolicyTag struct { Tag string `json:"tag"` UUID string `json:"uuid"` } ``` (go-networkpolicytag-marshaljson)= #### NetworkPolicyTag.MarshalJSON MarshalJSON encodes NetworkPolicyTag with exact wire names. ```go func (m NetworkPolicyTag) MarshalJSON() ([]byte, error) ``` (go-networkpolicytag-unmarshaljson)= #### NetworkPolicyTag.UnmarshalJSON UnmarshalJSON decodes NetworkPolicyTag and checks required fields. ```go func (m *NetworkPolicyTag) UnmarshalJSON(data []byte) error ``` (go-notfounderror)= ### type NotFoundError NotFoundError is returned for an unexpected HTTP 404 response. ```go type NotFoundError struct{ *APIStatusError } ``` (go-notfounderror-error)= #### NotFoundError.Error ```go func (e NotFoundError) Error() string ``` (go-notfounderror-unwrap)= #### NotFoundError.Unwrap ```go func (e *NotFoundError) Unwrap() error ``` (go-notmockederror)= ### type NotMockedError NotMockedError reports a request without a configured outcome. Client methods wrap it in APIConnectionError; errors.As can recover it. ```go type NotMockedError struct { Operation string Method string Path string } ``` (go-notmockederror-error)= #### NotMockedError.Error ```go func (e *NotMockedError) Error() string ``` (go-operation)= ### type Operation Operation links a generated endpoint to its mock result type. Use the generated Op values. The zero value is invalid. ```go type Operation[T any] struct { // contains filtered or unexported fields } ``` (go-operation-name)= #### Operation.Name Name returns the canonical name used by MockHTTP, MockError, and CallsFor. ```go func (op Operation[T]) Name() string ``` (go-operationevent)= ### type OperationEvent OperationEvent is generated from the OperationEvent schema. ```go type OperationEvent struct { ID int64 `json:"id"` Ts time.Time `json:"ts"` Spid Optional[int64] `json:"spid"` Type OperationEventType `json:"type"` Data EventData `json:"data"` } ``` (go-operationevent-marshaljson)= #### OperationEvent.MarshalJSON MarshalJSON encodes OperationEvent with exact wire names. ```go func (m OperationEvent) MarshalJSON() ([]byte, error) ``` (go-operationevent-unmarshaljson)= #### OperationEvent.UnmarshalJSON UnmarshalJSON decodes OperationEvent and checks required fields. ```go func (m *OperationEvent) UnmarshalJSON(data []byte) error ``` (go-operationeventtype)= ### type OperationEventType OperationEventType identifies an operation event payload. ```go type OperationEventType string ``` (go-operationeventtypespawn)= (go-operationeventtypestdin)= (go-operationeventtypestdout)= (go-operationeventtypestderr)= (go-operationeventtypeexit)= (go-operationeventtypetruncated)= (go-operationeventtypesizecap)= (go-operationeventtypenetwork)= (go-operationeventtypeshutdown)= (go-operationeventtypeinspect)= (go-operationeventtypefileupload)= (go-operationeventtypecompletion)= (go-operationeventtypeinit)= #### const OperationEventTypeInit (group) ```go const ( OperationEventTypeInit OperationEventType = "init" OperationEventTypeSpawn OperationEventType = "spawn" OperationEventTypeStdin OperationEventType = "stdin" OperationEventTypeStdout OperationEventType = "stdout" OperationEventTypeStderr OperationEventType = "stderr" OperationEventTypeExit OperationEventType = "exit" OperationEventTypeTruncated OperationEventType = "truncated" OperationEventTypeSizeCap OperationEventType = "size_cap" OperationEventTypeNetwork OperationEventType = "network" OperationEventTypeShutdown OperationEventType = "shutdown" OperationEventTypeInspect OperationEventType = "inspect" OperationEventTypeFileUpload OperationEventType = "file_upload" OperationEventTypeCompletion OperationEventType = "completion" ) ``` (go-operationinstancemetadata)= ### type OperationInstanceMetadata OperationInstanceMetadata is generated from the OperationInstanceMetadata schema. ```go type OperationInstanceMetadata struct { Command string `json:"command"` Disposable Optional[bool] `json:"disposable"` Hostname Optional[string] `json:"hostname"` Image string `json:"image"` Args Optional[[]string] `json:"args"` Shell Optional[bool] `json:"shell"` Env Optional[map[string]string] `json:"env"` PreserveEnv Optional[bool] `json:"preserve_env"` PreserveCwd Optional[bool] `json:"preserve_cwd"` Cwd Optional[string] `json:"cwd"` UID Optional[int64] `json:"uid"` GID Optional[int64] `json:"gid"` ResourcesLimits Optional[InstanceResourcesLimits] `json:"resources_limits"` Networking Optional[InstanceNetworkingResponse] `json:"networking"` Stdin Optional[ClosableStreamRepr] `json:"stdin"` Timeout Optional[int64] `json:"timeout"` TruncateOutputAt Optional[int64] `json:"truncate_output_at"` Files Optional[map[string]FileSpec] `json:"files"` Result Optional[InstanceResult] `json:"result"` } ``` (go-operationinstancemetadata-marshaljson)= #### OperationInstanceMetadata.MarshalJSON MarshalJSON encodes OperationInstanceMetadata with exact wire names. ```go func (m OperationInstanceMetadata) MarshalJSON() ([]byte, error) ``` (go-operationinstancemetadata-unmarshaljson)= #### OperationInstanceMetadata.UnmarshalJSON UnmarshalJSON decodes OperationInstanceMetadata and checks required fields. ```go func (m *OperationInstanceMetadata) UnmarshalJSON(data []byte) error ``` (go-operationresponse)= ### type OperationResponse OperationResponse is generated from the OperationResponse schema. ```go type OperationResponse struct { UUID Optional[string] `json:"uuid"` Kind Optional[string] `json:"kind"` Status Optional[OperationStatus] `json:"status"` Error Optional[string] `json:"error"` CreatedAt Optional[string] `json:"created_at"` Duration Optional[float64] `json:"duration"` ImageSize Optional[int64] `json:"image_size"` ConsumedCPU Optional[float64] `json:"consumed_cpu"` ConsumedMemory Optional[int64] `json:"consumed_memory"` ImageUUID Optional[string] `json:"image_uuid"` ResultImageUUID Optional[string] `json:"result_image_uuid"` Metadata Optional[any] `json:"metadata"` Result Optional[OperationResult] `json:"result"` } ``` (go-operationresponse-marshaljson)= #### OperationResponse.MarshalJSON MarshalJSON encodes OperationResponse with exact wire names. ```go func (m OperationResponse) MarshalJSON() ([]byte, error) ``` (go-operationresponse-unmarshaljson)= #### OperationResponse.UnmarshalJSON UnmarshalJSON decodes OperationResponse and checks required fields. ```go func (m *OperationResponse) UnmarshalJSON(data []byte) error ``` (go-operationresult)= ### type OperationResult OperationResult is generated from the OperationResult schema. ```go type OperationResult struct { Image Optional[string] `json:"image"` Tag Optional[string] `json:"tag"` } ``` (go-operationresult-marshaljson)= #### OperationResult.MarshalJSON MarshalJSON encodes OperationResult with exact wire names. ```go func (m OperationResult) MarshalJSON() ([]byte, error) ``` (go-operationresult-unmarshaljson)= #### OperationResult.UnmarshalJSON UnmarshalJSON decodes OperationResult and checks required fields. ```go func (m *OperationResult) UnmarshalJSON(data []byte) error ``` (go-operationstatus)= ### type OperationStatus OperationStatus is an operation lifecycle state. ```go type OperationStatus string ``` (go-operationstatusassigned)= (go-operationstatusexecuting)= (go-operationstatussuccess)= (go-operationstatusfailed)= (go-operationstatuscancelled)= (go-operationstatuspending)= #### const OperationStatusPending (group) ```go const ( OperationStatusPending OperationStatus = "PENDING" OperationStatusAssigned OperationStatus = "ASSIGNED" OperationStatusExecuting OperationStatus = "EXECUTING" OperationStatusSuccess OperationStatus = "SUCCESS" OperationStatusFailed OperationStatus = "FAILED" OperationStatusCancelled OperationStatus = "CANCELLED" ) ``` (go-operationstatus-isterminal)= #### OperationStatus.IsTerminal IsTerminal reports whether the operation state cannot change again. ```go func (s OperationStatus) IsTerminal() bool ``` (go-operationsubprocesscreateoptions)= ### type OperationSubprocessCreateOptions OperationSubprocessCreateOptions contains optional arguments for OperationSubprocessCreate. ```go type OperationSubprocessCreateOptions struct { ResourcesLimits Optional[ProcessResourcesLimits] Args Optional[[]string] Shell Optional[bool] Env Optional[map[string]string] Cwd Optional[string] UID Optional[int64] GID Optional[int64] Stdin Optional[ClosableStreamRepr] TruncateOutputAt Optional[int64] } ``` (go-operationsubprocesskilloptions)= ### type OperationSubprocessKillOptions OperationSubprocessKillOptions contains optional arguments for OperationSubprocessKill. ```go type OperationSubprocessKillOptions struct { Signal *string } ``` (go-operationsubprocessstdinoptions)= ### type OperationSubprocessStdinOptions OperationSubprocessStdinOptions contains optional arguments for OperationSubprocessStdin. ```go type OperationSubprocessStdinOptions struct { Encoding Optional[string] Close Optional[bool] } ``` (go-operationsummary)= ### type OperationSummary OperationSummary is generated from the OperationSummary schema. ```go type OperationSummary struct { UUID Optional[string] `json:"uuid"` Kind Optional[string] `json:"kind"` Status Optional[OperationStatus] `json:"status"` Error Optional[string] `json:"error"` CreatedAt Optional[string] `json:"created_at"` Duration Optional[float64] `json:"duration"` ImageSize Optional[int64] `json:"image_size"` ConsumedCPU Optional[float64] `json:"consumed_cpu"` ConsumedMemory Optional[int64] `json:"consumed_memory"` ImageUUID Optional[string] `json:"image_uuid"` ResultImageUUID Optional[string] `json:"result_image_uuid"` } ``` (go-operationsummary-marshaljson)= #### OperationSummary.MarshalJSON MarshalJSON encodes OperationSummary with exact wire names. ```go func (m OperationSummary) MarshalJSON() ([]byte, error) ``` (go-operationsummary-unmarshaljson)= #### OperationSummary.UnmarshalJSON UnmarshalJSON decodes OperationSummary and checks required fields. ```go func (m *OperationSummary) UnmarshalJSON(data []byte) error ``` (go-optional)= ### type Optional Optional preserves whether a JSON property was absent, null, or a value. ```go type Optional[T any] struct { // contains filtered or unexported fields } ``` (go-null)= #### Null Null constructs an Optional that contains an explicit JSON null. ```go func Null[T any]() Optional[T] ``` (go-some)= #### Some Some constructs an Optional that contains value. ```go func Some[T any](value T) Optional[T] ``` (go-optional-isnull)= #### Optional.IsNull IsNull reports whether the property was present as JSON null. ```go func (o Optional[T]) IsNull() bool ``` (go-optional-isset)= #### Optional.IsSet IsSet reports whether the property was present. ```go func (o Optional[T]) IsSet() bool ``` (go-optional-marshaljson)= #### Optional.MarshalJSON MarshalJSON implements json.Marshaler. A standalone unset Optional marshals as null, while an enclosing generated model omits its unset fields. ```go func (o Optional[T]) MarshalJSON() ([]byte, error) ``` (go-optional-set)= #### Optional.Set Set replaces the state with a value. ```go func (o *Optional[T]) Set(value T) ``` (go-optional-setnull)= #### Optional.SetNull SetNull replaces the state with an explicit JSON null. ```go func (o *Optional[T]) SetNull() ``` (go-optional-unmarshaljson)= #### Optional.UnmarshalJSON UnmarshalJSON implements json.Unmarshaler. ```go func (o *Optional[T]) UnmarshalJSON(data []byte) error ``` (go-optional-unset)= #### Optional.Unset Unset makes the property absent. ```go func (o *Optional[T]) Unset() ``` (go-optional-value)= #### Optional.Value Value returns the value and reports whether it is present and non-null. ```go func (o Optional[T]) Value() (T, bool) ``` (go-permissiondeniederror)= ### type PermissionDeniedError PermissionDeniedError is returned for an unexpected HTTP 403 response. ```go type PermissionDeniedError struct{ *APIStatusError } ``` (go-permissiondeniederror-error)= #### PermissionDeniedError.Error ```go func (e PermissionDeniedError) Error() string ``` (go-permissiondeniederror-unwrap)= #### PermissionDeniedError.Unwrap ```go func (e *PermissionDeniedError) Unwrap() error ``` (go-processresourceslimits)= ### type ProcessResourcesLimits ProcessResourcesLimits is generated from the ProcessResourcesLimits schema. ```go type ProcessResourcesLimits struct { CPU Optional[int64] `json:"cpu"` MemoryMib Optional[int64] `json:"memory_mib"` } ``` (go-processresourceslimits-marshaljson)= #### ProcessResourcesLimits.MarshalJSON MarshalJSON encodes ProcessResourcesLimits with exact wire names. ```go func (m ProcessResourcesLimits) MarshalJSON() ([]byte, error) ``` (go-processresourceslimits-unmarshaljson)= #### ProcessResourcesLimits.UnmarshalJSON UnmarshalJSON decodes ProcessResourcesLimits and checks required fields. ```go func (m *ProcessResourcesLimits) UnmarshalJSON(data []byte) error ``` (go-profile)= ### type Profile Profile contains the settings for one Contree authentication profile. ```go type Profile struct { Name string URL string Token string AuthType string Project string } ``` (go-profilefromenvironment)= #### ProfileFromEnvironment ProfileFromEnvironment returns a profile when the environment contains a token and URL. CONTREE\_\* variables have priority over their NEBIUS\_\* aliases. ```go func ProfileFromEnvironment() (Profile, bool) ``` (go-resolveprofile)= #### ResolveProfile ResolveProfile selects a profile. An explicit name has priority over CONTREE\_PROFILE and the active profile in the configuration. Pass one path to read a specific auth.ini file. ```go func ResolveProfile(name string, path ...string) (Profile, error) ``` (go-profile-gostring)= #### Profile.GoString GoString returns a Go-syntax profile description without its token. ```go func (p Profile) GoString() string ``` (go-profile-string)= #### Profile.String String returns a profile description without its token. ```go func (p Profile) String() string ``` (go-profileerror)= ### type ProfileError ProfileError reports a missing or incomplete profile. ```go type ProfileError struct { Name string Problem string } ``` (go-profileerror-error)= #### ProfileError.Error ```go func (e *ProfileError) Error() string ``` (go-ratelimiterror)= ### type RateLimitError RateLimitError is returned for an unexpected HTTP 429 response. ```go type RateLimitError struct{ *APIStatusError } ``` (go-ratelimiterror-error)= #### RateLimitError.Error ```go func (e RateLimitError) Error() string ``` (go-ratelimiterror-unwrap)= #### RateLimitError.Unwrap ```go func (e *RateLimitError) Unwrap() error ``` (go-retrypolicy)= ### type RetryPolicy RetryPolicy controls retries for idempotent buffered requests. MaxAttempts includes the initial request. One disables retries; zero retries until the context ends. The client timeout applies separately to each buffered attempt. ```go type RetryPolicy struct { Statuses []int ServerErrors bool Delays []time.Duration MaxAttempts int RetryUnsafe bool } ``` (go-defaultretrypolicy)= #### DefaultRetryPolicy DefaultRetryPolicy returns a conservative exponential retry policy. ```go func DefaultRetryPolicy() RetryPolicy ``` (go-sseerror)= ### type SSEError SSEError reports an explicit sse\_error frame from the server. ```go type SSEError struct { Message string LastEventID int64 HasEventID bool } ``` (go-sseerror-error)= #### SSEError.Error ```go func (e *SSEError) Error() string ``` (go-servererror)= ### type ServerError ServerError is returned for an unexpected HTTP 5xx response. ```go type ServerError struct{ *APIStatusError } ``` (go-servererror-error)= #### ServerError.Error ```go func (e ServerError) Error() string ``` (go-servererror-unwrap)= #### ServerError.Unwrap ```go func (e *ServerError) Unwrap() error ``` (go-spawninstanceoptions)= ### type SpawnInstanceOptions SpawnInstanceOptions configures SpawnInstance. Zero scalar values and nil maps, slices, and pointers omit their fields so the server defaults apply. Non-nil empty maps and slices are sent as empty JSON objects and arrays. Use SpawnInstanceWithResponseOptions with SpawnInstanceWithResponse to send explicit zero or null values for fields that SpawnInstanceOptions would omit. ```go type SpawnInstanceOptions struct { Disposable bool Hostname string Args []string Shell bool Env map[string]string PreserveEnv bool PreserveCwd bool Cwd string UID int64 GID int64 ResourcesLimits *InstanceResourcesLimits // Networking defaults to enabled. Set Enabled to Some(false) to disable it. Networking *InstanceNetworking Stdin *ClosableStreamRepr // Timeout limits server execution, independently of the request context. // Zero uses the server default. Positive durations round up to whole seconds. // Negative durations return an error before sending a request. Timeout time.Duration // TruncateOutputAt limits captured bytes per stream. Nil uses the server // default (1 MiB); a pointer to zero sends an explicit zero. TruncateOutputAt *int64 Files map[string]FileSpec } ``` (go-spawninstancewithresponseoptions)= ### type SpawnInstanceWithResponseOptions SpawnInstanceWithResponseOptions contains optional arguments for SpawnInstanceWithResponse. ```go type SpawnInstanceWithResponseOptions struct { Disposable Optional[bool] Hostname Optional[string] Args Optional[[]string] Shell Optional[bool] Env Optional[map[string]string] PreserveEnv Optional[bool] PreserveCwd Optional[bool] Cwd Optional[string] UID Optional[int64] GID Optional[int64] ResourcesLimits Optional[InstanceResourcesLimits] Networking Optional[InstanceNetworking] Stdin Optional[ClosableStreamRepr] Timeout Optional[int64] TruncateOutputAt Optional[int64] Files Optional[map[string]FileSpec] } ``` (go-streamrepr)= ### type StreamRepr StreamRepr is generated from the StreamRepr schema. ```go type StreamRepr struct { Value string `json:"value"` Encoding string `json:"encoding"` Truncated Optional[bool] `json:"truncated"` } ``` (go-newstreamreprfrombytes)= #### NewStreamReprFromBytes NewStreamReprFromBytes constructs a stream payload from bytes. ```go func NewStreamReprFromBytes(value []byte) StreamRepr ``` (go-newstreamreprfromtext)= #### NewStreamReprFromText NewStreamReprFromText constructs a stream payload from text. ```go func NewStreamReprFromText(value string) StreamRepr ``` (go-streamrepr-asbytes)= #### StreamRepr.AsBytes AsBytes decodes the stream payload to bytes. ```go func (m StreamRepr) AsBytes() []byte ``` (go-streamrepr-astext)= #### StreamRepr.AsText AsText decodes the stream payload to valid UTF-8 text. ```go func (m StreamRepr) AsText() string ``` (go-streamrepr-marshaljson)= #### StreamRepr.MarshalJSON MarshalJSON encodes StreamRepr with exact wire names. ```go func (m StreamRepr) MarshalJSON() ([]byte, error) ``` (go-streamrepr-string)= #### StreamRepr.String String returns the decoded payload text. ```go func (m StreamRepr) String() string ``` (go-streamrepr-unmarshaljson)= #### StreamRepr.UnmarshalJSON UnmarshalJSON decodes StreamRepr and checks required fields. ```go func (m *StreamRepr) UnmarshalJSON(data []byte) error ``` (go-stringorint64)= ### type StringOrInt64 StringOrInt64 represents the string-or-integer union used by file modes. ```go type StringOrInt64 struct { // contains filtered or unexported fields } ``` (go-stringorint64fromint64)= #### StringOrInt64FromInt64 StringOrInt64FromInt64 constructs the integer variant. ```go func StringOrInt64FromInt64(value int64) StringOrInt64 ``` (go-stringorint64fromstring)= #### StringOrInt64FromString StringOrInt64FromString constructs the string variant. ```go func StringOrInt64FromString(value string) StringOrInt64 ``` (go-stringorint64-int64value)= #### StringOrInt64.Int64Value Int64Value returns the integer variant. ```go func (u StringOrInt64) Int64Value() (int64, bool) ``` (go-stringorint64-marshaljson)= #### StringOrInt64.MarshalJSON MarshalJSON implements json.Marshaler. ```go func (u StringOrInt64) MarshalJSON() ([]byte, error) ``` (go-stringorint64-stringvalue)= #### StringOrInt64.StringValue StringValue returns the string variant. ```go func (u StringOrInt64) StringValue() (string, bool) ``` (go-stringorint64-unmarshaljson)= #### StringOrInt64.UnmarshalJSON UnmarshalJSON implements json.Unmarshaler. ```go func (u *StringOrInt64) UnmarshalJSON(data []byte) error ``` (go-tooearlyerror)= ### type TooEarlyError TooEarlyError is returned for an unexpected HTTP 425 response. ```go type TooEarlyError struct{ *APIStatusError } ``` (go-tooearlyerror-error)= #### TooEarlyError.Error ```go func (e TooEarlyError) Error() string ``` (go-tooearlyerror-unwrap)= #### TooEarlyError.Unwrap ```go func (e *TooEarlyError) Unwrap() error ``` (go-unprocessableentityerror)= ### type UnprocessableEntityError UnprocessableEntityError is returned for an unexpected HTTP 422 response. ```go type UnprocessableEntityError struct{ *APIStatusError } ``` (go-unprocessableentityerror-error)= #### UnprocessableEntityError.Error ```go func (e UnprocessableEntityError) Error() string ``` (go-unprocessableentityerror-unwrap)= #### UnprocessableEntityError.Unwrap ```go func (e *UnprocessableEntityError) Unwrap() error ``` (go-waitoperationoptions)= ### type WaitOperationOptions WaitOperationOptions selects how WaitOperation observes completion. ```go type WaitOperationOptions struct { // IdleTimeout is the maximum gap between incoming SSE data in seconds. // Nil uses 15 seconds. Zero disables the limit. Ping frames reset it. IdleTimeout *float64 // FollowEvents defaults to nil: follow instance events and poll image imports. // True forces events; false polls status without opening an event stream. FollowEvents *bool } ``` (go-whoamiresponse)= ### type WhoAmIResponse WhoAmIResponse is generated from the WhoAmIResponse schema. ```go type WhoAmIResponse struct { TokenUUID string `json:"token_uuid"` TokenExpiration *int64 `json:"token_expiration"` Permissions map[string]bool `json:"permissions"` Limits Optional[map[string]int64] `json:"limits"` OperationsStat map[string]int64 `json:"operations_stat"` } ``` (go-whoamiresponse-marshaljson)= #### WhoAmIResponse.MarshalJSON MarshalJSON encodes WhoAmIResponse with exact wire names. ```go func (m WhoAmIResponse) MarshalJSON() ([]byte, error) ``` (go-whoamiresponse-unmarshaljson)= #### WhoAmIResponse.UnmarshalJSON UnmarshalJSON decodes WhoAmIResponse and checks required fields. ```go func (m *WhoAmIResponse) UnmarshalJSON(data []byte) error ```