gboxsdk

package module
v0.1.0-alpha.3 Latest Latest
Warning

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

Go to latest
Published: Jun 19, 2025 License: Apache-2.0 Imports: 19 Imported by: 0

README

Gbox Client Go API Library

Go Reference

The Gbox Client Go library provides convenient access to the Gbox Client REST API from applications written in Go.

It is generated with Stainless.

Installation

import (
	"github.com/babelcloud/gbox-sdk-go" // imported as gboxsdk
)

Or to pin the version:

go get -u 'github.com/babelcloud/gbox-sdk-go@v0.1.0-alpha.3'

Requirements

This library requires Go 1.18+.

Usage

The full API of this library can be found in api.md.

package main

import (
	"context"
	"fmt"

	"github.com/babelcloud/gbox-sdk-go"
	"github.com/babelcloud/gbox-sdk-go/option"
)

func main() {
	client := gboxsdk.NewClient(
		option.WithAPIKey("My API Key"),  // defaults to os.LookupEnv("GBOX_API_KEY")
		option.WithEnvironmentSelfHost(), // defaults to option.WithEnvironmentProduction()
	)
	androidBox, err := client.V1.Boxes.NewAndroid(context.TODO(), gboxsdk.V1BoxNewAndroidParams{
		CreateAndroidBox: gboxsdk.CreateAndroidBoxParam{},

	})
	if err != nil {
		panic(err.Error())
	}
	fmt.Printf("%+v\n", androidBox.ID)
}

Request fields

The gboxsdk library uses the omitzero semantics from the Go 1.24+ encoding/json release for request fields.

Required primitive fields (int64, string, etc.) feature the tag `json:"...,required"`. These fields are always serialized, even their zero values.

Optional primitive types are wrapped in a param.Opt[T]. These fields can be set with the provided constructors, gboxsdk.String(string), gboxsdk.Int(int64), etc.

Any param.Opt[T], map, slice, struct or string enum uses the tag `json:"...,omitzero"`. Its zero value is considered omitted.

The param.IsOmitted(any) function can confirm the presence of any omitzero field.

p := gboxsdk.ExampleParams{
	ID:   "id_xxx",              // required property
	Name: gboxsdk.String("..."), // optional property

	Point: gboxsdk.Point{
		X: 0,              // required field will serialize as 0
		Y: gboxsdk.Int(1), // optional field will serialize as 1
		// ... omitted non-required fields will not be serialized
	},

	Origin: gboxsdk.Origin{}, // the zero value of [Origin] is considered omitted
}

To send null instead of a param.Opt[T], use param.Null[T](). To send null instead of a struct T, use param.NullStruct[T]().

p.Name = param.Null[string]()       // 'null' instead of string
p.Point = param.NullStruct[Point]() // 'null' instead of struct

param.IsNull(p.Name)  // true
param.IsNull(p.Point) // true

Request structs contain a .SetExtraFields(map[string]any) method which can send non-conforming fields in the request body. Extra fields overwrite any struct fields with a matching key. For security reasons, only use SetExtraFields with trusted data.

To send a custom value instead of a struct, use param.Override[T](value).

// In cases where the API specifies a given type,
// but you want to send something else, use [SetExtraFields]:
p.SetExtraFields(map[string]any{
	"x": 0.01, // send "x" as a float instead of int
})

// Send a number instead of an object
custom := param.Override[gboxsdk.FooParams](12)
Request unions

Unions are represented as a struct with fields prefixed by "Of" for each of it's variants, only one field can be non-zero. The non-zero field will be serialized.

Sub-properties of the union can be accessed via methods on the union struct. These methods return a mutable pointer to the underlying data, if present.

// Only one field can be non-zero, use param.IsOmitted() to check if a field is set
type AnimalUnionParam struct {
	OfCat *Cat `json:",omitzero,inline`
	OfDog *Dog `json:",omitzero,inline`
}

animal := AnimalUnionParam{
	OfCat: &Cat{
		Name: "Whiskers",
		Owner: PersonParam{
			Address: AddressParam{Street: "3333 Coyote Hill Rd", Zip: 0},
		},
	},
}

// Mutating a field
if address := animal.GetOwner().GetAddress(); address != nil {
	address.ZipCode = 94304
}
Response objects

All fields in response structs are ordinary value types (not pointers or wrappers). Response structs also include a special JSON field containing metadata about each property.

type Animal struct {
	Name   string `json:"name,nullable"`
	Owners int    `json:"owners"`
	Age    int    `json:"age"`
	JSON   struct {
		Name        respjson.Field
		Owner       respjson.Field
		Age         respjson.Field
		ExtraFields map[string]respjson.Field
	} `json:"-"`
}

To handle optional data, use the .Valid() method on the JSON field. .Valid() returns true if a field is not null, not present, or couldn't be marshaled.

If .Valid() is false, the corresponding field will simply be its zero value.

raw := `{"owners": 1, "name": null}`

var res Animal
json.Unmarshal([]byte(raw), &res)

// Accessing regular fields

res.Owners // 1
res.Name   // ""
res.Age    // 0

// Optional field checks

res.JSON.Owners.Valid() // true
res.JSON.Name.Valid()   // false
res.JSON.Age.Valid()    // false

// Raw JSON values

res.JSON.Owners.Raw()                  // "1"
res.JSON.Name.Raw() == "null"          // true
res.JSON.Name.Raw() == respjson.Null   // true
res.JSON.Age.Raw() == ""               // true
res.JSON.Age.Raw() == respjson.Omitted // true

These .JSON structs also include an ExtraFields map containing any properties in the json response that were not specified in the struct. This can be useful for API features not yet present in the SDK.

body := res.JSON.ExtraFields["my_unexpected_field"].Raw()
Response Unions

In responses, unions are represented by a flattened struct containing all possible fields from each of the object variants. To convert it to a variant use the .AsFooVariant() method or the .AsAny() method if present.

If a response value union contains primitive values, primitive fields will be alongside the properties but prefixed with Of and feature the tag json:"...,inline".

type AnimalUnion struct {
	// From variants [Dog], [Cat]
	Owner Person `json:"owner"`
	// From variant [Dog]
	DogBreed string `json:"dog_breed"`
	// From variant [Cat]
	CatBreed string `json:"cat_breed"`
	// ...

	JSON struct {
		Owner respjson.Field
		// ...
	} `json:"-"`
}

// If animal variant
if animal.Owner.Address.ZipCode == "" {
	panic("missing zip code")
}

// Switch on the variant
switch variant := animal.AsAny().(type) {
case Dog:
case Cat:
default:
	panic("unexpected type")
}
RequestOptions

This library uses the functional options pattern. Functions defined in the option package return a RequestOption, which is a closure that mutates a RequestConfig. These options can be supplied to the client or at individual requests. For example:

client := gboxsdk.NewClient(
	// Adds a header to every request made by the client
	option.WithHeader("X-Some-Header", "custom_header_info"),
)

client.V1.Boxes.NewAndroid(context.TODO(), ...,
	// Override the header
	option.WithHeader("X-Some-Header", "some_other_custom_header_info"),
	// Add an undocumented field to the request body, using sjson syntax
	option.WithJSONSet("some.json.path", map[string]string{"my": "object"}),
)

The request option option.WithDebugLog(nil) may be helpful while debugging.

See the full list of request options.

Pagination

This library provides some conveniences for working with paginated list endpoints.

You can use .ListAutoPaging() methods to iterate through items across all pages:

Or you can use simple .List() methods to fetch a single page and receive a standard response object with additional helper methods like .GetNextPage(), e.g.:

Errors

When the API returns a non-success status code, we return an error with type *gboxsdk.Error. This contains the StatusCode, *http.Request, and *http.Response values of the request, as well as the JSON of the error body (much like other response objects in the SDK).

To handle errors, we recommend that you use the errors.As pattern:

_, err := client.V1.Boxes.NewAndroid(context.TODO(), gboxsdk.V1BoxNewAndroidParams{
	CreateAndroidBox: gboxsdk.CreateAndroidBoxParam{},
})
if err != nil {
	var apierr *gboxsdk.Error
	if errors.As(err, &apierr) {
		println(string(apierr.DumpRequest(true)))  // Prints the serialized HTTP request
		println(string(apierr.DumpResponse(true))) // Prints the serialized HTTP response
	}
	panic(err.Error()) // GET "/boxes/android": 400 Bad Request { ... }
}

When other errors occur, they are returned unwrapped; for example, if HTTP transport fails, you might receive *url.Error wrapping *net.OpError.

Timeouts

Requests do not time out by default; use context to configure a timeout for a request lifecycle.

Note that if a request is retried, the context timeout does not start over. To set a per-retry timeout, use option.WithRequestTimeout().

// This sets the timeout for the request, including all the retries.
ctx, cancel := context.WithTimeout(context.Background(), 5*time.Minute)
defer cancel()
client.V1.Boxes.NewAndroid(
	ctx,
	gboxsdk.V1BoxNewAndroidParams{
		CreateAndroidBox: gboxsdk.CreateAndroidBoxParam{},
	},
	// This sets the per-retry timeout
	option.WithRequestTimeout(20*time.Second),
)
File uploads

Request parameters that correspond to file uploads in multipart requests are typed as io.Reader. The contents of the io.Reader will by default be sent as a multipart form part with the file name of "anonymous_file" and content-type of "application/octet-stream".

The file name and content-type can be customized by implementing Name() string or ContentType() string on the run-time type of io.Reader. Note that os.File implements Name() string, so a file returned by os.Open will be sent with the file name on disk.

We also provide a helper gboxsdk.File(reader io.Reader, filename string, contentType string) which can be used to wrap any io.Reader with the appropriate file name and content type.

// A file from the file system
file, err := os.Open("/path/to/file")
gboxsdk.V1BoxAndroidInstallParamsInstallAndroidAppByFile{
	Apk: file,
}

// A file from a string
gboxsdk.V1BoxAndroidInstallParamsInstallAndroidAppByFile{
	Apk: strings.NewReader("my file contents"),
}

// With a custom filename and contentType
gboxsdk.V1BoxAndroidInstallParamsInstallAndroidAppByFile{
	Apk: gboxsdk.File(strings.NewReader(`{"hello": "foo"}`), "file.go", "application/json"),
}
Retries

Certain errors will be automatically retried 2 times by default, with a short exponential backoff. We retry by default all connection errors, 408 Request Timeout, 409 Conflict, 429 Rate Limit, and >=500 Internal errors.

You can use the WithMaxRetries option to configure or disable this:

// Configure the default for all requests:
client := gboxsdk.NewClient(
	option.WithMaxRetries(0), // default is 2
)

// Override per-request:
client.V1.Boxes.NewAndroid(
	context.TODO(),
	gboxsdk.V1BoxNewAndroidParams{
		CreateAndroidBox: gboxsdk.CreateAndroidBoxParam{},
	},
	option.WithMaxRetries(5),
)
Accessing raw response data (e.g. response headers)

You can access the raw HTTP response data by using the option.WithResponseInto() request option. This is useful when you need to examine response headers, status codes, or other details.

// Create a variable to store the HTTP response
var response *http.Response
androidBox, err := client.V1.Boxes.NewAndroid(
	context.TODO(),
	gboxsdk.V1BoxNewAndroidParams{
		CreateAndroidBox: gboxsdk.CreateAndroidBoxParam{},
	},
	option.WithResponseInto(&response),
)
if err != nil {
	// handle error
}
fmt.Printf("%+v\n", androidBox)

fmt.Printf("Status Code: %d\n", response.StatusCode)
fmt.Printf("Headers: %+#v\n", response.Header)
Making custom/undocumented requests

This library is typed for convenient access to the documented API. If you need to access undocumented endpoints, params, or response properties, the library can still be used.

Undocumented endpoints

To make requests to undocumented endpoints, you can use client.Get, client.Post, and other HTTP verbs. RequestOptions on the client, such as retries, will be respected when making these requests.

var (
    // params can be an io.Reader, a []byte, an encoding/json serializable object,
    // or a "…Params" struct defined in this library.
    params map[string]any

    // result can be an []byte, *http.Response, a encoding/json deserializable object,
    // or a model defined in this library.
    result *http.Response
)
err := client.Post(context.Background(), "/unspecified", params, &result)
if err != nil {
    …
}
Undocumented request params

To make requests using undocumented parameters, you may use either the option.WithQuerySet() or the option.WithJSONSet() methods.

params := FooNewParams{
    ID:   "id_xxxx",
    Data: FooNewParamsData{
        FirstName: gboxsdk.String("John"),
    },
}
client.Foo.New(context.Background(), params, option.WithJSONSet("data.last_name", "Doe"))
Undocumented response properties

To access undocumented response properties, you may either access the raw JSON of the response as a string with result.JSON.RawJSON(), or get the raw JSON of a particular field on the result with result.JSON.Foo.Raw().

Any fields that are not present on the response struct will be saved and can be accessed by result.JSON.ExtraFields() which returns the extra fields as a map[string]Field.

Middleware

We provide option.WithMiddleware which applies the given middleware to requests.

func Logger(req *http.Request, next option.MiddlewareNext) (res *http.Response, err error) {
	// Before the request
	start := time.Now()
	LogReq(req)

	// Forward the request to the next handler
	res, err = next(req)

	// Handle stuff after the request
	end := time.Now()
	LogRes(res, err, start - end)

    return res, err
}

client := gboxsdk.NewClient(
	option.WithMiddleware(Logger),
)

When multiple middlewares are provided as variadic arguments, the middlewares are applied left to right. If option.WithMiddleware is given multiple times, for example first in the client then the method, the middleware in the client will run first and the middleware given in the method will run next.

You may also replace the default http.Client with option.WithHTTPClient(client). Only one http client is accepted (this overwrites any previous client) and receives requests after any middleware has been applied.

Semantic versioning

This package generally follows SemVer conventions, though certain backwards-incompatible changes may be released as minor versions:

  1. Changes to library internals which are technically public but not intended or documented for external use. (Please open a GitHub issue to let us know if you are relying on such internals.)
  2. Changes that we do not expect to impact the vast majority of users in practice.

We take backwards-compatibility seriously and work hard to ensure you can rely on a smooth upgrade experience.

We are keen for your feedback; please open an issue with questions, bugs, or suggestions.

Contributing

See the contributing documentation.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) param.Opt[bool]

func BoolPtr

func BoolPtr(v bool) *bool

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 File

func File(rdr io.Reader, filename string, contentType string) file

func Float

func Float(f float64) param.Opt[float64]

func FloatPtr

func FloatPtr(v float64) *float64

func Int

func Int(i int64) param.Opt[int64]

func IntPtr

func IntPtr(v int64) *int64

func Opt

func Opt[T comparable](v T) param.Opt[T]

func Ptr

func Ptr[T any](v T) *T

func String

func String(s string) param.Opt[string]

func StringPtr

func StringPtr(v string) *string

func Time

func Time(t time.Time) param.Opt[time.Time]

func TimePtr

func TimePtr(v time.Time) *time.Time

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

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.

func (*Client) Post

func (r *Client) Post(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Post makes a POST request with the given URL, params, and optionally deserializes to a response. See [Execute] documentation on the params and response.

func (*Client) Put

func (r *Client) Put(ctx context.Context, path string, params any, res any, opts ...option.RequestOption) error

Put makes a PUT 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 Error

type Error = apierror.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) RawJSON

func (r LinuxBox) RawJSON() string

Returns the unmodified JSON received from the API

func (*LinuxBox) UnmarshalJSON

func (r *LinuxBox) UnmarshalJSON(data []byte) error

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

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

Click

func (*V1BoxActionService) Drag

Drag

func (*V1BoxActionService) Move

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

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

Take screenshot

func (*V1BoxActionService) Scroll

Scroll

func (*V1BoxActionService) Touch

Touch

func (*V1BoxActionService) Type

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

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

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

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

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

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

Install app

func (*V1BoxAndroidService) List

List apps

func (*V1BoxAndroidService) ListActivities

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

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 (V1BoxFInfoResponseUnion) AsFile

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

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 (V1BoxFListResponseDataUnion) AsFile

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

Check if file exists

func (*V1BoxFService) Info

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

Delete box file/directory

func (*V1BoxFService) Rename

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

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

Start box

func (*V1BoxService) Stop

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.

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL