Documentation
¶
Index ¶
- func Bool(b bool) param.Opt[bool]
- func BoolPtr(v bool) *bool
- func DefaultClientOptions() []option.RequestOption
- func File(rdr io.Reader, filename string, contentType string) file
- func Float(f float64) param.Opt[float64]
- func FloatPtr(v float64) *float64
- func Int(i int64) param.Opt[int64]
- func IntPtr(v int64) *int64
- func Opt[T comparable](v T) param.Opt[T]
- func Ptr[T any](v T) *T
- func String(s string) param.Opt[string]
- func StringPtr(v string) *string
- func Time(t time.Time) param.Opt[time.Time]
- func TimePtr(v time.Time) *time.Time
- type ActionResult
- type ActionResultScreenshot
- type ActionResultScreenshotAfter
- type ActionResultScreenshotBefore
- type ActionResultScreenshotTrace
- type AndroidApp
- type AndroidAppAppType
- type AndroidBox
- type AndroidBoxConfig
- type AndroidBoxConfigBrowser
- type AndroidBoxConfigOs
- type AndroidBoxConfigResolution
- type AndroidBoxStatus
- type AndroidBoxType
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, ...) error
- func (r *Client) Get(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Post(ctx context.Context, path string, params any, res any, ...) error
- func (r *Client) Put(ctx context.Context, path string, params any, res any, ...) error
- type CreateAndroidBoxParam
- type CreateBoxConfigDeviceType
- type CreateBoxConfigParam
- type CreateLinuxBoxParam
- type Error
- type LinuxBox
- type LinuxBoxConfig
- type LinuxBoxConfigBrowser
- type LinuxBoxConfigOs
- type LinuxBoxConfigResolution
- type LinuxBoxStatus
- type LinuxBoxType
- type V1BoxActionClickParams
- type V1BoxActionClickParamsButton
- type V1BoxActionClickParamsOutputFormat
- type V1BoxActionDragParams
- type V1BoxActionDragParamsOutputFormat
- type V1BoxActionDragParamsPath
- type V1BoxActionMoveParams
- type V1BoxActionMoveParamsOutputFormat
- type V1BoxActionPressButtonParams
- type V1BoxActionPressButtonParamsOutputFormat
- type V1BoxActionPressKeyParams
- type V1BoxActionPressKeyParamsOutputFormat
- type V1BoxActionScreenshotParams
- type V1BoxActionScreenshotParamsClip
- type V1BoxActionScreenshotParamsOutputFormat
- type V1BoxActionScreenshotResponse
- type V1BoxActionScrollParams
- type V1BoxActionScrollParamsOutputFormat
- type V1BoxActionService
- func (r *V1BoxActionService) Click(ctx context.Context, id string, body V1BoxActionClickParams, ...) (res *ActionResult, err error)
- func (r *V1BoxActionService) Drag(ctx context.Context, id string, body V1BoxActionDragParams, ...) (res *ActionResult, err error)
- func (r *V1BoxActionService) Move(ctx context.Context, id string, body V1BoxActionMoveParams, ...) (res *ActionResult, err error)
- func (r *V1BoxActionService) PressButton(ctx context.Context, id string, body V1BoxActionPressButtonParams, ...) (res *ActionResult, err error)
- func (r *V1BoxActionService) PressKey(ctx context.Context, id string, body V1BoxActionPressKeyParams, ...) (res *ActionResult, err error)
- func (r *V1BoxActionService) Screenshot(ctx context.Context, id string, body V1BoxActionScreenshotParams, ...) (res *V1BoxActionScreenshotResponse, err error)
- func (r *V1BoxActionService) Scroll(ctx context.Context, id string, body V1BoxActionScrollParams, ...) (res *ActionResult, err error)
- func (r *V1BoxActionService) Touch(ctx context.Context, id string, body V1BoxActionTouchParams, ...) (res *ActionResult, err error)
- func (r *V1BoxActionService) Type(ctx context.Context, id string, body V1BoxActionTypeParams, ...) (res *ActionResult, err error)
- type V1BoxActionTouchParams
- type V1BoxActionTouchParamsOutputFormat
- type V1BoxActionTouchParamsPoint
- type V1BoxActionTouchParamsPointStart
- type V1BoxActionTypeParams
- type V1BoxActionTypeParamsOutputFormat
- type V1BoxAndroidCloseParams
- type V1BoxAndroidGetConnectAddressResponse
- type V1BoxAndroidGetParams
- type V1BoxAndroidInstallParams
- type V1BoxAndroidInstallParamsBodyInstallAndroidAppByFile
- type V1BoxAndroidInstallParamsBodyInstallAndroidAppByURL
- type V1BoxAndroidListActivitiesParams
- type V1BoxAndroidListActivitiesResponse
- type V1BoxAndroidListActivitiesResponseData
- type V1BoxAndroidListParams
- type V1BoxAndroidListParamsAppType
- type V1BoxAndroidListResponse
- type V1BoxAndroidOpenParams
- type V1BoxAndroidRestartParams
- type V1BoxAndroidRotateScreenParams
- type V1BoxAndroidRotateScreenParamsDirection
- type V1BoxAndroidService
- func (r *V1BoxAndroidService) Close(ctx context.Context, packageName string, body V1BoxAndroidCloseParams, ...) (err error)
- func (r *V1BoxAndroidService) CloseAll(ctx context.Context, id string, opts ...option.RequestOption) (err error)
- func (r *V1BoxAndroidService) Get(ctx context.Context, packageName string, query V1BoxAndroidGetParams, ...) (res *AndroidApp, err error)
- func (r *V1BoxAndroidService) GetConnectAddress(ctx context.Context, id string, opts ...option.RequestOption) (res *V1BoxAndroidGetConnectAddressResponse, err error)
- func (r *V1BoxAndroidService) Install(ctx context.Context, id string, body V1BoxAndroidInstallParams, ...) (err error)
- func (r *V1BoxAndroidService) List(ctx context.Context, id string, query V1BoxAndroidListParams, ...) (res *V1BoxAndroidListResponse, err error)
- func (r *V1BoxAndroidService) ListActivities(ctx context.Context, packageName string, ...) (res *V1BoxAndroidListActivitiesResponse, err error)
- func (r *V1BoxAndroidService) Open(ctx context.Context, packageName string, params V1BoxAndroidOpenParams, ...) (err error)
- func (r *V1BoxAndroidService) Restart(ctx context.Context, packageName string, params V1BoxAndroidRestartParams, ...) (err error)
- func (r *V1BoxAndroidService) RotateScreen(ctx context.Context, id string, body V1BoxAndroidRotateScreenParams, ...) (err error)
- func (r *V1BoxAndroidService) Uninstall(ctx context.Context, packageName string, params V1BoxAndroidUninstallParams, ...) (err error)
- type V1BoxAndroidUninstallParams
- type V1BoxBrowserService
- type V1BoxExecuteCommandsParams
- type V1BoxExecuteCommandsParamsCommandsUnion
- type V1BoxExecuteCommandsResponse
- type V1BoxFExistsParams
- type V1BoxFExistsResponse
- type V1BoxFInfoParams
- type V1BoxFInfoResponseDirectory
- type V1BoxFInfoResponseFile
- type V1BoxFInfoResponseUnion
- type V1BoxFListParams
- type V1BoxFListResponse
- type V1BoxFListResponseDataDirectory
- type V1BoxFListResponseDataFile
- type V1BoxFListResponseDataUnion
- type V1BoxFReadParams
- type V1BoxFReadResponse
- type V1BoxFRemoveParams
- type V1BoxFRemoveResponse
- type V1BoxFRenameParams
- type V1BoxFRenameResponse
- type V1BoxFService
- func (r *V1BoxFService) Exists(ctx context.Context, id string, body V1BoxFExistsParams, ...) (res *V1BoxFExistsResponse, err error)
- func (r *V1BoxFService) Info(ctx context.Context, id string, query V1BoxFInfoParams, ...) (res *V1BoxFInfoResponseUnion, err error)
- func (r *V1BoxFService) List(ctx context.Context, id string, query V1BoxFListParams, ...) (res *V1BoxFListResponse, err error)
- func (r *V1BoxFService) Read(ctx context.Context, id string, query V1BoxFReadParams, ...) (res *V1BoxFReadResponse, err error)
- func (r *V1BoxFService) Remove(ctx context.Context, id string, body V1BoxFRemoveParams, ...) (res *V1BoxFRemoveResponse, err error)
- func (r *V1BoxFService) Rename(ctx context.Context, id string, body V1BoxFRenameParams, ...) (res *V1BoxFRenameResponse, err error)
- func (r *V1BoxFService) Write(ctx context.Context, id string, body V1BoxFWriteParams, ...) (res *V1BoxFWriteResponse, err error)
- type V1BoxFWriteParams
- type V1BoxFWriteResponse
- type V1BoxGetResponseUnion
- type V1BoxGetResponseUnionConfig
- type V1BoxGetResponseUnionConfigBrowser
- type V1BoxGetResponseUnionConfigOs
- type V1BoxGetResponseUnionConfigResolution
- type V1BoxListParams
- type V1BoxListResponse
- type V1BoxListResponseDataUnion
- type V1BoxListResponseDataUnionConfig
- type V1BoxListResponseDataUnionConfigBrowser
- type V1BoxListResponseDataUnionConfigOs
- type V1BoxListResponseDataUnionConfigResolution
- type V1BoxLiveViewURLResponse
- type V1BoxNewAndroidParams
- type V1BoxNewLinuxParams
- type V1BoxRunCodeParams
- type V1BoxRunCodeParamsLanguage
- type V1BoxRunCodeResponse
- type V1BoxService
- func (r *V1BoxService) ExecuteCommands(ctx context.Context, id string, body V1BoxExecuteCommandsParams, ...) (res *V1BoxExecuteCommandsResponse, err error)
- func (r *V1BoxService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *V1BoxGetResponseUnion, err error)
- func (r *V1BoxService) List(ctx context.Context, query V1BoxListParams, opts ...option.RequestOption) (res *V1BoxListResponse, err error)
- func (r *V1BoxService) LiveViewURL(ctx context.Context, id string, opts ...option.RequestOption) (res *V1BoxLiveViewURLResponse, err error)
- func (r *V1BoxService) NewAndroid(ctx context.Context, body V1BoxNewAndroidParams, opts ...option.RequestOption) (res *AndroidBox, err error)
- func (r *V1BoxService) NewLinux(ctx context.Context, body V1BoxNewLinuxParams, opts ...option.RequestOption) (res *LinuxBox, err error)
- func (r *V1BoxService) RunCode(ctx context.Context, id string, body V1BoxRunCodeParams, ...) (res *V1BoxRunCodeResponse, err error)
- func (r *V1BoxService) Start(ctx context.Context, id string, body V1BoxStartParams, ...) (res *V1BoxStartResponseUnion, err error)
- func (r *V1BoxService) Stop(ctx context.Context, id string, body V1BoxStopParams, ...) (res *V1BoxStopResponseUnion, err error)
- func (r *V1BoxService) Terminate(ctx context.Context, id string, body V1BoxTerminateParams, ...) (err error)
- type V1BoxStartParams
- type V1BoxStartResponseUnion
- type V1BoxStartResponseUnionConfig
- type V1BoxStartResponseUnionConfigBrowser
- type V1BoxStartResponseUnionConfigOs
- type V1BoxStartResponseUnionConfigResolution
- type V1BoxStopParams
- type V1BoxStopResponseUnion
- type V1BoxStopResponseUnionConfig
- type V1BoxStopResponseUnionConfigBrowser
- type V1BoxStopResponseUnionConfigOs
- type V1BoxStopResponseUnionConfigResolution
- type V1BoxTerminateParams
- type V1Service
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (GBOX_API_KEY, GBOX_CLIENT_BASE_URL). This should be used to initialize new clients.
func Opt ¶
func Opt[T comparable](v T) param.Opt[T]
Types ¶
type ActionResult ¶
type ActionResult struct { // Complete screenshot result with operation trace, before and after images Screenshot ActionResultScreenshot `json:"screenshot,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Screenshot respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Result of an UI action execution
func (ActionResult) RawJSON ¶
func (r ActionResult) RawJSON() string
Returns the unmodified JSON received from the API
func (*ActionResult) UnmarshalJSON ¶
func (r *ActionResult) UnmarshalJSON(data []byte) error
type ActionResultScreenshot ¶
type ActionResultScreenshot struct { // Screenshot taken after action execution After ActionResultScreenshotAfter `json:"after,required"` // Screenshot taken before action execution Before ActionResultScreenshotBefore `json:"before,required"` // Screenshot with action operation trace Trace ActionResultScreenshotTrace `json:"trace,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { After respjson.Field Before respjson.Field Trace respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Complete screenshot result with operation trace, before and after images
func (ActionResultScreenshot) RawJSON ¶
func (r ActionResultScreenshot) RawJSON() string
Returns the unmodified JSON received from the API
func (*ActionResultScreenshot) UnmarshalJSON ¶
func (r *ActionResultScreenshot) UnmarshalJSON(data []byte) error
type ActionResultScreenshotAfter ¶
type ActionResultScreenshotAfter struct { // URI of the screenshot after the action Uri string `json:"uri,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Uri respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Screenshot taken after action execution
func (ActionResultScreenshotAfter) RawJSON ¶
func (r ActionResultScreenshotAfter) RawJSON() string
Returns the unmodified JSON received from the API
func (*ActionResultScreenshotAfter) UnmarshalJSON ¶
func (r *ActionResultScreenshotAfter) UnmarshalJSON(data []byte) error
type ActionResultScreenshotBefore ¶
type ActionResultScreenshotBefore struct { // URI of the screenshot before the action Uri string `json:"uri,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Uri respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Screenshot taken before action execution
func (ActionResultScreenshotBefore) RawJSON ¶
func (r ActionResultScreenshotBefore) RawJSON() string
Returns the unmodified JSON received from the API
func (*ActionResultScreenshotBefore) UnmarshalJSON ¶
func (r *ActionResultScreenshotBefore) UnmarshalJSON(data []byte) error
type ActionResultScreenshotTrace ¶
type ActionResultScreenshotTrace struct { // URI of the screenshot with operation trace Uri string `json:"uri,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Uri respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Screenshot with action operation trace
func (ActionResultScreenshotTrace) RawJSON ¶
func (r ActionResultScreenshotTrace) RawJSON() string
Returns the unmodified JSON received from the API
func (*ActionResultScreenshotTrace) UnmarshalJSON ¶
func (r *ActionResultScreenshotTrace) UnmarshalJSON(data []byte) error
type AndroidApp ¶
type AndroidApp struct { // Android app apk path ApkPath string `json:"apkPath,required"` // Application type: system or third-party // // Any of "system", "third-party". AppType AndroidAppAppType `json:"appType,required"` // Whether the application is currently running IsRunning bool `json:"isRunning,required"` // Android app name Name string `json:"name,required"` // Android app package name PackageName string `json:"packageName,required"` // Android app version Version string `json:"version,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ApkPath respjson.Field AppType respjson.Field IsRunning respjson.Field Name respjson.Field PackageName respjson.Field Version respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Android app information
func (AndroidApp) RawJSON ¶
func (r AndroidApp) RawJSON() string
Returns the unmodified JSON received from the API
func (*AndroidApp) UnmarshalJSON ¶
func (r *AndroidApp) UnmarshalJSON(data []byte) error
type AndroidAppAppType ¶
type AndroidAppAppType string
Application type: system or third-party
const ( AndroidAppAppTypeSystem AndroidAppAppType = "system" AndroidAppAppTypeThirdParty AndroidAppAppType = "third-party" )
type AndroidBox ¶
type AndroidBox struct { // Unique identifier for the box ID string `json:"id,required"` // Complete configuration for Android box instance Config AndroidBoxConfig `json:"config,required"` // Creation timestamp of the box CreatedAt time.Time `json:"createdAt,required" format:"date-time"` // Expiration timestamp of the box ExpiresAt time.Time `json:"expiresAt,required" format:"date-time"` // The current status of a box instance // // Any of "pending", "running", "stopped", "error", "terminated". Status AndroidBoxStatus `json:"status,required"` // Box type is Android // // Any of "android". Type AndroidBoxType `json:"type,required"` // Last update timestamp of the box UpdatedAt time.Time `json:"updatedAt,required" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Config respjson.Field CreatedAt respjson.Field ExpiresAt respjson.Field Status respjson.Field Type respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Android box instance with full configuration and status
func (AndroidBox) RawJSON ¶
func (r AndroidBox) RawJSON() string
Returns the unmodified JSON received from the API
func (*AndroidBox) UnmarshalJSON ¶
func (r *AndroidBox) UnmarshalJSON(data []byte) error
type AndroidBoxConfig ¶
type AndroidBoxConfig struct { // CPU cores allocated to the box CPU float64 `json:"cpu,required"` // Environment variables for the box Envs any `json:"envs,required"` // Key-value pairs of labels for the box Labels any `json:"labels,required"` // Memory allocated to the box in MB Memory float64 `json:"memory,required"` // Android operating system configuration Os AndroidBoxConfigOs `json:"os,required"` // Box display resolution configuration Resolution AndroidBoxConfigResolution `json:"resolution,required"` // Storage allocated to the box in GB Storage float64 `json:"storage,required"` // Android browser configuration settings Browser AndroidBoxConfigBrowser `json:"browser"` // Device type - virtual or physical Android device // // Any of "virtual", "physical". DeviceType string `json:"deviceType"` // Working directory path for the box WorkingDir string `json:"workingDir"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CPU respjson.Field Envs respjson.Field Labels respjson.Field Memory respjson.Field Os respjson.Field Resolution respjson.Field Storage respjson.Field Browser respjson.Field DeviceType respjson.Field WorkingDir respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Complete configuration for Android box instance
func (AndroidBoxConfig) RawJSON ¶
func (r AndroidBoxConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*AndroidBoxConfig) UnmarshalJSON ¶
func (r *AndroidBoxConfig) UnmarshalJSON(data []byte) error
type AndroidBoxConfigBrowser ¶
type AndroidBoxConfigBrowser struct { // Supported browser types for Android boxes // // Any of "Chrome for Android", "UC Browser for Android". Type string `json:"type,required"` // Browser version string (e.g. '136') Version string `json:"version,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Type respjson.Field Version respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Android browser configuration settings
func (AndroidBoxConfigBrowser) RawJSON ¶
func (r AndroidBoxConfigBrowser) RawJSON() string
Returns the unmodified JSON received from the API
func (*AndroidBoxConfigBrowser) UnmarshalJSON ¶
func (r *AndroidBoxConfigBrowser) UnmarshalJSON(data []byte) error
type AndroidBoxConfigOs ¶
type AndroidBoxConfigOs struct { // Supported Android versions // // Any of "12", "13", "15". Version string `json:"version,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Version respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Android operating system configuration
func (AndroidBoxConfigOs) RawJSON ¶
func (r AndroidBoxConfigOs) RawJSON() string
Returns the unmodified JSON received from the API
func (*AndroidBoxConfigOs) UnmarshalJSON ¶
func (r *AndroidBoxConfigOs) UnmarshalJSON(data []byte) error
type AndroidBoxConfigResolution ¶
type AndroidBoxConfigResolution struct { // Height of the box Height float64 `json:"height,required"` // Width of the box Width float64 `json:"width,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Height respjson.Field Width respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Box display resolution configuration
func (AndroidBoxConfigResolution) RawJSON ¶
func (r AndroidBoxConfigResolution) RawJSON() string
Returns the unmodified JSON received from the API
func (*AndroidBoxConfigResolution) UnmarshalJSON ¶
func (r *AndroidBoxConfigResolution) UnmarshalJSON(data []byte) error
type AndroidBoxStatus ¶
type AndroidBoxStatus string
The current status of a box instance
const ( AndroidBoxStatusPending AndroidBoxStatus = "pending" AndroidBoxStatusRunning AndroidBoxStatus = "running" AndroidBoxStatusStopped AndroidBoxStatus = "stopped" AndroidBoxStatusError AndroidBoxStatus = "error" AndroidBoxStatusTerminated AndroidBoxStatus = "terminated" )
type AndroidBoxType ¶
type AndroidBoxType string
Box type is Android
const (
AndroidBoxTypeAndroid AndroidBoxType = "android"
)
type Client ¶
type Client struct { Options []option.RequestOption V1 V1Service }
Client creates a struct with services and top level methods that help with interacting with the gbox-client API. You should not instantiate this client directly, and instead use the NewClient method instead.
func NewClient ¶
func NewClient(opts ...option.RequestOption) (r Client)
NewClient generates a new client with the default option read from the environment (GBOX_API_KEY, GBOX_CLIENT_BASE_URL). The option passed in as arguments are applied after these default arguments, and all option will be passed down to the services and requests that this client makes.
func (*Client) Delete ¶
func (r *Client) Delete(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Delete makes a DELETE request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Execute ¶
func (r *Client) Execute(ctx context.Context, method string, path string, params any, res any, opts ...option.RequestOption) error
Execute makes a request with the given context, method, URL, request params, response, and request options. This is useful for hitting undocumented endpoints while retaining the base URL, auth, retries, and other options from the client.
If a byte slice or an io.Reader is supplied to params, it will be used as-is for the request body.
The params is by default serialized into the body using encoding/json. If your type implements a MarshalJSON function, it will be used instead to serialize the request. If a URLQuery method is implemented, the returned url.Values will be used as query strings to the url.
If your params struct uses param.Field, you must provide either [MarshalJSON], [URLQuery], and/or [MarshalForm] functions. It is undefined behavior to use a struct uses param.Field without specifying how it is serialized.
Any "…Params" object defined in this library can be used as the request argument. Note that 'path' arguments will not be forwarded into the url.
The response body will be deserialized into the res variable, depending on its type:
- A pointer to a *http.Response is populated by the raw response.
- A pointer to a byte array will be populated with the contents of the request body.
- A pointer to any other type uses this library's default JSON decoding, which respects UnmarshalJSON if it is defined on the type.
- A nil value will not read the response body.
For even greater flexibility, see option.WithResponseInto and option.WithResponseBodyInto.
func (*Client) Get ¶
func (r *Client) Get(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Get makes a GET request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
func (*Client) Patch ¶
func (r *Client) Patch(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error
Patch makes a PATCH request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.
type CreateAndroidBoxParam ¶
type CreateAndroidBoxParam struct { // Wait for the box operation to be completed, default is true Wait param.Opt[bool] `json:"wait,omitzero"` // Configuration for a box instance Config CreateBoxConfigParam `json:"config,omitzero"` // contains filtered or unexported fields }
Request body for creating a new Android box instance
func (CreateAndroidBoxParam) MarshalJSON ¶
func (r CreateAndroidBoxParam) MarshalJSON() (data []byte, err error)
func (*CreateAndroidBoxParam) UnmarshalJSON ¶
func (r *CreateAndroidBoxParam) UnmarshalJSON(data []byte) error
type CreateBoxConfigDeviceType ¶
type CreateBoxConfigDeviceType string
Device type - virtual or physical Android device
const ( CreateBoxConfigDeviceTypeVirtual CreateBoxConfigDeviceType = "virtual" CreateBoxConfigDeviceTypePhysical CreateBoxConfigDeviceType = "physical" )
type CreateBoxConfigParam ¶
type CreateBoxConfigParam struct { // The box will be alive for the given duration (e.g. '10m') ExpiresIn param.Opt[string] `json:"expiresIn,omitzero"` // Device type - virtual or physical Android device // // Any of "virtual", "physical". DeviceType CreateBoxConfigDeviceType `json:"deviceType,omitzero"` // Environment variables for the box Envs any `json:"envs,omitzero"` // Key-value pairs of labels for the box Labels any `json:"labels,omitzero"` // contains filtered or unexported fields }
Configuration for a box instance
func (CreateBoxConfigParam) MarshalJSON ¶
func (r CreateBoxConfigParam) MarshalJSON() (data []byte, err error)
func (*CreateBoxConfigParam) UnmarshalJSON ¶
func (r *CreateBoxConfigParam) UnmarshalJSON(data []byte) error
type CreateLinuxBoxParam ¶
type CreateLinuxBoxParam struct { // Wait for the box operation to be completed, default is true Wait param.Opt[bool] `json:"wait,omitzero"` // Configuration for a box instance Config CreateBoxConfigParam `json:"config,omitzero"` // contains filtered or unexported fields }
Request body for creating a new Linux box instance
func (CreateLinuxBoxParam) MarshalJSON ¶
func (r CreateLinuxBoxParam) MarshalJSON() (data []byte, err error)
func (*CreateLinuxBoxParam) UnmarshalJSON ¶
func (r *CreateLinuxBoxParam) UnmarshalJSON(data []byte) error
type LinuxBox ¶
type LinuxBox struct { // Unique identifier for the box ID string `json:"id,required"` // Complete configuration for Linux box instance Config LinuxBoxConfig `json:"config,required"` // Creation timestamp of the box CreatedAt time.Time `json:"createdAt,required" format:"date-time"` // Expiration timestamp of the box ExpiresAt time.Time `json:"expiresAt,required" format:"date-time"` // The current status of a box instance // // Any of "pending", "running", "stopped", "error", "terminated". Status LinuxBoxStatus `json:"status,required"` // Box type is Linux // // Any of "linux". Type LinuxBoxType `json:"type,required"` // Last update timestamp of the box UpdatedAt time.Time `json:"updatedAt,required" format:"date-time"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ID respjson.Field Config respjson.Field CreatedAt respjson.Field ExpiresAt respjson.Field Status respjson.Field Type respjson.Field UpdatedAt respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Linux box instance with full configuration and status
func (*LinuxBox) UnmarshalJSON ¶
type LinuxBoxConfig ¶
type LinuxBoxConfig struct { // CPU cores allocated to the box CPU float64 `json:"cpu,required"` // Environment variables for the box Envs any `json:"envs,required"` // Key-value pairs of labels for the box Labels any `json:"labels,required"` // Memory allocated to the box in MB Memory float64 `json:"memory,required"` // Linux operating system configuration Os LinuxBoxConfigOs `json:"os,required"` // Box display resolution configuration Resolution LinuxBoxConfigResolution `json:"resolution,required"` // Storage allocated to the box in GB. Storage float64 `json:"storage,required"` // Linux browser configuration settings Browser LinuxBoxConfigBrowser `json:"browser"` // Working directory path for the box WorkingDir string `json:"workingDir"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { CPU respjson.Field Envs respjson.Field Labels respjson.Field Memory respjson.Field Os respjson.Field Resolution respjson.Field Storage respjson.Field Browser respjson.Field WorkingDir respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Complete configuration for Linux box instance
func (LinuxBoxConfig) RawJSON ¶
func (r LinuxBoxConfig) RawJSON() string
Returns the unmodified JSON received from the API
func (*LinuxBoxConfig) UnmarshalJSON ¶
func (r *LinuxBoxConfig) UnmarshalJSON(data []byte) error
type LinuxBoxConfigBrowser ¶
type LinuxBoxConfigBrowser struct { // Supported browser types for Linux boxes // // Any of "chromium", "firefox", "webkit". Type string `json:"type,required"` // Browser version string (e.g. '12') Version string `json:"version,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Type respjson.Field Version respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Linux browser configuration settings
func (LinuxBoxConfigBrowser) RawJSON ¶
func (r LinuxBoxConfigBrowser) RawJSON() string
Returns the unmodified JSON received from the API
func (*LinuxBoxConfigBrowser) UnmarshalJSON ¶
func (r *LinuxBoxConfigBrowser) UnmarshalJSON(data []byte) error
type LinuxBoxConfigOs ¶
type LinuxBoxConfigOs struct { // OS version string (e.g. 'ubuntu-20.04') Version string `json:"version,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Version respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Linux operating system configuration
func (LinuxBoxConfigOs) RawJSON ¶
func (r LinuxBoxConfigOs) RawJSON() string
Returns the unmodified JSON received from the API
func (*LinuxBoxConfigOs) UnmarshalJSON ¶
func (r *LinuxBoxConfigOs) UnmarshalJSON(data []byte) error
type LinuxBoxConfigResolution ¶
type LinuxBoxConfigResolution struct { // Height of the box Height float64 `json:"height,required"` // Width of the box Width float64 `json:"width,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Height respjson.Field Width respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Box display resolution configuration
func (LinuxBoxConfigResolution) RawJSON ¶
func (r LinuxBoxConfigResolution) RawJSON() string
Returns the unmodified JSON received from the API
func (*LinuxBoxConfigResolution) UnmarshalJSON ¶
func (r *LinuxBoxConfigResolution) UnmarshalJSON(data []byte) error
type LinuxBoxStatus ¶
type LinuxBoxStatus string
The current status of a box instance
const ( LinuxBoxStatusPending LinuxBoxStatus = "pending" LinuxBoxStatusRunning LinuxBoxStatus = "running" LinuxBoxStatusStopped LinuxBoxStatus = "stopped" LinuxBoxStatusError LinuxBoxStatus = "error" LinuxBoxStatusTerminated LinuxBoxStatus = "terminated" )
type LinuxBoxType ¶
type LinuxBoxType string
Box type is Linux
const (
LinuxBoxTypeLinux LinuxBoxType = "linux"
)
type V1BoxActionClickParams ¶
type V1BoxActionClickParams struct { // X coordinate of the click X float64 `json:"x,required"` // Y coordinate of the click Y float64 `json:"y,required"` // Whether to perform a double click Double param.Opt[bool] `json:"double,omitzero"` // Delay after performing the action, before taking the final screenshot. // // Execution flow: // // 1. Take screenshot before action // 2. Perform the action // 3. Wait for screenshotDelay (this parameter) // 4. Take screenshot after action // // Example: '500ms' means wait 500ms after the action before capturing the final // screenshot. ScreenshotDelay param.Opt[string] `json:"screenshotDelay,omitzero"` // Mouse button to click // // Any of "left", "right", "middle". Button V1BoxActionClickParamsButton `json:"button,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionClickParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionClickParams) MarshalJSON ¶
func (r V1BoxActionClickParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionClickParams) UnmarshalJSON ¶
func (r *V1BoxActionClickParams) UnmarshalJSON(data []byte) error
type V1BoxActionClickParamsButton ¶
type V1BoxActionClickParamsButton string
Mouse button to click
const ( V1BoxActionClickParamsButtonLeft V1BoxActionClickParamsButton = "left" V1BoxActionClickParamsButtonRight V1BoxActionClickParamsButton = "right" V1BoxActionClickParamsButtonMiddle V1BoxActionClickParamsButton = "middle" )
type V1BoxActionClickParamsOutputFormat ¶
type V1BoxActionClickParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionClickParamsOutputFormatBase64 V1BoxActionClickParamsOutputFormat = "base64" V1BoxActionClickParamsOutputFormatStorageKey V1BoxActionClickParamsOutputFormat = "storageKey" )
type V1BoxActionDragParams ¶
type V1BoxActionDragParams struct { // Path of the drag action as a series of coordinates Path []V1BoxActionDragParamsPath `json:"path,omitzero,required"` // Time interval between points (e.g. "50ms") Duration param.Opt[string] `json:"duration,omitzero"` // Delay after performing the action, before taking the final screenshot. // // Execution flow: // // 1. Take screenshot before action // 2. Perform the action // 3. Wait for screenshotDelay (this parameter) // 4. Take screenshot after action // // Example: '500ms' means wait 500ms after the action before capturing the final // screenshot. ScreenshotDelay param.Opt[string] `json:"screenshotDelay,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionDragParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionDragParams) MarshalJSON ¶
func (r V1BoxActionDragParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionDragParams) UnmarshalJSON ¶
func (r *V1BoxActionDragParams) UnmarshalJSON(data []byte) error
type V1BoxActionDragParamsOutputFormat ¶
type V1BoxActionDragParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionDragParamsOutputFormatBase64 V1BoxActionDragParamsOutputFormat = "base64" V1BoxActionDragParamsOutputFormatStorageKey V1BoxActionDragParamsOutputFormat = "storageKey" )
type V1BoxActionDragParamsPath ¶
type V1BoxActionDragParamsPath struct { // X coordinate of a point in the drag path X float64 `json:"x,required"` // Y coordinate of a point in the drag path Y float64 `json:"y,required"` // contains filtered or unexported fields }
Single point in a drag path
The properties X, Y are required.
func (V1BoxActionDragParamsPath) MarshalJSON ¶
func (r V1BoxActionDragParamsPath) MarshalJSON() (data []byte, err error)
func (*V1BoxActionDragParamsPath) UnmarshalJSON ¶
func (r *V1BoxActionDragParamsPath) UnmarshalJSON(data []byte) error
type V1BoxActionMoveParams ¶
type V1BoxActionMoveParams struct { // X coordinate to move to X float64 `json:"x,required"` // Y coordinate to move to Y float64 `json:"y,required"` // Delay after performing the action, before taking the final screenshot. // // Execution flow: // // 1. Take screenshot before action // 2. Perform the action // 3. Wait for screenshotDelay (this parameter) // 4. Take screenshot after action // // Example: '500ms' means wait 500ms after the action before capturing the final // screenshot. ScreenshotDelay param.Opt[string] `json:"screenshotDelay,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionMoveParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionMoveParams) MarshalJSON ¶
func (r V1BoxActionMoveParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionMoveParams) UnmarshalJSON ¶
func (r *V1BoxActionMoveParams) UnmarshalJSON(data []byte) error
type V1BoxActionMoveParamsOutputFormat ¶
type V1BoxActionMoveParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionMoveParamsOutputFormatBase64 V1BoxActionMoveParamsOutputFormat = "base64" V1BoxActionMoveParamsOutputFormatStorageKey V1BoxActionMoveParamsOutputFormat = "storageKey" )
type V1BoxActionPressButtonParams ¶
type V1BoxActionPressButtonParams struct { // Button to press // // Any of "power", "volumeUp", "volumeDown", "volumeMute", "home", "back", "menu", // "appSwitch". Buttons []string `json:"buttons,omitzero,required"` // Delay after performing the action, before taking the final screenshot. // // Execution flow: // // 1. Take screenshot before action // 2. Perform the action // 3. Wait for screenshotDelay (this parameter) // 4. Take screenshot after action // // Example: '500ms' means wait 500ms after the action before capturing the final // screenshot. ScreenshotDelay param.Opt[string] `json:"screenshotDelay,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionPressButtonParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionPressButtonParams) MarshalJSON ¶
func (r V1BoxActionPressButtonParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionPressButtonParams) UnmarshalJSON ¶
func (r *V1BoxActionPressButtonParams) UnmarshalJSON(data []byte) error
type V1BoxActionPressButtonParamsOutputFormat ¶
type V1BoxActionPressButtonParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionPressButtonParamsOutputFormatBase64 V1BoxActionPressButtonParamsOutputFormat = "base64" V1BoxActionPressButtonParamsOutputFormatStorageKey V1BoxActionPressButtonParamsOutputFormat = "storageKey" )
type V1BoxActionPressKeyParams ¶
type V1BoxActionPressKeyParams struct { // This is an array of keyboard keys to press. Supports cross-platform // compatibility. // // Any of "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", // "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "0", "1", "2", "3", // "4", "5", "6", "7", "8", "9", "f1", "f2", "f3", "f4", "f5", "f6", "f7", "f8", // "f9", "f10", "f11", "f12", "control", "alt", "shift", "meta", "win", "cmd", // "option", "arrowUp", "arrowDown", "arrowLeft", "arrowRight", "home", "end", // "pageUp", "pageDown", "enter", "space", "tab", "escape", "backspace", "delete", // "insert", "capsLock", "numLock", "scrollLock", "pause", "printScreen", ";", "=", // ",", "-", ".", "/", "`", "[", "\\", "]", "'", "numpad0", "numpad1", "numpad2", // "numpad3", "numpad4", "numpad5", "numpad6", "numpad7", "numpad8", "numpad9", // "numpadAdd", "numpadSubtract", "numpadMultiply", "numpadDivide", // "numpadDecimal", "numpadEnter", "numpadEqual", "volumeUp", "volumeDown", // "volumeMute", "mediaPlayPause", "mediaStop", "mediaNextTrack", // "mediaPreviousTrack". Keys []string `json:"keys,omitzero,required"` // Delay after performing the action, before taking the final screenshot. // // Execution flow: // // 1. Take screenshot before action // 2. Perform the action // 3. Wait for screenshotDelay (this parameter) // 4. Take screenshot after action // // Example: '500ms' means wait 500ms after the action before capturing the final // screenshot. ScreenshotDelay param.Opt[string] `json:"screenshotDelay,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionPressKeyParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionPressKeyParams) MarshalJSON ¶
func (r V1BoxActionPressKeyParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionPressKeyParams) UnmarshalJSON ¶
func (r *V1BoxActionPressKeyParams) UnmarshalJSON(data []byte) error
type V1BoxActionPressKeyParamsOutputFormat ¶
type V1BoxActionPressKeyParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionPressKeyParamsOutputFormatBase64 V1BoxActionPressKeyParamsOutputFormat = "base64" V1BoxActionPressKeyParamsOutputFormatStorageKey V1BoxActionPressKeyParamsOutputFormat = "storageKey" )
type V1BoxActionScreenshotParams ¶
type V1BoxActionScreenshotParams struct { // Clipping region for screenshot capture Clip V1BoxActionScreenshotParamsClip `json:"clip,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionScreenshotParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionScreenshotParams) MarshalJSON ¶
func (r V1BoxActionScreenshotParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionScreenshotParams) UnmarshalJSON ¶
func (r *V1BoxActionScreenshotParams) UnmarshalJSON(data []byte) error
type V1BoxActionScreenshotParamsClip ¶
type V1BoxActionScreenshotParamsClip struct { // Height of the clip Height float64 `json:"height,required"` // Width of the clip Width float64 `json:"width,required"` // X coordinate of the clip X float64 `json:"x,required"` // Y coordinate of the clip Y float64 `json:"y,required"` // contains filtered or unexported fields }
Clipping region for screenshot capture
The properties Height, Width, X, Y are required.
func (V1BoxActionScreenshotParamsClip) MarshalJSON ¶
func (r V1BoxActionScreenshotParamsClip) MarshalJSON() (data []byte, err error)
func (*V1BoxActionScreenshotParamsClip) UnmarshalJSON ¶
func (r *V1BoxActionScreenshotParamsClip) UnmarshalJSON(data []byte) error
type V1BoxActionScreenshotParamsOutputFormat ¶
type V1BoxActionScreenshotParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionScreenshotParamsOutputFormatBase64 V1BoxActionScreenshotParamsOutputFormat = "base64" V1BoxActionScreenshotParamsOutputFormatStorageKey V1BoxActionScreenshotParamsOutputFormat = "storageKey" )
type V1BoxActionScreenshotResponse ¶
type V1BoxActionScreenshotResponse struct { // URL of the screenshot Uri string `json:"uri,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Uri respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Result of screenshot capture action
func (V1BoxActionScreenshotResponse) RawJSON ¶
func (r V1BoxActionScreenshotResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxActionScreenshotResponse) UnmarshalJSON ¶
func (r *V1BoxActionScreenshotResponse) UnmarshalJSON(data []byte) error
type V1BoxActionScrollParams ¶
type V1BoxActionScrollParams struct { // Horizontal scroll amount ScrollX float64 `json:"scrollX,required"` // Vertical scroll amount ScrollY float64 `json:"scrollY,required"` // X coordinate of the scroll position X float64 `json:"x,required"` // Y coordinate of the scroll position Y float64 `json:"y,required"` // Delay after performing the action, before taking the final screenshot. // // Execution flow: // // 1. Take screenshot before action // 2. Perform the action // 3. Wait for screenshotDelay (this parameter) // 4. Take screenshot after action // // Example: '500ms' means wait 500ms after the action before capturing the final // screenshot. ScreenshotDelay param.Opt[string] `json:"screenshotDelay,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionScrollParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionScrollParams) MarshalJSON ¶
func (r V1BoxActionScrollParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionScrollParams) UnmarshalJSON ¶
func (r *V1BoxActionScrollParams) UnmarshalJSON(data []byte) error
type V1BoxActionScrollParamsOutputFormat ¶
type V1BoxActionScrollParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionScrollParamsOutputFormatBase64 V1BoxActionScrollParamsOutputFormat = "base64" V1BoxActionScrollParamsOutputFormatStorageKey V1BoxActionScrollParamsOutputFormat = "storageKey" )
type V1BoxActionService ¶
type V1BoxActionService struct {
Options []option.RequestOption
}
V1BoxActionService contains methods and other services that help with interacting with the gbox-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV1BoxActionService method instead.
func NewV1BoxActionService ¶
func NewV1BoxActionService(opts ...option.RequestOption) (r V1BoxActionService)
NewV1BoxActionService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*V1BoxActionService) Click ¶
func (r *V1BoxActionService) Click(ctx context.Context, id string, body V1BoxActionClickParams, opts ...option.RequestOption) (res *ActionResult, err error)
Click
func (*V1BoxActionService) Drag ¶
func (r *V1BoxActionService) Drag(ctx context.Context, id string, body V1BoxActionDragParams, opts ...option.RequestOption) (res *ActionResult, err error)
Drag
func (*V1BoxActionService) Move ¶
func (r *V1BoxActionService) Move(ctx context.Context, id string, body V1BoxActionMoveParams, opts ...option.RequestOption) (res *ActionResult, err error)
Move to position
func (*V1BoxActionService) PressButton ¶
func (r *V1BoxActionService) PressButton(ctx context.Context, id string, body V1BoxActionPressButtonParams, opts ...option.RequestOption) (res *ActionResult, err error)
Press button on the device. like power button, volume up button, volume down button, etc.
func (*V1BoxActionService) PressKey ¶
func (r *V1BoxActionService) PressKey(ctx context.Context, id string, body V1BoxActionPressKeyParams, opts ...option.RequestOption) (res *ActionResult, err error)
Simulates pressing a specific key by triggering the complete keyboard key event chain (keydown, keypress, keyup). Use this to activate keyboard key event listeners such as shortcuts or form submissions.
func (*V1BoxActionService) Screenshot ¶
func (r *V1BoxActionService) Screenshot(ctx context.Context, id string, body V1BoxActionScreenshotParams, opts ...option.RequestOption) (res *V1BoxActionScreenshotResponse, err error)
Take screenshot
func (*V1BoxActionService) Scroll ¶
func (r *V1BoxActionService) Scroll(ctx context.Context, id string, body V1BoxActionScrollParams, opts ...option.RequestOption) (res *ActionResult, err error)
Scroll
func (*V1BoxActionService) Touch ¶
func (r *V1BoxActionService) Touch(ctx context.Context, id string, body V1BoxActionTouchParams, opts ...option.RequestOption) (res *ActionResult, err error)
Touch
func (*V1BoxActionService) Type ¶
func (r *V1BoxActionService) Type(ctx context.Context, id string, body V1BoxActionTypeParams, opts ...option.RequestOption) (res *ActionResult, err error)
Directly inputs text content without triggering physical key events (keydown, etc.), ideal for quickly filling large amounts of text when intermediate input events aren't needed.
type V1BoxActionTouchParams ¶
type V1BoxActionTouchParams struct { // Array of touch points and their actions Points []V1BoxActionTouchParamsPoint `json:"points,omitzero,required"` // Delay after performing the action, before taking the final screenshot. // // Execution flow: // // 1. Take screenshot before action // 2. Perform the action // 3. Wait for screenshotDelay (this parameter) // 4. Take screenshot after action // // Example: '500ms' means wait 500ms after the action before capturing the final // screenshot. ScreenshotDelay param.Opt[string] `json:"screenshotDelay,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionTouchParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionTouchParams) MarshalJSON ¶
func (r V1BoxActionTouchParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionTouchParams) UnmarshalJSON ¶
func (r *V1BoxActionTouchParams) UnmarshalJSON(data []byte) error
type V1BoxActionTouchParamsOutputFormat ¶
type V1BoxActionTouchParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionTouchParamsOutputFormatBase64 V1BoxActionTouchParamsOutputFormat = "base64" V1BoxActionTouchParamsOutputFormatStorageKey V1BoxActionTouchParamsOutputFormat = "storageKey" )
type V1BoxActionTouchParamsPoint ¶
type V1BoxActionTouchParamsPoint struct { // Initial touch point position Start V1BoxActionTouchParamsPointStart `json:"start,omitzero,required"` // Sequence of actions to perform after initial touch Actions []any `json:"actions,omitzero"` // contains filtered or unexported fields }
Touch point configuration with start position and actions
The property Start is required.
func (V1BoxActionTouchParamsPoint) MarshalJSON ¶
func (r V1BoxActionTouchParamsPoint) MarshalJSON() (data []byte, err error)
func (*V1BoxActionTouchParamsPoint) UnmarshalJSON ¶
func (r *V1BoxActionTouchParamsPoint) UnmarshalJSON(data []byte) error
type V1BoxActionTouchParamsPointStart ¶
type V1BoxActionTouchParamsPointStart struct { // Starting X coordinate X float64 `json:"x,required"` // Starting Y coordinate Y float64 `json:"y,required"` // contains filtered or unexported fields }
Initial touch point position
The properties X, Y are required.
func (V1BoxActionTouchParamsPointStart) MarshalJSON ¶
func (r V1BoxActionTouchParamsPointStart) MarshalJSON() (data []byte, err error)
func (*V1BoxActionTouchParamsPointStart) UnmarshalJSON ¶
func (r *V1BoxActionTouchParamsPointStart) UnmarshalJSON(data []byte) error
type V1BoxActionTypeParams ¶
type V1BoxActionTypeParams struct { // Text to type Text string `json:"text,required"` // Delay after performing the action, before taking the final screenshot. // // Execution flow: // // 1. Take screenshot before action // 2. Perform the action // 3. Wait for screenshotDelay (this parameter) // 4. Take screenshot after action // // Example: '500ms' means wait 500ms after the action before capturing the final // screenshot. ScreenshotDelay param.Opt[string] `json:"screenshotDelay,omitzero"` // Type of the URI. default is base64. // // Any of "base64", "storageKey". OutputFormat V1BoxActionTypeParamsOutputFormat `json:"outputFormat,omitzero"` // contains filtered or unexported fields }
func (V1BoxActionTypeParams) MarshalJSON ¶
func (r V1BoxActionTypeParams) MarshalJSON() (data []byte, err error)
func (*V1BoxActionTypeParams) UnmarshalJSON ¶
func (r *V1BoxActionTypeParams) UnmarshalJSON(data []byte) error
type V1BoxActionTypeParamsOutputFormat ¶
type V1BoxActionTypeParamsOutputFormat string
Type of the URI. default is base64.
const ( V1BoxActionTypeParamsOutputFormatBase64 V1BoxActionTypeParamsOutputFormat = "base64" V1BoxActionTypeParamsOutputFormatStorageKey V1BoxActionTypeParamsOutputFormat = "storageKey" )
type V1BoxAndroidCloseParams ¶
type V1BoxAndroidCloseParams struct { ID string `path:"id,required" json:"-"` // contains filtered or unexported fields }
type V1BoxAndroidGetConnectAddressResponse ¶
type V1BoxAndroidGetConnectAddressResponse struct { // Android adb connect address. use `adb connect <adbConnectAddress>` to connect to // the Android device Adb string `json:"adb,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Adb respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Android connection information
func (V1BoxAndroidGetConnectAddressResponse) RawJSON ¶
func (r V1BoxAndroidGetConnectAddressResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxAndroidGetConnectAddressResponse) UnmarshalJSON ¶
func (r *V1BoxAndroidGetConnectAddressResponse) UnmarshalJSON(data []byte) error
type V1BoxAndroidGetParams ¶
type V1BoxAndroidGetParams struct { ID string `path:"id,required" json:"-"` // contains filtered or unexported fields }
type V1BoxAndroidInstallParams ¶
type V1BoxAndroidInstallParams struct { // This field is a request body variant, only one variant field can be set. Request // for installing Android app from uploaded APK file OfInstallAndroidAppByFile *V1BoxAndroidInstallParamsBodyInstallAndroidAppByFile `json:",inline"` // This field is a request body variant, only one variant field can be set. Request // for installing Android app from HTTP URL OfInstallAndroidAppByURL *V1BoxAndroidInstallParamsBodyInstallAndroidAppByURL `json:",inline"` // contains filtered or unexported fields }
func (V1BoxAndroidInstallParams) MarshalMultipart ¶
func (r V1BoxAndroidInstallParams) MarshalMultipart() (data []byte, contentType string, err error)
type V1BoxAndroidInstallParamsBodyInstallAndroidAppByFile ¶
type V1BoxAndroidInstallParamsBodyInstallAndroidAppByFile struct { // APK file to install (max file size: 200MB) Apk io.Reader `json:"apk,omitzero,required" format:"binary"` // contains filtered or unexported fields }
Request for installing Android app from uploaded APK file
The property Apk is required.
func (V1BoxAndroidInstallParamsBodyInstallAndroidAppByFile) MarshalJSON ¶
func (r V1BoxAndroidInstallParamsBodyInstallAndroidAppByFile) MarshalJSON() (data []byte, err error)
func (*V1BoxAndroidInstallParamsBodyInstallAndroidAppByFile) UnmarshalJSON ¶
func (r *V1BoxAndroidInstallParamsBodyInstallAndroidAppByFile) UnmarshalJSON(data []byte) error
type V1BoxAndroidInstallParamsBodyInstallAndroidAppByURL ¶
type V1BoxAndroidInstallParamsBodyInstallAndroidAppByURL struct { // HTTP URL to download APK file (max file size: 200MB) Apk string `json:"apk,required"` // contains filtered or unexported fields }
Request for installing Android app from HTTP URL
The property Apk is required.
func (V1BoxAndroidInstallParamsBodyInstallAndroidAppByURL) MarshalJSON ¶
func (r V1BoxAndroidInstallParamsBodyInstallAndroidAppByURL) MarshalJSON() (data []byte, err error)
func (*V1BoxAndroidInstallParamsBodyInstallAndroidAppByURL) UnmarshalJSON ¶
func (r *V1BoxAndroidInstallParamsBodyInstallAndroidAppByURL) UnmarshalJSON(data []byte) error
type V1BoxAndroidListActivitiesParams ¶
type V1BoxAndroidListActivitiesParams struct { ID string `path:"id,required" json:"-"` // contains filtered or unexported fields }
type V1BoxAndroidListActivitiesResponse ¶
type V1BoxAndroidListActivitiesResponse struct { // Activity list Data []V1BoxAndroidListActivitiesResponseData `json:"data,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
func (V1BoxAndroidListActivitiesResponse) RawJSON ¶
func (r V1BoxAndroidListActivitiesResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxAndroidListActivitiesResponse) UnmarshalJSON ¶
func (r *V1BoxAndroidListActivitiesResponse) UnmarshalJSON(data []byte) error
type V1BoxAndroidListActivitiesResponseData ¶
type V1BoxAndroidListActivitiesResponseData struct { // Activity class name ClassName string `json:"className,required"` // Activity class name IsExported bool `json:"isExported,required"` // Whether the activity is the main activity IsMain bool `json:"isMain,required"` // Activity name Name string `json:"name,required"` // Activity package name PackageName string `json:"packageName,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ClassName respjson.Field IsExported respjson.Field IsMain respjson.Field Name respjson.Field PackageName respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Android app activity
func (V1BoxAndroidListActivitiesResponseData) RawJSON ¶
func (r V1BoxAndroidListActivitiesResponseData) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxAndroidListActivitiesResponseData) UnmarshalJSON ¶
func (r *V1BoxAndroidListActivitiesResponseData) UnmarshalJSON(data []byte) error
type V1BoxAndroidListParams ¶
type V1BoxAndroidListParams struct { // Whether to include running apps, default is all IsRunning param.Opt[bool] `query:"isRunning,omitzero" json:"-"` // Application type: system or third-party, default is all // // Any of "system", "third-party". AppType V1BoxAndroidListParamsAppType `query:"appType,omitzero" json:"-"` // contains filtered or unexported fields }
func (V1BoxAndroidListParams) URLQuery ¶
func (r V1BoxAndroidListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V1BoxAndroidListParams's query parameters as `url.Values`.
type V1BoxAndroidListParamsAppType ¶
type V1BoxAndroidListParamsAppType string
Application type: system or third-party, default is all
const ( V1BoxAndroidListParamsAppTypeSystem V1BoxAndroidListParamsAppType = "system" V1BoxAndroidListParamsAppTypeThirdParty V1BoxAndroidListParamsAppType = "third-party" )
type V1BoxAndroidListResponse ¶
type V1BoxAndroidListResponse struct { // Android app list Data []AndroidApp `json:"data,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response containing list of Android apps
func (V1BoxAndroidListResponse) RawJSON ¶
func (r V1BoxAndroidListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxAndroidListResponse) UnmarshalJSON ¶
func (r *V1BoxAndroidListResponse) UnmarshalJSON(data []byte) error
type V1BoxAndroidOpenParams ¶
type V1BoxAndroidOpenParams struct { ID string `path:"id,required" json:"-"` // Activity name, default is the main activity. ActivityName param.Opt[string] `json:"activityName,omitzero"` // contains filtered or unexported fields }
func (V1BoxAndroidOpenParams) MarshalJSON ¶
func (r V1BoxAndroidOpenParams) MarshalJSON() (data []byte, err error)
func (*V1BoxAndroidOpenParams) UnmarshalJSON ¶
func (r *V1BoxAndroidOpenParams) UnmarshalJSON(data []byte) error
type V1BoxAndroidRestartParams ¶
type V1BoxAndroidRestartParams struct { ID string `path:"id,required" json:"-"` // Activity name, default is the main activity. ActivityName param.Opt[string] `json:"activityName,omitzero"` // contains filtered or unexported fields }
func (V1BoxAndroidRestartParams) MarshalJSON ¶
func (r V1BoxAndroidRestartParams) MarshalJSON() (data []byte, err error)
func (*V1BoxAndroidRestartParams) UnmarshalJSON ¶
func (r *V1BoxAndroidRestartParams) UnmarshalJSON(data []byte) error
type V1BoxAndroidRotateScreenParams ¶
type V1BoxAndroidRotateScreenParams struct { // Rotation angle in degrees // // Any of 90, 180, 270. Angle float64 `json:"angle,omitzero,required"` // Rotation direction // // Any of "clockwise", "counter-clockwise". Direction V1BoxAndroidRotateScreenParamsDirection `json:"direction,omitzero,required"` // contains filtered or unexported fields }
func (V1BoxAndroidRotateScreenParams) MarshalJSON ¶
func (r V1BoxAndroidRotateScreenParams) MarshalJSON() (data []byte, err error)
func (*V1BoxAndroidRotateScreenParams) UnmarshalJSON ¶
func (r *V1BoxAndroidRotateScreenParams) UnmarshalJSON(data []byte) error
type V1BoxAndroidRotateScreenParamsDirection ¶
type V1BoxAndroidRotateScreenParamsDirection string
Rotation direction
const ( V1BoxAndroidRotateScreenParamsDirectionClockwise V1BoxAndroidRotateScreenParamsDirection = "clockwise" V1BoxAndroidRotateScreenParamsDirectionCounterClockwise V1BoxAndroidRotateScreenParamsDirection = "counter-clockwise" )
type V1BoxAndroidService ¶
type V1BoxAndroidService struct {
Options []option.RequestOption
}
V1BoxAndroidService contains methods and other services that help with interacting with the gbox-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV1BoxAndroidService method instead.
func NewV1BoxAndroidService ¶
func NewV1BoxAndroidService(opts ...option.RequestOption) (r V1BoxAndroidService)
NewV1BoxAndroidService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*V1BoxAndroidService) Close ¶
func (r *V1BoxAndroidService) Close(ctx context.Context, packageName string, body V1BoxAndroidCloseParams, opts ...option.RequestOption) (err error)
Close app
func (*V1BoxAndroidService) CloseAll ¶
func (r *V1BoxAndroidService) CloseAll(ctx context.Context, id string, opts ...option.RequestOption) (err error)
Close all apps
func (*V1BoxAndroidService) Get ¶
func (r *V1BoxAndroidService) Get(ctx context.Context, packageName string, query V1BoxAndroidGetParams, opts ...option.RequestOption) (res *AndroidApp, err error)
Get app
func (*V1BoxAndroidService) GetConnectAddress ¶
func (r *V1BoxAndroidService) GetConnectAddress(ctx context.Context, id string, opts ...option.RequestOption) (res *V1BoxAndroidGetConnectAddressResponse, err error)
Get connect address
func (*V1BoxAndroidService) Install ¶
func (r *V1BoxAndroidService) Install(ctx context.Context, id string, body V1BoxAndroidInstallParams, opts ...option.RequestOption) (err error)
Install app
func (*V1BoxAndroidService) List ¶
func (r *V1BoxAndroidService) List(ctx context.Context, id string, query V1BoxAndroidListParams, opts ...option.RequestOption) (res *V1BoxAndroidListResponse, err error)
List apps
func (*V1BoxAndroidService) ListActivities ¶
func (r *V1BoxAndroidService) ListActivities(ctx context.Context, packageName string, query V1BoxAndroidListActivitiesParams, opts ...option.RequestOption) (res *V1BoxAndroidListActivitiesResponse, err error)
Get app activities
func (*V1BoxAndroidService) Open ¶
func (r *V1BoxAndroidService) Open(ctx context.Context, packageName string, params V1BoxAndroidOpenParams, opts ...option.RequestOption) (err error)
Open app
func (*V1BoxAndroidService) Restart ¶
func (r *V1BoxAndroidService) Restart(ctx context.Context, packageName string, params V1BoxAndroidRestartParams, opts ...option.RequestOption) (err error)
Restart app
func (*V1BoxAndroidService) RotateScreen ¶
func (r *V1BoxAndroidService) RotateScreen(ctx context.Context, id string, body V1BoxAndroidRotateScreenParams, opts ...option.RequestOption) (err error)
Rotate screen
func (*V1BoxAndroidService) Uninstall ¶
func (r *V1BoxAndroidService) Uninstall(ctx context.Context, packageName string, params V1BoxAndroidUninstallParams, opts ...option.RequestOption) (err error)
Uninstall app
type V1BoxAndroidUninstallParams ¶
type V1BoxAndroidUninstallParams struct { ID string `path:"id,required" json:"-"` // uninstalls the application while retaining the data/cache KeepData param.Opt[bool] `json:"keepData,omitzero"` // contains filtered or unexported fields }
func (V1BoxAndroidUninstallParams) MarshalJSON ¶
func (r V1BoxAndroidUninstallParams) MarshalJSON() (data []byte, err error)
func (*V1BoxAndroidUninstallParams) UnmarshalJSON ¶
func (r *V1BoxAndroidUninstallParams) UnmarshalJSON(data []byte) error
type V1BoxBrowserService ¶
type V1BoxBrowserService struct {
Options []option.RequestOption
}
V1BoxBrowserService contains methods and other services that help with interacting with the gbox-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV1BoxBrowserService method instead.
func NewV1BoxBrowserService ¶
func NewV1BoxBrowserService(opts ...option.RequestOption) (r V1BoxBrowserService)
NewV1BoxBrowserService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*V1BoxBrowserService) CdpURL ¶
func (r *V1BoxBrowserService) CdpURL(ctx context.Context, id string, opts ...option.RequestOption) (res *string, err error)
Get CDP url
type V1BoxExecuteCommandsParams ¶
type V1BoxExecuteCommandsParams struct { // The command to run. Can be a single string or an array of strings Commands V1BoxExecuteCommandsParamsCommandsUnion `json:"commands,omitzero,required"` // The timeout of the command. e.g. '30s' or '1m' or '1h'. If the command times // out, the exit code will be 124. For example: 'timeout 5s sleep 10s' will result // in exit code 124. Timeout param.Opt[string] `json:"timeout,omitzero"` // The working directory of the command WorkingDir param.Opt[string] `json:"workingDir,omitzero"` // The environment variables to run the command Envs any `json:"envs,omitzero"` // contains filtered or unexported fields }
func (V1BoxExecuteCommandsParams) MarshalJSON ¶
func (r V1BoxExecuteCommandsParams) MarshalJSON() (data []byte, err error)
func (*V1BoxExecuteCommandsParams) UnmarshalJSON ¶
func (r *V1BoxExecuteCommandsParams) UnmarshalJSON(data []byte) error
type V1BoxExecuteCommandsParamsCommandsUnion ¶
type V1BoxExecuteCommandsParamsCommandsUnion struct { OfString param.Opt[string] `json:",omitzero,inline"` OfStringArray []string `json:",omitzero,inline"` // contains filtered or unexported fields }
Only one field can be non-zero.
Use param.IsOmitted to confirm if a field is set.
func (V1BoxExecuteCommandsParamsCommandsUnion) MarshalJSON ¶
func (u V1BoxExecuteCommandsParamsCommandsUnion) MarshalJSON() ([]byte, error)
func (*V1BoxExecuteCommandsParamsCommandsUnion) UnmarshalJSON ¶
func (u *V1BoxExecuteCommandsParamsCommandsUnion) UnmarshalJSON(data []byte) error
type V1BoxExecuteCommandsResponse ¶
type V1BoxExecuteCommandsResponse struct { // The exit code of the command ExitCode float64 `json:"exitCode,required"` // The standard error output of the command Stderr string `json:"stderr,required"` // The standard output of the command Stdout string `json:"stdout,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ExitCode respjson.Field Stderr respjson.Field Stdout respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Result of command execution
func (V1BoxExecuteCommandsResponse) RawJSON ¶
func (r V1BoxExecuteCommandsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxExecuteCommandsResponse) UnmarshalJSON ¶
func (r *V1BoxExecuteCommandsResponse) UnmarshalJSON(data []byte) error
type V1BoxFExistsParams ¶
type V1BoxFExistsParams struct { // Path to the file/directory. If the path is not start with '/', the // file/directory will be checked from the working directory Path string `json:"path,required"` // Working directory. If not provided, the file will be read from the root // directory. WorkingDir param.Opt[string] `json:"workingDir,omitzero"` // contains filtered or unexported fields }
func (V1BoxFExistsParams) MarshalJSON ¶
func (r V1BoxFExistsParams) MarshalJSON() (data []byte, err error)
func (*V1BoxFExistsParams) UnmarshalJSON ¶
func (r *V1BoxFExistsParams) UnmarshalJSON(data []byte) error
type V1BoxFExistsResponse ¶
type V1BoxFExistsResponse struct { // Exists Exists bool `json:"exists,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Exists respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response after checking if a file/directory exists
func (V1BoxFExistsResponse) RawJSON ¶
func (r V1BoxFExistsResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFExistsResponse) UnmarshalJSON ¶
func (r *V1BoxFExistsResponse) UnmarshalJSON(data []byte) error
type V1BoxFInfoParams ¶
type V1BoxFInfoParams struct { // Path to the file/directory. If the path is not start with '/', the // file/directory will be checked from the working directory Path string `query:"path,required" json:"-"` // Working directory. If not provided, the file will be read from the root // directory. WorkingDir param.Opt[string] `query:"workingDir,omitzero" json:"-"` // contains filtered or unexported fields }
func (V1BoxFInfoParams) URLQuery ¶
func (r V1BoxFInfoParams) URLQuery() (v url.Values, err error)
URLQuery serializes V1BoxFInfoParams's query parameters as `url.Values`.
type V1BoxFInfoResponseDirectory ¶
type V1BoxFInfoResponseDirectory struct { // Last modified time of the directory LastModified time.Time `json:"lastModified,required" format:"date-time"` // Directory metadata Mode string `json:"mode,required"` // Name of the directory Name string `json:"name,required"` // Full path to the directory Path string `json:"path,required"` // Directory type indicator // // Any of "dir". Type string `json:"type,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { LastModified respjson.Field Mode respjson.Field Name respjson.Field Path respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
File system directory representation
func (V1BoxFInfoResponseDirectory) RawJSON ¶
func (r V1BoxFInfoResponseDirectory) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFInfoResponseDirectory) UnmarshalJSON ¶
func (r *V1BoxFInfoResponseDirectory) UnmarshalJSON(data []byte) error
type V1BoxFInfoResponseFile ¶
type V1BoxFInfoResponseFile struct { // Last modified time of the file LastModified time.Time `json:"lastModified,required" format:"date-time"` // File metadata Mode string `json:"mode,required"` // Name of the file Name string `json:"name,required"` // Full path to the file Path string `json:"path,required"` // Size of the file Size string `json:"size,required"` // File type indicator // // Any of "file". Type string `json:"type,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { LastModified respjson.Field Mode respjson.Field Name respjson.Field Path respjson.Field Size respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
File system file representation
func (V1BoxFInfoResponseFile) RawJSON ¶
func (r V1BoxFInfoResponseFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFInfoResponseFile) UnmarshalJSON ¶
func (r *V1BoxFInfoResponseFile) UnmarshalJSON(data []byte) error
type V1BoxFInfoResponseUnion ¶
type V1BoxFInfoResponseUnion struct { LastModified time.Time `json:"lastModified"` Mode string `json:"mode"` Name string `json:"name"` Path string `json:"path"` // This field is from variant [V1BoxFInfoResponseFile]. Size string `json:"size"` Type string `json:"type"` JSON struct { LastModified respjson.Field Mode respjson.Field Name respjson.Field Path respjson.Field Size respjson.Field Type respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxFInfoResponseUnion contains all possible properties and values from V1BoxFInfoResponseFile, V1BoxFInfoResponseDirectory.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (V1BoxFInfoResponseUnion) AsDirectory ¶
func (u V1BoxFInfoResponseUnion) AsDirectory() (v V1BoxFInfoResponseDirectory)
func (V1BoxFInfoResponseUnion) AsFile ¶
func (u V1BoxFInfoResponseUnion) AsFile() (v V1BoxFInfoResponseFile)
func (V1BoxFInfoResponseUnion) RawJSON ¶
func (u V1BoxFInfoResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFInfoResponseUnion) UnmarshalJSON ¶
func (r *V1BoxFInfoResponseUnion) UnmarshalJSON(data []byte) error
type V1BoxFListParams ¶
type V1BoxFListParams struct { // Path to the directory Path string `query:"path,required" json:"-"` // Depth of the directory Depth param.Opt[float64] `query:"depth,omitzero" json:"-"` // Working directory. If not provided, the file will be read from the root // directory. WorkingDir param.Opt[string] `query:"workingDir,omitzero" json:"-"` // contains filtered or unexported fields }
func (V1BoxFListParams) URLQuery ¶
func (r V1BoxFListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V1BoxFListParams's query parameters as `url.Values`.
type V1BoxFListResponse ¶
type V1BoxFListResponse struct { // Array of files and directories Data []V1BoxFListResponseDataUnion `json:"data,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response containing directory listing results
func (V1BoxFListResponse) RawJSON ¶
func (r V1BoxFListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFListResponse) UnmarshalJSON ¶
func (r *V1BoxFListResponse) UnmarshalJSON(data []byte) error
type V1BoxFListResponseDataDirectory ¶
type V1BoxFListResponseDataDirectory struct { // Last modified time of the directory LastModified time.Time `json:"lastModified,required" format:"date-time"` // Directory metadata Mode string `json:"mode,required"` // Name of the directory Name string `json:"name,required"` // Full path to the directory Path string `json:"path,required"` // Directory type indicator // // Any of "dir". Type string `json:"type,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { LastModified respjson.Field Mode respjson.Field Name respjson.Field Path respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
File system directory representation
func (V1BoxFListResponseDataDirectory) RawJSON ¶
func (r V1BoxFListResponseDataDirectory) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFListResponseDataDirectory) UnmarshalJSON ¶
func (r *V1BoxFListResponseDataDirectory) UnmarshalJSON(data []byte) error
type V1BoxFListResponseDataFile ¶
type V1BoxFListResponseDataFile struct { // Last modified time of the file LastModified time.Time `json:"lastModified,required" format:"date-time"` // File metadata Mode string `json:"mode,required"` // Name of the file Name string `json:"name,required"` // Full path to the file Path string `json:"path,required"` // Size of the file Size string `json:"size,required"` // File type indicator // // Any of "file". Type string `json:"type,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { LastModified respjson.Field Mode respjson.Field Name respjson.Field Path respjson.Field Size respjson.Field Type respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
File system file representation
func (V1BoxFListResponseDataFile) RawJSON ¶
func (r V1BoxFListResponseDataFile) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFListResponseDataFile) UnmarshalJSON ¶
func (r *V1BoxFListResponseDataFile) UnmarshalJSON(data []byte) error
type V1BoxFListResponseDataUnion ¶
type V1BoxFListResponseDataUnion struct { LastModified time.Time `json:"lastModified"` Mode string `json:"mode"` Name string `json:"name"` Path string `json:"path"` // This field is from variant [V1BoxFListResponseDataFile]. Size string `json:"size"` Type string `json:"type"` JSON struct { LastModified respjson.Field Mode respjson.Field Name respjson.Field Path respjson.Field Size respjson.Field Type respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxFListResponseDataUnion contains all possible properties and values from V1BoxFListResponseDataFile, V1BoxFListResponseDataDirectory.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (V1BoxFListResponseDataUnion) AsDirectory ¶
func (u V1BoxFListResponseDataUnion) AsDirectory() (v V1BoxFListResponseDataDirectory)
func (V1BoxFListResponseDataUnion) AsFile ¶
func (u V1BoxFListResponseDataUnion) AsFile() (v V1BoxFListResponseDataFile)
func (V1BoxFListResponseDataUnion) RawJSON ¶
func (u V1BoxFListResponseDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFListResponseDataUnion) UnmarshalJSON ¶
func (r *V1BoxFListResponseDataUnion) UnmarshalJSON(data []byte) error
type V1BoxFReadParams ¶
type V1BoxFReadParams struct { // Path to the file. If the path is not start with '/', the file will be read from // the working directory. Path string `query:"path,required" json:"-"` // Working directory. If not provided, the file will be read from the root // directory. WorkingDir param.Opt[string] `query:"workingDir,omitzero" json:"-"` // contains filtered or unexported fields }
func (V1BoxFReadParams) URLQuery ¶
func (r V1BoxFReadParams) URLQuery() (v url.Values, err error)
URLQuery serializes V1BoxFReadParams's query parameters as `url.Values`.
type V1BoxFReadResponse ¶
type V1BoxFReadResponse struct { // Content of the file Content string `json:"content,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Content respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response containing file content
func (V1BoxFReadResponse) RawJSON ¶
func (r V1BoxFReadResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFReadResponse) UnmarshalJSON ¶
func (r *V1BoxFReadResponse) UnmarshalJSON(data []byte) error
type V1BoxFRemoveParams ¶
type V1BoxFRemoveParams struct { // Path to the file/directory. If the path is not start with '/', the // file/directory will be deleted from the working directory Path string `json:"path,required"` // Working directory. If not provided, the file will be read from the root // directory. WorkingDir param.Opt[string] `json:"workingDir,omitzero"` // contains filtered or unexported fields }
func (V1BoxFRemoveParams) MarshalJSON ¶
func (r V1BoxFRemoveParams) MarshalJSON() (data []byte, err error)
func (*V1BoxFRemoveParams) UnmarshalJSON ¶
func (r *V1BoxFRemoveParams) UnmarshalJSON(data []byte) error
type V1BoxFRemoveResponse ¶
type V1BoxFRemoveResponse struct { // Success message Message string `json:"message,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Message respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response after deleting file/directory
func (V1BoxFRemoveResponse) RawJSON ¶
func (r V1BoxFRemoveResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFRemoveResponse) UnmarshalJSON ¶
func (r *V1BoxFRemoveResponse) UnmarshalJSON(data []byte) error
type V1BoxFRenameParams ¶
type V1BoxFRenameParams struct { // New path for the file/directory. If the path is not start with '/', the // file/directory will be renamed to the working directory NewPath string `json:"newPath,required"` // Old path to the file/directory. If the path is not start with '/', the // file/directory will be renamed from the working directory OldPath string `json:"oldPath,required"` // Working directory. If not provided, the file will be read from the root // directory. WorkingDir param.Opt[string] `json:"workingDir,omitzero"` // contains filtered or unexported fields }
func (V1BoxFRenameParams) MarshalJSON ¶
func (r V1BoxFRenameParams) MarshalJSON() (data []byte, err error)
func (*V1BoxFRenameParams) UnmarshalJSON ¶
func (r *V1BoxFRenameParams) UnmarshalJSON(data []byte) error
type V1BoxFRenameResponse ¶
type V1BoxFRenameResponse struct { // Success message Message string `json:"message,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Message respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response after renaming file/directory
func (V1BoxFRenameResponse) RawJSON ¶
func (r V1BoxFRenameResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFRenameResponse) UnmarshalJSON ¶
func (r *V1BoxFRenameResponse) UnmarshalJSON(data []byte) error
type V1BoxFService ¶
type V1BoxFService struct {
Options []option.RequestOption
}
V1BoxFService contains methods and other services that help with interacting with the gbox-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV1BoxFService method instead.
func NewV1BoxFService ¶
func NewV1BoxFService(opts ...option.RequestOption) (r V1BoxFService)
NewV1BoxFService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*V1BoxFService) Exists ¶
func (r *V1BoxFService) Exists(ctx context.Context, id string, body V1BoxFExistsParams, opts ...option.RequestOption) (res *V1BoxFExistsResponse, err error)
Check if file exists
func (*V1BoxFService) Info ¶
func (r *V1BoxFService) Info(ctx context.Context, id string, query V1BoxFInfoParams, opts ...option.RequestOption) (res *V1BoxFInfoResponseUnion, err error)
Get file/directory
func (*V1BoxFService) List ¶
func (r *V1BoxFService) List(ctx context.Context, id string, query V1BoxFListParams, opts ...option.RequestOption) (res *V1BoxFListResponse, err error)
List box files
func (*V1BoxFService) Read ¶
func (r *V1BoxFService) Read(ctx context.Context, id string, query V1BoxFReadParams, opts ...option.RequestOption) (res *V1BoxFReadResponse, err error)
Read box file
func (*V1BoxFService) Remove ¶
func (r *V1BoxFService) Remove(ctx context.Context, id string, body V1BoxFRemoveParams, opts ...option.RequestOption) (res *V1BoxFRemoveResponse, err error)
Delete box file/directory
func (*V1BoxFService) Rename ¶
func (r *V1BoxFService) Rename(ctx context.Context, id string, body V1BoxFRenameParams, opts ...option.RequestOption) (res *V1BoxFRenameResponse, err error)
Rename box file
func (*V1BoxFService) Write ¶
func (r *V1BoxFService) Write(ctx context.Context, id string, body V1BoxFWriteParams, opts ...option.RequestOption) (res *V1BoxFWriteResponse, err error)
Creates or overwrites a file. Creates necessary directories in the path if they don't exist. if the path is a directory, the write will be failed.
type V1BoxFWriteParams ¶
type V1BoxFWriteParams struct { // Content of the file Content string `json:"content,required"` // Path to the file. If the path is not start with '/', the file will be written to // the working directory Path string `json:"path,required"` // Working directory. If not provided, the file will be read from the root // directory. WorkingDir param.Opt[string] `json:"workingDir,omitzero"` // contains filtered or unexported fields }
func (V1BoxFWriteParams) MarshalJSON ¶
func (r V1BoxFWriteParams) MarshalJSON() (data []byte, err error)
func (*V1BoxFWriteParams) UnmarshalJSON ¶
func (r *V1BoxFWriteParams) UnmarshalJSON(data []byte) error
type V1BoxFWriteResponse ¶
type V1BoxFWriteResponse struct { // Success message Message string `json:"message,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Message respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response after writing file content
func (V1BoxFWriteResponse) RawJSON ¶
func (r V1BoxFWriteResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxFWriteResponse) UnmarshalJSON ¶
func (r *V1BoxFWriteResponse) UnmarshalJSON(data []byte) error
type V1BoxGetResponseUnion ¶
type V1BoxGetResponseUnion struct { ID string `json:"id"` // This field is a union of [LinuxBoxConfig], [AndroidBoxConfig] Config V1BoxGetResponseUnionConfig `json:"config"` CreatedAt time.Time `json:"createdAt"` ExpiresAt time.Time `json:"expiresAt"` Status string `json:"status"` Type string `json:"type"` UpdatedAt time.Time `json:"updatedAt"` JSON struct { ID respjson.Field Config respjson.Field CreatedAt respjson.Field ExpiresAt respjson.Field Status respjson.Field Type respjson.Field UpdatedAt respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxGetResponseUnion contains all possible properties and values from LinuxBox, AndroidBox.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (V1BoxGetResponseUnion) AsAndroidBox ¶
func (u V1BoxGetResponseUnion) AsAndroidBox() (v AndroidBox)
func (V1BoxGetResponseUnion) AsLinuxBox ¶
func (u V1BoxGetResponseUnion) AsLinuxBox() (v LinuxBox)
func (V1BoxGetResponseUnion) RawJSON ¶
func (u V1BoxGetResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxGetResponseUnion) UnmarshalJSON ¶
func (r *V1BoxGetResponseUnion) UnmarshalJSON(data []byte) error
type V1BoxGetResponseUnionConfig ¶
type V1BoxGetResponseUnionConfig struct { CPU float64 `json:"cpu"` Envs any `json:"envs"` Labels any `json:"labels"` Memory float64 `json:"memory"` // This field is a union of [LinuxBoxConfigOs], [AndroidBoxConfigOs] Os V1BoxGetResponseUnionConfigOs `json:"os"` // This field is a union of [LinuxBoxConfigResolution], // [AndroidBoxConfigResolution] Resolution V1BoxGetResponseUnionConfigResolution `json:"resolution"` Storage float64 `json:"storage"` // This field is a union of [LinuxBoxConfigBrowser], [AndroidBoxConfigBrowser] Browser V1BoxGetResponseUnionConfigBrowser `json:"browser"` WorkingDir string `json:"workingDir"` // This field is from variant [AndroidBoxConfig]. DeviceType string `json:"deviceType"` JSON struct { CPU respjson.Field Envs respjson.Field Labels respjson.Field Memory respjson.Field Os respjson.Field Resolution respjson.Field Storage respjson.Field Browser respjson.Field WorkingDir respjson.Field DeviceType respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxGetResponseUnionConfig is an implicit subunion of V1BoxGetResponseUnion. V1BoxGetResponseUnionConfig provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxGetResponseUnion.
func (*V1BoxGetResponseUnionConfig) UnmarshalJSON ¶
func (r *V1BoxGetResponseUnionConfig) UnmarshalJSON(data []byte) error
type V1BoxGetResponseUnionConfigBrowser ¶
type V1BoxGetResponseUnionConfigBrowser struct { Type string `json:"type"` Version string `json:"version"` JSON struct { Type respjson.Field Version respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxGetResponseUnionConfigBrowser is an implicit subunion of V1BoxGetResponseUnion. V1BoxGetResponseUnionConfigBrowser provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxGetResponseUnion.
func (*V1BoxGetResponseUnionConfigBrowser) UnmarshalJSON ¶
func (r *V1BoxGetResponseUnionConfigBrowser) UnmarshalJSON(data []byte) error
type V1BoxGetResponseUnionConfigOs ¶
type V1BoxGetResponseUnionConfigOs struct { Version string `json:"version"` JSON struct { Version respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxGetResponseUnionConfigOs is an implicit subunion of V1BoxGetResponseUnion. V1BoxGetResponseUnionConfigOs provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxGetResponseUnion.
func (*V1BoxGetResponseUnionConfigOs) UnmarshalJSON ¶
func (r *V1BoxGetResponseUnionConfigOs) UnmarshalJSON(data []byte) error
type V1BoxGetResponseUnionConfigResolution ¶
type V1BoxGetResponseUnionConfigResolution struct { Height float64 `json:"height"` Width float64 `json:"width"` JSON struct { Height respjson.Field Width respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxGetResponseUnionConfigResolution is an implicit subunion of V1BoxGetResponseUnion. V1BoxGetResponseUnionConfigResolution provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxGetResponseUnion.
func (*V1BoxGetResponseUnionConfigResolution) UnmarshalJSON ¶
func (r *V1BoxGetResponseUnionConfigResolution) UnmarshalJSON(data []byte) error
type V1BoxListParams ¶
type V1BoxListParams struct { // Page number Page param.Opt[int64] `query:"page,omitzero" json:"-"` // Page size PageSize param.Opt[int64] `query:"pageSize,omitzero" json:"-"` // Filter boxes by their labels, default is all Labels any `query:"labels,omitzero" json:"-"` // Filter boxes by their current status (pending, running, stopped, error, // terminated, all). Must be an array of statuses. Use 'all' to get boxes with any // status. // // Any of "all", "pending", "running", "stopped", "error", "terminated". Status []string `query:"status,omitzero" json:"-"` // Filter boxes by their type (linux, android, all). Must be an array of types. Use // 'all' to get boxes of any type. // // Any of "all", "linux", "android". Type []string `query:"type,omitzero" json:"-"` // contains filtered or unexported fields }
func (V1BoxListParams) URLQuery ¶
func (r V1BoxListParams) URLQuery() (v url.Values, err error)
URLQuery serializes V1BoxListParams's query parameters as `url.Values`.
type V1BoxListResponse ¶
type V1BoxListResponse struct { // A box instance that can be either Linux or Android type Data []V1BoxListResponseDataUnion `json:"data,required"` // Page number Page int64 `json:"page,required"` // Page size PageSize int64 `json:"pageSize,required"` // Total number of items Total int64 `json:"total,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { Data respjson.Field Page respjson.Field PageSize respjson.Field Total respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Response containing paginated list of box instances
func (V1BoxListResponse) RawJSON ¶
func (r V1BoxListResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxListResponse) UnmarshalJSON ¶
func (r *V1BoxListResponse) UnmarshalJSON(data []byte) error
type V1BoxListResponseDataUnion ¶
type V1BoxListResponseDataUnion struct { ID string `json:"id"` // This field is a union of [LinuxBoxConfig], [AndroidBoxConfig] Config V1BoxListResponseDataUnionConfig `json:"config"` CreatedAt time.Time `json:"createdAt"` ExpiresAt time.Time `json:"expiresAt"` Status string `json:"status"` Type string `json:"type"` UpdatedAt time.Time `json:"updatedAt"` JSON struct { ID respjson.Field Config respjson.Field CreatedAt respjson.Field ExpiresAt respjson.Field Status respjson.Field Type respjson.Field UpdatedAt respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxListResponseDataUnion contains all possible properties and values from LinuxBox, AndroidBox.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (V1BoxListResponseDataUnion) AsAndroidBox ¶
func (u V1BoxListResponseDataUnion) AsAndroidBox() (v AndroidBox)
func (V1BoxListResponseDataUnion) AsLinuxBox ¶
func (u V1BoxListResponseDataUnion) AsLinuxBox() (v LinuxBox)
func (V1BoxListResponseDataUnion) RawJSON ¶
func (u V1BoxListResponseDataUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxListResponseDataUnion) UnmarshalJSON ¶
func (r *V1BoxListResponseDataUnion) UnmarshalJSON(data []byte) error
type V1BoxListResponseDataUnionConfig ¶
type V1BoxListResponseDataUnionConfig struct { CPU float64 `json:"cpu"` Envs any `json:"envs"` Labels any `json:"labels"` Memory float64 `json:"memory"` // This field is a union of [LinuxBoxConfigOs], [AndroidBoxConfigOs] Os V1BoxListResponseDataUnionConfigOs `json:"os"` // This field is a union of [LinuxBoxConfigResolution], // [AndroidBoxConfigResolution] Resolution V1BoxListResponseDataUnionConfigResolution `json:"resolution"` Storage float64 `json:"storage"` // This field is a union of [LinuxBoxConfigBrowser], [AndroidBoxConfigBrowser] Browser V1BoxListResponseDataUnionConfigBrowser `json:"browser"` WorkingDir string `json:"workingDir"` // This field is from variant [AndroidBoxConfig]. DeviceType string `json:"deviceType"` JSON struct { CPU respjson.Field Envs respjson.Field Labels respjson.Field Memory respjson.Field Os respjson.Field Resolution respjson.Field Storage respjson.Field Browser respjson.Field WorkingDir respjson.Field DeviceType respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxListResponseDataUnionConfig is an implicit subunion of V1BoxListResponseDataUnion. V1BoxListResponseDataUnionConfig provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxListResponseDataUnion.
func (*V1BoxListResponseDataUnionConfig) UnmarshalJSON ¶
func (r *V1BoxListResponseDataUnionConfig) UnmarshalJSON(data []byte) error
type V1BoxListResponseDataUnionConfigBrowser ¶
type V1BoxListResponseDataUnionConfigBrowser struct { Type string `json:"type"` Version string `json:"version"` JSON struct { Type respjson.Field Version respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxListResponseDataUnionConfigBrowser is an implicit subunion of V1BoxListResponseDataUnion. V1BoxListResponseDataUnionConfigBrowser provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxListResponseDataUnion.
func (*V1BoxListResponseDataUnionConfigBrowser) UnmarshalJSON ¶
func (r *V1BoxListResponseDataUnionConfigBrowser) UnmarshalJSON(data []byte) error
type V1BoxListResponseDataUnionConfigOs ¶
type V1BoxListResponseDataUnionConfigOs struct { Version string `json:"version"` JSON struct { Version respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxListResponseDataUnionConfigOs is an implicit subunion of V1BoxListResponseDataUnion. V1BoxListResponseDataUnionConfigOs provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxListResponseDataUnion.
func (*V1BoxListResponseDataUnionConfigOs) UnmarshalJSON ¶
func (r *V1BoxListResponseDataUnionConfigOs) UnmarshalJSON(data []byte) error
type V1BoxListResponseDataUnionConfigResolution ¶
type V1BoxListResponseDataUnionConfigResolution struct { Height float64 `json:"height"` Width float64 `json:"width"` JSON struct { Height respjson.Field Width respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxListResponseDataUnionConfigResolution is an implicit subunion of V1BoxListResponseDataUnion. V1BoxListResponseDataUnionConfigResolution provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxListResponseDataUnion.
func (*V1BoxListResponseDataUnionConfigResolution) UnmarshalJSON ¶
func (r *V1BoxListResponseDataUnionConfigResolution) UnmarshalJSON(data []byte) error
type V1BoxLiveViewURLResponse ¶
type V1BoxLiveViewURLResponse struct { // Live view url URL string `json:"url,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { URL respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Live view configuration
func (V1BoxLiveViewURLResponse) RawJSON ¶
func (r V1BoxLiveViewURLResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxLiveViewURLResponse) UnmarshalJSON ¶
func (r *V1BoxLiveViewURLResponse) UnmarshalJSON(data []byte) error
type V1BoxNewAndroidParams ¶
type V1BoxNewAndroidParams struct { // Request body for creating a new Android box instance CreateAndroidBox CreateAndroidBoxParam // contains filtered or unexported fields }
func (V1BoxNewAndroidParams) MarshalJSON ¶
func (r V1BoxNewAndroidParams) MarshalJSON() (data []byte, err error)
func (*V1BoxNewAndroidParams) UnmarshalJSON ¶
func (r *V1BoxNewAndroidParams) UnmarshalJSON(data []byte) error
type V1BoxNewLinuxParams ¶
type V1BoxNewLinuxParams struct { // Request body for creating a new Linux box instance CreateLinuxBox CreateLinuxBoxParam // contains filtered or unexported fields }
func (V1BoxNewLinuxParams) MarshalJSON ¶
func (r V1BoxNewLinuxParams) MarshalJSON() (data []byte, err error)
func (*V1BoxNewLinuxParams) UnmarshalJSON ¶
func (r *V1BoxNewLinuxParams) UnmarshalJSON(data []byte) error
type V1BoxRunCodeParams ¶
type V1BoxRunCodeParams struct { // The code to run Code string `json:"code,required"` // The timeout of the code execution. e.g. "30s" or "1m" or "1h". If the code // execution times out, the exit code will be 124. Timeout param.Opt[string] `json:"timeout,omitzero"` // The working directory of the code. WorkingDir param.Opt[string] `json:"workingDir,omitzero"` // The arguments to run the code. For example, if you want to run "python index.py // --help", you should pass ["--help"] as arguments. Argv []string `json:"argv,omitzero"` // The environment variables to run the code Envs any `json:"envs,omitzero"` // The language of the code. // // Any of "bash", "python3", "typescript". Language V1BoxRunCodeParamsLanguage `json:"language,omitzero"` // contains filtered or unexported fields }
func (V1BoxRunCodeParams) MarshalJSON ¶
func (r V1BoxRunCodeParams) MarshalJSON() (data []byte, err error)
func (*V1BoxRunCodeParams) UnmarshalJSON ¶
func (r *V1BoxRunCodeParams) UnmarshalJSON(data []byte) error
type V1BoxRunCodeParamsLanguage ¶
type V1BoxRunCodeParamsLanguage string
The language of the code.
const ( V1BoxRunCodeParamsLanguageBash V1BoxRunCodeParamsLanguage = "bash" V1BoxRunCodeParamsLanguagePython3 V1BoxRunCodeParamsLanguage = "python3" V1BoxRunCodeParamsLanguageTypescript V1BoxRunCodeParamsLanguage = "typescript" )
type V1BoxRunCodeResponse ¶
type V1BoxRunCodeResponse struct { // The exit code of the code ExitCode float64 `json:"exitCode,required"` // The stderr of the code Stderr string `json:"stderr,required"` // The stdout of the code Stdout string `json:"stdout,required"` // JSON contains metadata for fields, check presence with [respjson.Field.Valid]. JSON struct { ExitCode respjson.Field Stderr respjson.Field Stdout respjson.Field ExtraFields map[string]respjson.Field // contains filtered or unexported fields } `json:"-"` }
Result of code execution
func (V1BoxRunCodeResponse) RawJSON ¶
func (r V1BoxRunCodeResponse) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxRunCodeResponse) UnmarshalJSON ¶
func (r *V1BoxRunCodeResponse) UnmarshalJSON(data []byte) error
type V1BoxService ¶
type V1BoxService struct { Options []option.RequestOption Actions V1BoxActionService Fs V1BoxFService Browser V1BoxBrowserService Android V1BoxAndroidService }
V1BoxService contains methods and other services that help with interacting with the gbox-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV1BoxService method instead.
func NewV1BoxService ¶
func NewV1BoxService(opts ...option.RequestOption) (r V1BoxService)
NewV1BoxService generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
func (*V1BoxService) ExecuteCommands ¶
func (r *V1BoxService) ExecuteCommands(ctx context.Context, id string, body V1BoxExecuteCommandsParams, opts ...option.RequestOption) (res *V1BoxExecuteCommandsResponse, err error)
Exec command
func (*V1BoxService) Get ¶
func (r *V1BoxService) Get(ctx context.Context, id string, opts ...option.RequestOption) (res *V1BoxGetResponseUnion, err error)
Get box
func (*V1BoxService) List ¶
func (r *V1BoxService) List(ctx context.Context, query V1BoxListParams, opts ...option.RequestOption) (res *V1BoxListResponse, err error)
List box
func (*V1BoxService) LiveViewURL ¶
func (r *V1BoxService) LiveViewURL(ctx context.Context, id string, opts ...option.RequestOption) (res *V1BoxLiveViewURLResponse, err error)
Get live view url
func (*V1BoxService) NewAndroid ¶
func (r *V1BoxService) NewAndroid(ctx context.Context, body V1BoxNewAndroidParams, opts ...option.RequestOption) (res *AndroidBox, err error)
Create android box
func (*V1BoxService) NewLinux ¶
func (r *V1BoxService) NewLinux(ctx context.Context, body V1BoxNewLinuxParams, opts ...option.RequestOption) (res *LinuxBox, err error)
Create linux box
func (*V1BoxService) RunCode ¶
func (r *V1BoxService) RunCode(ctx context.Context, id string, body V1BoxRunCodeParams, opts ...option.RequestOption) (res *V1BoxRunCodeResponse, err error)
Run code on the box
func (*V1BoxService) Start ¶
func (r *V1BoxService) Start(ctx context.Context, id string, body V1BoxStartParams, opts ...option.RequestOption) (res *V1BoxStartResponseUnion, err error)
Start box
func (*V1BoxService) Stop ¶
func (r *V1BoxService) Stop(ctx context.Context, id string, body V1BoxStopParams, opts ...option.RequestOption) (res *V1BoxStopResponseUnion, err error)
Stop box
func (*V1BoxService) Terminate ¶
func (r *V1BoxService) Terminate(ctx context.Context, id string, body V1BoxTerminateParams, opts ...option.RequestOption) (err error)
Terminate box
type V1BoxStartParams ¶
type V1BoxStartParams struct { // Wait for the box operation to be completed, default is true Wait param.Opt[bool] `json:"wait,omitzero"` // contains filtered or unexported fields }
func (V1BoxStartParams) MarshalJSON ¶
func (r V1BoxStartParams) MarshalJSON() (data []byte, err error)
func (*V1BoxStartParams) UnmarshalJSON ¶
func (r *V1BoxStartParams) UnmarshalJSON(data []byte) error
type V1BoxStartResponseUnion ¶
type V1BoxStartResponseUnion struct { ID string `json:"id"` // This field is a union of [LinuxBoxConfig], [AndroidBoxConfig] Config V1BoxStartResponseUnionConfig `json:"config"` CreatedAt time.Time `json:"createdAt"` ExpiresAt time.Time `json:"expiresAt"` Status string `json:"status"` Type string `json:"type"` UpdatedAt time.Time `json:"updatedAt"` JSON struct { ID respjson.Field Config respjson.Field CreatedAt respjson.Field ExpiresAt respjson.Field Status respjson.Field Type respjson.Field UpdatedAt respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStartResponseUnion contains all possible properties and values from LinuxBox, AndroidBox.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (V1BoxStartResponseUnion) AsAndroidBox ¶
func (u V1BoxStartResponseUnion) AsAndroidBox() (v AndroidBox)
func (V1BoxStartResponseUnion) AsLinuxBox ¶
func (u V1BoxStartResponseUnion) AsLinuxBox() (v LinuxBox)
func (V1BoxStartResponseUnion) RawJSON ¶
func (u V1BoxStartResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxStartResponseUnion) UnmarshalJSON ¶
func (r *V1BoxStartResponseUnion) UnmarshalJSON(data []byte) error
type V1BoxStartResponseUnionConfig ¶
type V1BoxStartResponseUnionConfig struct { CPU float64 `json:"cpu"` Envs any `json:"envs"` Labels any `json:"labels"` Memory float64 `json:"memory"` // This field is a union of [LinuxBoxConfigOs], [AndroidBoxConfigOs] Os V1BoxStartResponseUnionConfigOs `json:"os"` // This field is a union of [LinuxBoxConfigResolution], // [AndroidBoxConfigResolution] Resolution V1BoxStartResponseUnionConfigResolution `json:"resolution"` Storage float64 `json:"storage"` // This field is a union of [LinuxBoxConfigBrowser], [AndroidBoxConfigBrowser] Browser V1BoxStartResponseUnionConfigBrowser `json:"browser"` WorkingDir string `json:"workingDir"` // This field is from variant [AndroidBoxConfig]. DeviceType string `json:"deviceType"` JSON struct { CPU respjson.Field Envs respjson.Field Labels respjson.Field Memory respjson.Field Os respjson.Field Resolution respjson.Field Storage respjson.Field Browser respjson.Field WorkingDir respjson.Field DeviceType respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStartResponseUnionConfig is an implicit subunion of V1BoxStartResponseUnion. V1BoxStartResponseUnionConfig provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxStartResponseUnion.
func (*V1BoxStartResponseUnionConfig) UnmarshalJSON ¶
func (r *V1BoxStartResponseUnionConfig) UnmarshalJSON(data []byte) error
type V1BoxStartResponseUnionConfigBrowser ¶
type V1BoxStartResponseUnionConfigBrowser struct { Type string `json:"type"` Version string `json:"version"` JSON struct { Type respjson.Field Version respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStartResponseUnionConfigBrowser is an implicit subunion of V1BoxStartResponseUnion. V1BoxStartResponseUnionConfigBrowser provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxStartResponseUnion.
func (*V1BoxStartResponseUnionConfigBrowser) UnmarshalJSON ¶
func (r *V1BoxStartResponseUnionConfigBrowser) UnmarshalJSON(data []byte) error
type V1BoxStartResponseUnionConfigOs ¶
type V1BoxStartResponseUnionConfigOs struct { Version string `json:"version"` JSON struct { Version respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStartResponseUnionConfigOs is an implicit subunion of V1BoxStartResponseUnion. V1BoxStartResponseUnionConfigOs provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxStartResponseUnion.
func (*V1BoxStartResponseUnionConfigOs) UnmarshalJSON ¶
func (r *V1BoxStartResponseUnionConfigOs) UnmarshalJSON(data []byte) error
type V1BoxStartResponseUnionConfigResolution ¶
type V1BoxStartResponseUnionConfigResolution struct { Height float64 `json:"height"` Width float64 `json:"width"` JSON struct { Height respjson.Field Width respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStartResponseUnionConfigResolution is an implicit subunion of V1BoxStartResponseUnion. V1BoxStartResponseUnionConfigResolution provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxStartResponseUnion.
func (*V1BoxStartResponseUnionConfigResolution) UnmarshalJSON ¶
func (r *V1BoxStartResponseUnionConfigResolution) UnmarshalJSON(data []byte) error
type V1BoxStopParams ¶
type V1BoxStopParams struct { // Wait for the box operation to be completed, default is true Wait param.Opt[bool] `json:"wait,omitzero"` // contains filtered or unexported fields }
func (V1BoxStopParams) MarshalJSON ¶
func (r V1BoxStopParams) MarshalJSON() (data []byte, err error)
func (*V1BoxStopParams) UnmarshalJSON ¶
func (r *V1BoxStopParams) UnmarshalJSON(data []byte) error
type V1BoxStopResponseUnion ¶
type V1BoxStopResponseUnion struct { ID string `json:"id"` // This field is a union of [LinuxBoxConfig], [AndroidBoxConfig] Config V1BoxStopResponseUnionConfig `json:"config"` CreatedAt time.Time `json:"createdAt"` ExpiresAt time.Time `json:"expiresAt"` Status string `json:"status"` Type string `json:"type"` UpdatedAt time.Time `json:"updatedAt"` JSON struct { ID respjson.Field Config respjson.Field CreatedAt respjson.Field ExpiresAt respjson.Field Status respjson.Field Type respjson.Field UpdatedAt respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStopResponseUnion contains all possible properties and values from LinuxBox, AndroidBox.
Use the methods beginning with 'As' to cast the union to one of its variants.
func (V1BoxStopResponseUnion) AsAndroidBox ¶
func (u V1BoxStopResponseUnion) AsAndroidBox() (v AndroidBox)
func (V1BoxStopResponseUnion) AsLinuxBox ¶
func (u V1BoxStopResponseUnion) AsLinuxBox() (v LinuxBox)
func (V1BoxStopResponseUnion) RawJSON ¶
func (u V1BoxStopResponseUnion) RawJSON() string
Returns the unmodified JSON received from the API
func (*V1BoxStopResponseUnion) UnmarshalJSON ¶
func (r *V1BoxStopResponseUnion) UnmarshalJSON(data []byte) error
type V1BoxStopResponseUnionConfig ¶
type V1BoxStopResponseUnionConfig struct { CPU float64 `json:"cpu"` Envs any `json:"envs"` Labels any `json:"labels"` Memory float64 `json:"memory"` // This field is a union of [LinuxBoxConfigOs], [AndroidBoxConfigOs] Os V1BoxStopResponseUnionConfigOs `json:"os"` // This field is a union of [LinuxBoxConfigResolution], // [AndroidBoxConfigResolution] Resolution V1BoxStopResponseUnionConfigResolution `json:"resolution"` Storage float64 `json:"storage"` // This field is a union of [LinuxBoxConfigBrowser], [AndroidBoxConfigBrowser] Browser V1BoxStopResponseUnionConfigBrowser `json:"browser"` WorkingDir string `json:"workingDir"` // This field is from variant [AndroidBoxConfig]. DeviceType string `json:"deviceType"` JSON struct { CPU respjson.Field Envs respjson.Field Labels respjson.Field Memory respjson.Field Os respjson.Field Resolution respjson.Field Storage respjson.Field Browser respjson.Field WorkingDir respjson.Field DeviceType respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStopResponseUnionConfig is an implicit subunion of V1BoxStopResponseUnion. V1BoxStopResponseUnionConfig provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxStopResponseUnion.
func (*V1BoxStopResponseUnionConfig) UnmarshalJSON ¶
func (r *V1BoxStopResponseUnionConfig) UnmarshalJSON(data []byte) error
type V1BoxStopResponseUnionConfigBrowser ¶
type V1BoxStopResponseUnionConfigBrowser struct { Type string `json:"type"` Version string `json:"version"` JSON struct { Type respjson.Field Version respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStopResponseUnionConfigBrowser is an implicit subunion of V1BoxStopResponseUnion. V1BoxStopResponseUnionConfigBrowser provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxStopResponseUnion.
func (*V1BoxStopResponseUnionConfigBrowser) UnmarshalJSON ¶
func (r *V1BoxStopResponseUnionConfigBrowser) UnmarshalJSON(data []byte) error
type V1BoxStopResponseUnionConfigOs ¶
type V1BoxStopResponseUnionConfigOs struct { Version string `json:"version"` JSON struct { Version respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStopResponseUnionConfigOs is an implicit subunion of V1BoxStopResponseUnion. V1BoxStopResponseUnionConfigOs provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxStopResponseUnion.
func (*V1BoxStopResponseUnionConfigOs) UnmarshalJSON ¶
func (r *V1BoxStopResponseUnionConfigOs) UnmarshalJSON(data []byte) error
type V1BoxStopResponseUnionConfigResolution ¶
type V1BoxStopResponseUnionConfigResolution struct { Height float64 `json:"height"` Width float64 `json:"width"` JSON struct { Height respjson.Field Width respjson.Field // contains filtered or unexported fields } `json:"-"` }
V1BoxStopResponseUnionConfigResolution is an implicit subunion of V1BoxStopResponseUnion. V1BoxStopResponseUnionConfigResolution provides convenient access to the sub-properties of the union.
For type safety it is recommended to directly use a variant of the V1BoxStopResponseUnion.
func (*V1BoxStopResponseUnionConfigResolution) UnmarshalJSON ¶
func (r *V1BoxStopResponseUnionConfigResolution) UnmarshalJSON(data []byte) error
type V1BoxTerminateParams ¶
type V1BoxTerminateParams struct { // Wait for the box operation to be completed, default is true Wait param.Opt[bool] `json:"wait,omitzero"` // contains filtered or unexported fields }
func (V1BoxTerminateParams) MarshalJSON ¶
func (r V1BoxTerminateParams) MarshalJSON() (data []byte, err error)
func (*V1BoxTerminateParams) UnmarshalJSON ¶
func (r *V1BoxTerminateParams) UnmarshalJSON(data []byte) error
type V1Service ¶
type V1Service struct { Options []option.RequestOption Boxes V1BoxService }
V1Service contains methods and other services that help with interacting with the gbox-client API.
Note, unlike clients, this service does not read variables from the environment automatically. You should not instantiate this service directly, and instead use the NewV1Service method instead.
func NewV1Service ¶
func NewV1Service(opts ...option.RequestOption) (r V1Service)
NewV1Service generates a new service that applies the given options to each request. These options are applied after the parent client's options (if there is one), and before any request-specific options.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
encoding/json
Package json implements encoding and decoding of JSON as defined in RFC 7159.
|
Package json implements encoding and decoding of JSON as defined in RFC 7159. |
encoding/json/shims
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package.
|
This package provides shims over Go 1.2{2,3} APIs which are missing from Go 1.21, and used by the Go 1.24 encoding/json package. |
packages
|
|
shared
|
|