Documentation
¶
Index ¶
- func Bool(value bool) param.Field[bool]
- func DefaultClientOptions() []option.RequestOption
- func F[T any](value T) param.Field[T]
- func FileParam(reader io.Reader, filename string, contentType string) param.Field[io.Reader]
- func Float(value float64) param.Field[float64]
- func Int(value int64) param.Field[int64]
- func Null[T any]() param.Field[T]
- func Raw[T any](value any) param.Field[T]
- func String(value string) param.Field[string]
- type Build
- type BuildNewParams
- type BuildNewParamsTarget
- type BuildObject
- type BuildService
- type BuildTarget
- type BuildTargetCommit
- type BuildTargetCommitObject
- type BuildTargetCommitObjectCompleted
- type BuildTargetCommitObjectCompletedConclusion
- type BuildTargetCommitObjectCompletedConclusionConclusion
- type BuildTargetCommitObjectCompletedObject
- type BuildTargetCommitObjectCompletedObjectCommit
- type BuildTargetCommitObjectCompletedObjectCommitRepo
- type BuildTargetCommitObjectCompletedObjectConclusion
- type BuildTargetCommitObjectCompletedUnion
- type BuildTargetCommitObjectStatus
- type BuildTargetCommitStatus
- type BuildTargetCommitStatusStatus
- type BuildTargetCommitUnion
- type BuildTargetLint
- type BuildTargetLintObject
- type BuildTargetLintObjectCompleted
- type BuildTargetLintObjectCompletedConclusion
- type BuildTargetLintObjectStatus
- type BuildTargetLintStatus
- type BuildTargetLintStatusStatus
- type BuildTargetLintUnion
- type BuildTargetObject
- type BuildTargetStatus
- type BuildTargetTest
- type BuildTargetTestObject
- type BuildTargetTestObjectCompleted
- type BuildTargetTestObjectCompletedConclusion
- type BuildTargetTestObjectStatus
- type BuildTargetTestStatus
- type BuildTargetTestStatusStatus
- type BuildTargetTestUnion
- type BuildTargets
- type Client
- func (r *Client) Delete(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Execute(ctx context.Context, method string, path string, params interface{}, ...) error
- func (r *Client) Get(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Patch(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Post(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- func (r *Client) Put(ctx context.Context, path string, params interface{}, res interface{}, ...) error
- type Commit
- type CommitObject
- type Error
- type ProjectConfigBranchMergeParams
- type ProjectConfigBranchNewParams
- type ProjectConfigBranchService
- type ProjectConfigCommitNewParams
- type ProjectConfigCommitService
- type ProjectConfigService
- type ProjectService
- type TargetArtifactGetParamsTargetName
- type TargetArtifactGetResponse
- type TargetArtifactService
- type TargetService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DefaultClientOptions ¶
func DefaultClientOptions() []option.RequestOption
DefaultClientOptions read from the environment (STAINLESS_V0_API_KEY). This should be used to initialize new clients.
func F ¶
F is a param field helper used to initialize a param.Field generic struct. This helps specify null, zero values, and overrides, as well as normal values. You can read more about this in our README.
func Int ¶
Int is a param field helper which helps specify integers. This is particularly helpful when specifying integer constants for fields.
func Raw ¶
Raw is a param field helper for specifying values for fields when the type you are looking to send is different from the type that is specified in the SDK. For example, if the type of the field is an integer, but you want to send a float, you could do that by setting the corresponding field with Raw[int](0.5).
Types ¶
type Build ¶
type Build struct {
ID string `json:"id,required"`
ConfigCommit string `json:"config_commit,required"`
Object BuildObject `json:"object,required"`
Targets BuildTargets `json:"targets,required"`
JSON buildJSON `json:"-"`
}
func (*Build) UnmarshalJSON ¶
type BuildNewParams ¶
type BuildNewParams struct {
Branch param.Field[string] `json:"branch,required"`
ConfigCommit param.Field[string] `json:"config_commit,required"`
Project param.Field[string] `json:"project,required"`
Targets param.Field[[]BuildNewParamsTarget] `json:"targets"`
}
func (BuildNewParams) MarshalJSON ¶
func (r BuildNewParams) MarshalJSON() (data []byte, err error)
type BuildNewParamsTarget ¶
type BuildNewParamsTarget string
const ( BuildNewParamsTargetNode BuildNewParamsTarget = "node" BuildNewParamsTargetTypescript BuildNewParamsTarget = "typescript" BuildNewParamsTargetPython BuildNewParamsTarget = "python" BuildNewParamsTargetGo BuildNewParamsTarget = "go" BuildNewParamsTargetJava BuildNewParamsTarget = "java" BuildNewParamsTargetKotlin BuildNewParamsTarget = "kotlin" BuildNewParamsTargetRuby BuildNewParamsTarget = "ruby" BuildNewParamsTargetTerraform BuildNewParamsTarget = "terraform" BuildNewParamsTargetCli BuildNewParamsTarget = "cli" )
func (BuildNewParamsTarget) IsKnown ¶
func (r BuildNewParamsTarget) IsKnown() bool
type BuildObject ¶
type BuildObject string
const (
BuildObjectBuild BuildObject = "build"
)
func (BuildObject) IsKnown ¶
func (r BuildObject) IsKnown() bool
type BuildService ¶
type BuildService struct {
Options []option.RequestOption
}
BuildService contains methods and other services that help with interacting with the stainless-v0 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 NewBuildService method instead.
func NewBuildService ¶
func NewBuildService(opts ...option.RequestOption) (r *BuildService)
NewBuildService 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 (*BuildService) Get ¶
func (r *BuildService) Get(ctx context.Context, buildID string, opts ...option.RequestOption) (res *Build, err error)
TODO
func (*BuildService) New ¶
func (r *BuildService) New(ctx context.Context, body BuildNewParams, opts ...option.RequestOption) (res *Build, err error)
TODO
type BuildTarget ¶
type BuildTarget struct {
Commit BuildTargetCommit `json:"commit,required"`
Lint BuildTargetLint `json:"lint,required"`
Object BuildTargetObject `json:"object,required"`
Status BuildTargetStatus `json:"status,required"`
Test BuildTargetTest `json:"test,required"`
JSON buildTargetJSON `json:"-"`
}
func (*BuildTarget) UnmarshalJSON ¶
func (r *BuildTarget) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommit ¶
type BuildTargetCommit struct {
Status BuildTargetCommitStatus `json:"status,required"`
// This field can have the runtime type of [BuildTargetCommitObjectCompleted].
Completed interface{} `json:"completed"`
JSON buildTargetCommitJSON `json:"-"`
// contains filtered or unexported fields
}
func (BuildTargetCommit) AsUnion ¶
func (r BuildTargetCommit) AsUnion() BuildTargetCommitUnion
AsUnion returns a BuildTargetCommitUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are BuildTargetCommitStatus, BuildTargetCommitStatus, BuildTargetCommitStatus, BuildTargetCommitObject.
func (*BuildTargetCommit) UnmarshalJSON ¶
func (r *BuildTargetCommit) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommitObject ¶
type BuildTargetCommitObject struct {
Completed BuildTargetCommitObjectCompleted `json:"completed,required"`
Status BuildTargetCommitObjectStatus `json:"status,required"`
JSON buildTargetCommitObjectJSON `json:"-"`
}
func (*BuildTargetCommitObject) UnmarshalJSON ¶
func (r *BuildTargetCommitObject) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommitObjectCompleted ¶
type BuildTargetCommitObjectCompleted struct {
Conclusion BuildTargetCommitObjectCompletedConclusion `json:"conclusion,required"`
// This field can have the runtime type of
// [BuildTargetCommitObjectCompletedObjectCommit].
Commit interface{} `json:"commit"`
// This field can have the runtime type of
// [BuildTargetCommitObjectCompletedObjectMergeConflictPr].
MergeConflictPr interface{} `json:"merge_conflict_pr"`
JSON buildTargetCommitObjectCompletedJSON `json:"-"`
// contains filtered or unexported fields
}
func (BuildTargetCommitObjectCompleted) AsUnion ¶
func (r BuildTargetCommitObjectCompleted) AsUnion() BuildTargetCommitObjectCompletedUnion
AsUnion returns a BuildTargetCommitObjectCompletedUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are BuildTargetCommitObjectCompletedObject, BuildTargetCommitObjectCompletedObject, BuildTargetCommitObjectCompletedConclusion.
func (*BuildTargetCommitObjectCompleted) UnmarshalJSON ¶
func (r *BuildTargetCommitObjectCompleted) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommitObjectCompletedConclusion ¶
type BuildTargetCommitObjectCompletedConclusion struct {
Conclusion BuildTargetCommitObjectCompletedConclusionConclusion `json:"conclusion,required"`
JSON buildTargetCommitObjectCompletedConclusionJSON `json:"-"`
}
func (*BuildTargetCommitObjectCompletedConclusion) UnmarshalJSON ¶
func (r *BuildTargetCommitObjectCompletedConclusion) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommitObjectCompletedConclusionConclusion ¶
type BuildTargetCommitObjectCompletedConclusionConclusion string
const ( BuildTargetCommitObjectCompletedConclusionConclusionFatal BuildTargetCommitObjectCompletedConclusionConclusion = "fatal" BuildTargetCommitObjectCompletedConclusionConclusionPaymentRequired BuildTargetCommitObjectCompletedConclusionConclusion = "payment_required" BuildTargetCommitObjectCompletedConclusionConclusionCancelled BuildTargetCommitObjectCompletedConclusionConclusion = "cancelled" BuildTargetCommitObjectCompletedConclusionConclusionTimedOut BuildTargetCommitObjectCompletedConclusionConclusion = "timed_out" BuildTargetCommitObjectCompletedConclusionConclusionNoop BuildTargetCommitObjectCompletedConclusionConclusion = "noop" BuildTargetCommitObjectCompletedConclusionConclusionVersionBump BuildTargetCommitObjectCompletedConclusionConclusion = "version_bump" )
func (BuildTargetCommitObjectCompletedConclusionConclusion) IsKnown ¶
func (r BuildTargetCommitObjectCompletedConclusionConclusion) IsKnown() bool
type BuildTargetCommitObjectCompletedObject ¶
type BuildTargetCommitObjectCompletedObject struct {
Commit BuildTargetCommitObjectCompletedObjectCommit `json:"commit,required"`
Conclusion BuildTargetCommitObjectCompletedObjectConclusion `json:"conclusion,required"`
JSON buildTargetCommitObjectCompletedObjectJSON `json:"-"`
}
func (*BuildTargetCommitObjectCompletedObject) UnmarshalJSON ¶
func (r *BuildTargetCommitObjectCompletedObject) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommitObjectCompletedObjectCommit ¶
type BuildTargetCommitObjectCompletedObjectCommit struct {
Repo BuildTargetCommitObjectCompletedObjectCommitRepo `json:"repo,required"`
Sha string `json:"sha,required"`
JSON buildTargetCommitObjectCompletedObjectCommitJSON `json:"-"`
}
func (*BuildTargetCommitObjectCompletedObjectCommit) UnmarshalJSON ¶
func (r *BuildTargetCommitObjectCompletedObjectCommit) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommitObjectCompletedObjectCommitRepo ¶
type BuildTargetCommitObjectCompletedObjectCommitRepo struct {
Branch string `json:"branch,required"`
Name string `json:"name,required"`
Owner string `json:"owner,required"`
JSON buildTargetCommitObjectCompletedObjectCommitRepoJSON `json:"-"`
}
func (*BuildTargetCommitObjectCompletedObjectCommitRepo) UnmarshalJSON ¶
func (r *BuildTargetCommitObjectCompletedObjectCommitRepo) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommitObjectCompletedObjectConclusion ¶
type BuildTargetCommitObjectCompletedObjectConclusion string
const ( BuildTargetCommitObjectCompletedObjectConclusionError BuildTargetCommitObjectCompletedObjectConclusion = "error" BuildTargetCommitObjectCompletedObjectConclusionWarning BuildTargetCommitObjectCompletedObjectConclusion = "warning" BuildTargetCommitObjectCompletedObjectConclusionNote BuildTargetCommitObjectCompletedObjectConclusion = "note" BuildTargetCommitObjectCompletedObjectConclusionSuccess BuildTargetCommitObjectCompletedObjectConclusion = "success" )
func (BuildTargetCommitObjectCompletedObjectConclusion) IsKnown ¶
func (r BuildTargetCommitObjectCompletedObjectConclusion) IsKnown() bool
type BuildTargetCommitObjectCompletedUnion ¶
type BuildTargetCommitObjectCompletedUnion interface {
// contains filtered or unexported methods
}
Union satisfied by BuildTargetCommitObjectCompletedObject, BuildTargetCommitObjectCompletedObject or BuildTargetCommitObjectCompletedConclusion.
type BuildTargetCommitObjectStatus ¶
type BuildTargetCommitObjectStatus string
const (
BuildTargetCommitObjectStatusCompleted BuildTargetCommitObjectStatus = "completed"
)
func (BuildTargetCommitObjectStatus) IsKnown ¶
func (r BuildTargetCommitObjectStatus) IsKnown() bool
type BuildTargetCommitStatus ¶
type BuildTargetCommitStatus struct {
Status BuildTargetCommitStatusStatus `json:"status,required"`
JSON buildTargetCommitStatusJSON `json:"-"`
}
func (*BuildTargetCommitStatus) UnmarshalJSON ¶
func (r *BuildTargetCommitStatus) UnmarshalJSON(data []byte) (err error)
type BuildTargetCommitStatusStatus ¶
type BuildTargetCommitStatusStatus string
const (
BuildTargetCommitStatusStatusNotStarted BuildTargetCommitStatusStatus = "not_started"
)
func (BuildTargetCommitStatusStatus) IsKnown ¶
func (r BuildTargetCommitStatusStatus) IsKnown() bool
type BuildTargetCommitUnion ¶
type BuildTargetCommitUnion interface {
// contains filtered or unexported methods
}
Union satisfied by BuildTargetCommitStatus, BuildTargetCommitStatus, BuildTargetCommitStatus or BuildTargetCommitObject.
type BuildTargetLint ¶
type BuildTargetLint struct {
Status BuildTargetLintStatus `json:"status,required"`
// This field can have the runtime type of [BuildTargetLintObjectCompleted].
Completed interface{} `json:"completed"`
JSON buildTargetLintJSON `json:"-"`
// contains filtered or unexported fields
}
func (BuildTargetLint) AsUnion ¶
func (r BuildTargetLint) AsUnion() BuildTargetLintUnion
AsUnion returns a BuildTargetLintUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are BuildTargetLintStatus, BuildTargetLintStatus, BuildTargetLintStatus, BuildTargetLintObject.
func (*BuildTargetLint) UnmarshalJSON ¶
func (r *BuildTargetLint) UnmarshalJSON(data []byte) (err error)
type BuildTargetLintObject ¶
type BuildTargetLintObject struct {
Completed BuildTargetLintObjectCompleted `json:"completed,required"`
Status BuildTargetLintObjectStatus `json:"status,required"`
JSON buildTargetLintObjectJSON `json:"-"`
}
func (*BuildTargetLintObject) UnmarshalJSON ¶
func (r *BuildTargetLintObject) UnmarshalJSON(data []byte) (err error)
type BuildTargetLintObjectCompleted ¶
type BuildTargetLintObjectCompleted struct {
Conclusion BuildTargetLintObjectCompletedConclusion `json:"conclusion,required"`
JSON buildTargetLintObjectCompletedJSON `json:"-"`
}
func (*BuildTargetLintObjectCompleted) UnmarshalJSON ¶
func (r *BuildTargetLintObjectCompleted) UnmarshalJSON(data []byte) (err error)
type BuildTargetLintObjectCompletedConclusion ¶
type BuildTargetLintObjectCompletedConclusion string
const ( BuildTargetLintObjectCompletedConclusionSuccess BuildTargetLintObjectCompletedConclusion = "success" BuildTargetLintObjectCompletedConclusionFailure BuildTargetLintObjectCompletedConclusion = "failure" BuildTargetLintObjectCompletedConclusionSkipped BuildTargetLintObjectCompletedConclusion = "skipped" BuildTargetLintObjectCompletedConclusionCancelled BuildTargetLintObjectCompletedConclusion = "cancelled" BuildTargetLintObjectCompletedConclusionActionRequired BuildTargetLintObjectCompletedConclusion = "action_required" BuildTargetLintObjectCompletedConclusionNeutral BuildTargetLintObjectCompletedConclusion = "neutral" BuildTargetLintObjectCompletedConclusionTimedOut BuildTargetLintObjectCompletedConclusion = "timed_out" )
func (BuildTargetLintObjectCompletedConclusion) IsKnown ¶
func (r BuildTargetLintObjectCompletedConclusion) IsKnown() bool
type BuildTargetLintObjectStatus ¶
type BuildTargetLintObjectStatus string
const (
BuildTargetLintObjectStatusCompleted BuildTargetLintObjectStatus = "completed"
)
func (BuildTargetLintObjectStatus) IsKnown ¶
func (r BuildTargetLintObjectStatus) IsKnown() bool
type BuildTargetLintStatus ¶
type BuildTargetLintStatus struct {
Status BuildTargetLintStatusStatus `json:"status,required"`
JSON buildTargetLintStatusJSON `json:"-"`
}
func (*BuildTargetLintStatus) UnmarshalJSON ¶
func (r *BuildTargetLintStatus) UnmarshalJSON(data []byte) (err error)
type BuildTargetLintStatusStatus ¶
type BuildTargetLintStatusStatus string
const (
BuildTargetLintStatusStatusNotStarted BuildTargetLintStatusStatus = "not_started"
)
func (BuildTargetLintStatusStatus) IsKnown ¶
func (r BuildTargetLintStatusStatus) IsKnown() bool
type BuildTargetLintUnion ¶
type BuildTargetLintUnion interface {
// contains filtered or unexported methods
}
Union satisfied by BuildTargetLintStatus, BuildTargetLintStatus, BuildTargetLintStatus or BuildTargetLintObject.
type BuildTargetObject ¶
type BuildTargetObject string
const (
BuildTargetObjectBuildTarget BuildTargetObject = "build_target"
)
func (BuildTargetObject) IsKnown ¶
func (r BuildTargetObject) IsKnown() bool
type BuildTargetStatus ¶
type BuildTargetStatus string
const ( BuildTargetStatusNotStarted BuildTargetStatus = "not_started" BuildTargetStatusCodegen BuildTargetStatus = "codegen" BuildTargetStatusPostgen BuildTargetStatus = "postgen" BuildTargetStatusCompleted BuildTargetStatus = "completed" )
func (BuildTargetStatus) IsKnown ¶
func (r BuildTargetStatus) IsKnown() bool
type BuildTargetTest ¶
type BuildTargetTest struct {
Status BuildTargetTestStatus `json:"status,required"`
// This field can have the runtime type of [BuildTargetTestObjectCompleted].
Completed interface{} `json:"completed"`
JSON buildTargetTestJSON `json:"-"`
// contains filtered or unexported fields
}
func (BuildTargetTest) AsUnion ¶
func (r BuildTargetTest) AsUnion() BuildTargetTestUnion
AsUnion returns a BuildTargetTestUnion interface which you can cast to the specific types for more type safety.
Possible runtime types of the union are BuildTargetTestStatus, BuildTargetTestStatus, BuildTargetTestStatus, BuildTargetTestObject.
func (*BuildTargetTest) UnmarshalJSON ¶
func (r *BuildTargetTest) UnmarshalJSON(data []byte) (err error)
type BuildTargetTestObject ¶
type BuildTargetTestObject struct {
Completed BuildTargetTestObjectCompleted `json:"completed,required"`
Status BuildTargetTestObjectStatus `json:"status,required"`
JSON buildTargetTestObjectJSON `json:"-"`
}
func (*BuildTargetTestObject) UnmarshalJSON ¶
func (r *BuildTargetTestObject) UnmarshalJSON(data []byte) (err error)
type BuildTargetTestObjectCompleted ¶
type BuildTargetTestObjectCompleted struct {
Conclusion BuildTargetTestObjectCompletedConclusion `json:"conclusion,required"`
JSON buildTargetTestObjectCompletedJSON `json:"-"`
}
func (*BuildTargetTestObjectCompleted) UnmarshalJSON ¶
func (r *BuildTargetTestObjectCompleted) UnmarshalJSON(data []byte) (err error)
type BuildTargetTestObjectCompletedConclusion ¶
type BuildTargetTestObjectCompletedConclusion string
const ( BuildTargetTestObjectCompletedConclusionSuccess BuildTargetTestObjectCompletedConclusion = "success" BuildTargetTestObjectCompletedConclusionFailure BuildTargetTestObjectCompletedConclusion = "failure" BuildTargetTestObjectCompletedConclusionSkipped BuildTargetTestObjectCompletedConclusion = "skipped" BuildTargetTestObjectCompletedConclusionCancelled BuildTargetTestObjectCompletedConclusion = "cancelled" BuildTargetTestObjectCompletedConclusionActionRequired BuildTargetTestObjectCompletedConclusion = "action_required" BuildTargetTestObjectCompletedConclusionNeutral BuildTargetTestObjectCompletedConclusion = "neutral" BuildTargetTestObjectCompletedConclusionTimedOut BuildTargetTestObjectCompletedConclusion = "timed_out" )
func (BuildTargetTestObjectCompletedConclusion) IsKnown ¶
func (r BuildTargetTestObjectCompletedConclusion) IsKnown() bool
type BuildTargetTestObjectStatus ¶
type BuildTargetTestObjectStatus string
const (
BuildTargetTestObjectStatusCompleted BuildTargetTestObjectStatus = "completed"
)
func (BuildTargetTestObjectStatus) IsKnown ¶
func (r BuildTargetTestObjectStatus) IsKnown() bool
type BuildTargetTestStatus ¶
type BuildTargetTestStatus struct {
Status BuildTargetTestStatusStatus `json:"status,required"`
JSON buildTargetTestStatusJSON `json:"-"`
}
func (*BuildTargetTestStatus) UnmarshalJSON ¶
func (r *BuildTargetTestStatus) UnmarshalJSON(data []byte) (err error)
type BuildTargetTestStatusStatus ¶
type BuildTargetTestStatusStatus string
const (
BuildTargetTestStatusStatusNotStarted BuildTargetTestStatusStatus = "not_started"
)
func (BuildTargetTestStatusStatus) IsKnown ¶
func (r BuildTargetTestStatusStatus) IsKnown() bool
type BuildTargetTestUnion ¶
type BuildTargetTestUnion interface {
// contains filtered or unexported methods
}
Union satisfied by BuildTargetTestStatus, BuildTargetTestStatus, BuildTargetTestStatus or BuildTargetTestObject.
type BuildTargets ¶
type BuildTargets struct {
Cli BuildTarget `json:"cli"`
Go BuildTarget `json:"go"`
Java BuildTarget `json:"java"`
Kotlin BuildTarget `json:"kotlin"`
Node BuildTarget `json:"node"`
Python BuildTarget `json:"python"`
Ruby BuildTarget `json:"ruby"`
Terraform BuildTarget `json:"terraform"`
Typescript BuildTarget `json:"typescript"`
JSON buildTargetsJSON `json:"-"`
}
func (*BuildTargets) UnmarshalJSON ¶
func (r *BuildTargets) UnmarshalJSON(data []byte) (err error)
type Client ¶
type Client struct {
Options []option.RequestOption
Projects *ProjectService
Builds *BuildService
Targets *TargetService
}
Client creates a struct with services and top level methods that help with interacting with the stainless-v0 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 (STAINLESS_V0_API_KEY). 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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 interface{}, res interface{}, 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.
type Commit ¶
type Commit struct {
ID string `json:"id,required"`
Builds []Build `json:"builds,required"`
Object CommitObject `json:"object,required"`
JSON commitJSON `json:"-"`
}
func (*Commit) UnmarshalJSON ¶
type CommitObject ¶
type CommitObject string
const (
CommitObjectConfigCommit CommitObject = "config_commit"
)
func (CommitObject) IsKnown ¶
func (r CommitObject) IsKnown() bool
type ProjectConfigBranchMergeParams ¶
type ProjectConfigBranchMergeParams struct {
From param.Field[string] `json:"from,required"`
Into param.Field[string] `json:"into,required"`
}
func (ProjectConfigBranchMergeParams) MarshalJSON ¶
func (r ProjectConfigBranchMergeParams) MarshalJSON() (data []byte, err error)
type ProjectConfigBranchNewParams ¶
type ProjectConfigBranchNewParams struct {
Branch param.Field[string] `json:"branch,required"`
BranchFrom param.Field[string] `json:"branch_from,required"`
}
func (ProjectConfigBranchNewParams) MarshalJSON ¶
func (r ProjectConfigBranchNewParams) MarshalJSON() (data []byte, err error)
type ProjectConfigBranchService ¶
type ProjectConfigBranchService struct {
Options []option.RequestOption
}
ProjectConfigBranchService contains methods and other services that help with interacting with the stainless-v0 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 NewProjectConfigBranchService method instead.
func NewProjectConfigBranchService ¶
func NewProjectConfigBranchService(opts ...option.RequestOption) (r *ProjectConfigBranchService)
NewProjectConfigBranchService 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 (*ProjectConfigBranchService) Merge ¶
func (r *ProjectConfigBranchService) Merge(ctx context.Context, projectName string, body ProjectConfigBranchMergeParams, opts ...option.RequestOption) (res *Commit, err error)
TODO
func (*ProjectConfigBranchService) New ¶
func (r *ProjectConfigBranchService) New(ctx context.Context, projectName string, body ProjectConfigBranchNewParams, opts ...option.RequestOption) (res *Commit, err error)
TODO
type ProjectConfigCommitNewParams ¶
type ProjectConfigCommitNewParams struct {
Branch param.Field[string] `json:"branch,required"`
CommitMessage param.Field[string] `json:"commit_message,required"`
AllowEmpty param.Field[bool] `json:"allow_empty"`
OpenAPISpec param.Field[string] `json:"openapi_spec"`
StainlessConfig param.Field[string] `json:"stainless_config"`
}
func (ProjectConfigCommitNewParams) MarshalJSON ¶
func (r ProjectConfigCommitNewParams) MarshalJSON() (data []byte, err error)
type ProjectConfigCommitService ¶
type ProjectConfigCommitService struct {
Options []option.RequestOption
}
ProjectConfigCommitService contains methods and other services that help with interacting with the stainless-v0 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 NewProjectConfigCommitService method instead.
func NewProjectConfigCommitService ¶
func NewProjectConfigCommitService(opts ...option.RequestOption) (r *ProjectConfigCommitService)
NewProjectConfigCommitService 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 (*ProjectConfigCommitService) New ¶
func (r *ProjectConfigCommitService) New(ctx context.Context, projectName string, body ProjectConfigCommitNewParams, opts ...option.RequestOption) (res *Commit, err error)
TODO
type ProjectConfigService ¶
type ProjectConfigService struct {
Options []option.RequestOption
Commits *ProjectConfigCommitService
Branches *ProjectConfigBranchService
}
ProjectConfigService contains methods and other services that help with interacting with the stainless-v0 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 NewProjectConfigService method instead.
func NewProjectConfigService ¶
func NewProjectConfigService(opts ...option.RequestOption) (r *ProjectConfigService)
NewProjectConfigService 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.
type ProjectService ¶
type ProjectService struct {
Options []option.RequestOption
Config *ProjectConfigService
}
ProjectService contains methods and other services that help with interacting with the stainless-v0 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 NewProjectService method instead.
func NewProjectService ¶
func NewProjectService(opts ...option.RequestOption) (r *ProjectService)
NewProjectService 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.
type TargetArtifactGetParamsTargetName ¶
type TargetArtifactGetParamsTargetName string
const ( TargetArtifactGetParamsTargetNameNode TargetArtifactGetParamsTargetName = "node" TargetArtifactGetParamsTargetNameTypescript TargetArtifactGetParamsTargetName = "typescript" TargetArtifactGetParamsTargetNamePython TargetArtifactGetParamsTargetName = "python" TargetArtifactGetParamsTargetNameGo TargetArtifactGetParamsTargetName = "go" TargetArtifactGetParamsTargetNameJava TargetArtifactGetParamsTargetName = "java" TargetArtifactGetParamsTargetNameKotlin TargetArtifactGetParamsTargetName = "kotlin" TargetArtifactGetParamsTargetNameRuby TargetArtifactGetParamsTargetName = "ruby" TargetArtifactGetParamsTargetNameTerraform TargetArtifactGetParamsTargetName = "terraform" TargetArtifactGetParamsTargetNameCli TargetArtifactGetParamsTargetName = "cli" )
func (TargetArtifactGetParamsTargetName) IsKnown ¶
func (r TargetArtifactGetParamsTargetName) IsKnown() bool
type TargetArtifactGetResponse ¶
type TargetArtifactGetResponse struct {
URL string `json:"url,required"`
JSON targetArtifactGetResponseJSON `json:"-"`
}
func (*TargetArtifactGetResponse) UnmarshalJSON ¶
func (r *TargetArtifactGetResponse) UnmarshalJSON(data []byte) (err error)
type TargetArtifactService ¶
type TargetArtifactService struct {
Options []option.RequestOption
}
TargetArtifactService contains methods and other services that help with interacting with the stainless-v0 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 NewTargetArtifactService method instead.
func NewTargetArtifactService ¶
func NewTargetArtifactService(opts ...option.RequestOption) (r *TargetArtifactService)
NewTargetArtifactService 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 (*TargetArtifactService) Get ¶
func (r *TargetArtifactService) Get(ctx context.Context, buildID string, targetName TargetArtifactGetParamsTargetName, opts ...option.RequestOption) (res *TargetArtifactGetResponse, err error)
TODO
type TargetService ¶
type TargetService struct {
Options []option.RequestOption
Artifacts *TargetArtifactService
}
TargetService contains methods and other services that help with interacting with the stainless-v0 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 NewTargetService method instead.
func NewTargetService ¶
func NewTargetService(opts ...option.RequestOption) (r *TargetService)
NewTargetService 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.