mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
383 lines
11 KiB
Go
383 lines
11 KiB
Go
/*
|
|
Hanzo Cloud API
|
|
|
|
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
|
|
|
API version: v1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package hanzoai
|
|
|
|
import (
|
|
"encoding/json"
|
|
)
|
|
|
|
// checks if the PlatformBinarySpec type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &PlatformBinarySpec{}
|
|
|
|
// PlatformBinarySpec struct for PlatformBinarySpec
|
|
type PlatformBinarySpec struct {
|
|
// Image is the toolchain image the recipe runs in, a Go bookworm image by default. It is the one field the GitHub lane ignores: there the runner IS the toolchain, and a cluster has to be told what a runner already is.
|
|
Image *string `json:"image,omitempty"`
|
|
// Ldflags are the Go linker flags, `-s -w` when the recipe names none, on one line. Go lane only.
|
|
Ldflags *string `json:"ldflags,omitempty"`
|
|
// Main is the Go package to build, repo-relative (`.` or `./cmd/x`), and it selects the GO LANE. Defaults to `.` when neither lane is named; declaring it together with `run` is refused.
|
|
Main *string `json:"main,omitempty"`
|
|
// Name is the artifact's base name: the prefix of every file published for this entry, and the name a host later asks for. It must match `^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$`, which is what makes it safe as both a filename and a URL path segment.
|
|
Name *string `json:"name,omitempty"`
|
|
// Out is the glob of files `run` produced, relative to the repo root; matching nothing FAILS the build rather than publishing an empty entry. It expands unquoted, so it is bounded to path and glob characters. The Go lane names its own files and ignores this.
|
|
Out *string `json:"out,omitempty"`
|
|
// Platforms are the `<os>/<arch>` pairs the Go lane cross-compiles, [linux/amd64] by default. Each one publishes as `<name>-<os>-<arch>`, which is the shape a host resolves a binary BY — so the list is what a caller can ask for later.
|
|
Platforms []string `json:"platforms,omitempty"`
|
|
// Run is any other toolchain's build command, run by `sh -c` in this entry's image, and it selects the OTHER LANE. Arbitrary shell is the point — it is the same trust as a Dockerfile RUN — which is why it executes with no object-store credential and no service-account token. It requires `out`.
|
|
Run *string `json:"run,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _PlatformBinarySpec PlatformBinarySpec
|
|
|
|
// NewPlatformBinarySpec instantiates a new PlatformBinarySpec object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewPlatformBinarySpec() *PlatformBinarySpec {
|
|
this := PlatformBinarySpec{}
|
|
return &this
|
|
}
|
|
|
|
// NewPlatformBinarySpecWithDefaults instantiates a new PlatformBinarySpec object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewPlatformBinarySpecWithDefaults() *PlatformBinarySpec {
|
|
this := PlatformBinarySpec{}
|
|
return &this
|
|
}
|
|
|
|
// GetImage returns the Image field value if set, zero value otherwise.
|
|
func (o *PlatformBinarySpec) GetImage() string {
|
|
if o == nil || IsNil(o.Image) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Image
|
|
}
|
|
|
|
// GetImageOk returns a tuple with the Image field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformBinarySpec) GetImageOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Image) {
|
|
return nil, false
|
|
}
|
|
return o.Image, true
|
|
}
|
|
|
|
// HasImage returns a boolean if a field has been set.
|
|
func (o *PlatformBinarySpec) HasImage() bool {
|
|
if o != nil && !IsNil(o.Image) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetImage gets a reference to the given string and assigns it to the Image field.
|
|
func (o *PlatformBinarySpec) SetImage(v string) {
|
|
o.Image = &v
|
|
}
|
|
|
|
// GetLdflags returns the Ldflags field value if set, zero value otherwise.
|
|
func (o *PlatformBinarySpec) GetLdflags() string {
|
|
if o == nil || IsNil(o.Ldflags) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Ldflags
|
|
}
|
|
|
|
// GetLdflagsOk returns a tuple with the Ldflags field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformBinarySpec) GetLdflagsOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Ldflags) {
|
|
return nil, false
|
|
}
|
|
return o.Ldflags, true
|
|
}
|
|
|
|
// HasLdflags returns a boolean if a field has been set.
|
|
func (o *PlatformBinarySpec) HasLdflags() bool {
|
|
if o != nil && !IsNil(o.Ldflags) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetLdflags gets a reference to the given string and assigns it to the Ldflags field.
|
|
func (o *PlatformBinarySpec) SetLdflags(v string) {
|
|
o.Ldflags = &v
|
|
}
|
|
|
|
// GetMain returns the Main field value if set, zero value otherwise.
|
|
func (o *PlatformBinarySpec) GetMain() string {
|
|
if o == nil || IsNil(o.Main) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Main
|
|
}
|
|
|
|
// GetMainOk returns a tuple with the Main field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformBinarySpec) GetMainOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Main) {
|
|
return nil, false
|
|
}
|
|
return o.Main, true
|
|
}
|
|
|
|
// HasMain returns a boolean if a field has been set.
|
|
func (o *PlatformBinarySpec) HasMain() bool {
|
|
if o != nil && !IsNil(o.Main) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetMain gets a reference to the given string and assigns it to the Main field.
|
|
func (o *PlatformBinarySpec) SetMain(v string) {
|
|
o.Main = &v
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *PlatformBinarySpec) GetName() string {
|
|
if o == nil || IsNil(o.Name) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Name
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformBinarySpec) GetNameOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Name) {
|
|
return nil, false
|
|
}
|
|
return o.Name, true
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *PlatformBinarySpec) HasName() bool {
|
|
if o != nil && !IsNil(o.Name) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *PlatformBinarySpec) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetOut returns the Out field value if set, zero value otherwise.
|
|
func (o *PlatformBinarySpec) GetOut() string {
|
|
if o == nil || IsNil(o.Out) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Out
|
|
}
|
|
|
|
// GetOutOk returns a tuple with the Out field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformBinarySpec) GetOutOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Out) {
|
|
return nil, false
|
|
}
|
|
return o.Out, true
|
|
}
|
|
|
|
// HasOut returns a boolean if a field has been set.
|
|
func (o *PlatformBinarySpec) HasOut() bool {
|
|
if o != nil && !IsNil(o.Out) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetOut gets a reference to the given string and assigns it to the Out field.
|
|
func (o *PlatformBinarySpec) SetOut(v string) {
|
|
o.Out = &v
|
|
}
|
|
|
|
// GetPlatforms returns the Platforms field value if set, zero value otherwise.
|
|
func (o *PlatformBinarySpec) GetPlatforms() []string {
|
|
if o == nil || IsNil(o.Platforms) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.Platforms
|
|
}
|
|
|
|
// GetPlatformsOk returns a tuple with the Platforms field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformBinarySpec) GetPlatformsOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.Platforms) {
|
|
return nil, false
|
|
}
|
|
return o.Platforms, true
|
|
}
|
|
|
|
// HasPlatforms returns a boolean if a field has been set.
|
|
func (o *PlatformBinarySpec) HasPlatforms() bool {
|
|
if o != nil && !IsNil(o.Platforms) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPlatforms gets a reference to the given []string and assigns it to the Platforms field.
|
|
func (o *PlatformBinarySpec) SetPlatforms(v []string) {
|
|
o.Platforms = v
|
|
}
|
|
|
|
// GetRun returns the Run field value if set, zero value otherwise.
|
|
func (o *PlatformBinarySpec) GetRun() string {
|
|
if o == nil || IsNil(o.Run) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Run
|
|
}
|
|
|
|
// GetRunOk returns a tuple with the Run field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *PlatformBinarySpec) GetRunOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Run) {
|
|
return nil, false
|
|
}
|
|
return o.Run, true
|
|
}
|
|
|
|
// HasRun returns a boolean if a field has been set.
|
|
func (o *PlatformBinarySpec) HasRun() bool {
|
|
if o != nil && !IsNil(o.Run) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRun gets a reference to the given string and assigns it to the Run field.
|
|
func (o *PlatformBinarySpec) SetRun(v string) {
|
|
o.Run = &v
|
|
}
|
|
|
|
func (o PlatformBinarySpec) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o PlatformBinarySpec) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Image) {
|
|
toSerialize["image"] = o.Image
|
|
}
|
|
if !IsNil(o.Ldflags) {
|
|
toSerialize["ldflags"] = o.Ldflags
|
|
}
|
|
if !IsNil(o.Main) {
|
|
toSerialize["main"] = o.Main
|
|
}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Out) {
|
|
toSerialize["out"] = o.Out
|
|
}
|
|
if !IsNil(o.Platforms) {
|
|
toSerialize["platforms"] = o.Platforms
|
|
}
|
|
if !IsNil(o.Run) {
|
|
toSerialize["run"] = o.Run
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *PlatformBinarySpec) UnmarshalJSON(data []byte) (err error) {
|
|
varPlatformBinarySpec := _PlatformBinarySpec{}
|
|
|
|
err = json.Unmarshal(data, &varPlatformBinarySpec)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = PlatformBinarySpec(varPlatformBinarySpec)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "image")
|
|
delete(additionalProperties, "ldflags")
|
|
delete(additionalProperties, "main")
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "out")
|
|
delete(additionalProperties, "platforms")
|
|
delete(additionalProperties, "run")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullablePlatformBinarySpec struct {
|
|
value *PlatformBinarySpec
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullablePlatformBinarySpec) Get() *PlatformBinarySpec {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullablePlatformBinarySpec) Set(val *PlatformBinarySpec) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullablePlatformBinarySpec) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullablePlatformBinarySpec) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullablePlatformBinarySpec(val *PlatformBinarySpec) *NullablePlatformBinarySpec {
|
|
return &NullablePlatformBinarySpec{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullablePlatformBinarySpec) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullablePlatformBinarySpec) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|