mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
345 lines
8.7 KiB
Go
345 lines
8.7 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 RunnerTask type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &RunnerTask{}
|
|
|
|
// RunnerTask struct for RunnerTask
|
|
type RunnerTask struct {
|
|
// Context is what the job evaluates github.* against.
|
|
Context *RunnerContext `json:"context,omitempty"`
|
|
// ID identifies this task on every later state and log report.
|
|
Id *int64 `json:"id,omitempty"`
|
|
// Needs is what the jobs this one depends on produced.
|
|
Needs []RunnerNeed `json:"needs,omitempty"`
|
|
// Secrets are the values masked out of the log and exposed as secrets.*.
|
|
Secrets []RunnerPair `json:"secrets,omitempty"`
|
|
// Vars are the values exposed as vars.*.
|
|
Vars []RunnerPair `json:"vars,omitempty"`
|
|
// Workflow is the workflow document verbatim. The forge decides THAT a job runs; act, on the runner, decides what the document means.
|
|
Workflow *string `json:"workflow,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _RunnerTask RunnerTask
|
|
|
|
// NewRunnerTask instantiates a new RunnerTask 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 NewRunnerTask() *RunnerTask {
|
|
this := RunnerTask{}
|
|
return &this
|
|
}
|
|
|
|
// NewRunnerTaskWithDefaults instantiates a new RunnerTask 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 NewRunnerTaskWithDefaults() *RunnerTask {
|
|
this := RunnerTask{}
|
|
return &this
|
|
}
|
|
|
|
// GetContext returns the Context field value if set, zero value otherwise.
|
|
func (o *RunnerTask) GetContext() RunnerContext {
|
|
if o == nil || IsNil(o.Context) {
|
|
var ret RunnerContext
|
|
return ret
|
|
}
|
|
return *o.Context
|
|
}
|
|
|
|
// GetContextOk returns a tuple with the Context field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerTask) GetContextOk() (*RunnerContext, bool) {
|
|
if o == nil || IsNil(o.Context) {
|
|
return nil, false
|
|
}
|
|
return o.Context, true
|
|
}
|
|
|
|
// HasContext returns a boolean if a field has been set.
|
|
func (o *RunnerTask) HasContext() bool {
|
|
if o != nil && !IsNil(o.Context) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetContext gets a reference to the given RunnerContext and assigns it to the Context field.
|
|
func (o *RunnerTask) SetContext(v RunnerContext) {
|
|
o.Context = &v
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *RunnerTask) GetId() int64 {
|
|
if o == nil || IsNil(o.Id) {
|
|
var ret int64
|
|
return ret
|
|
}
|
|
return *o.Id
|
|
}
|
|
|
|
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerTask) GetIdOk() (*int64, bool) {
|
|
if o == nil || IsNil(o.Id) {
|
|
return nil, false
|
|
}
|
|
return o.Id, true
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *RunnerTask) HasId() bool {
|
|
if o != nil && !IsNil(o.Id) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetId gets a reference to the given int64 and assigns it to the Id field.
|
|
func (o *RunnerTask) SetId(v int64) {
|
|
o.Id = &v
|
|
}
|
|
|
|
// GetNeeds returns the Needs field value if set, zero value otherwise.
|
|
func (o *RunnerTask) GetNeeds() []RunnerNeed {
|
|
if o == nil || IsNil(o.Needs) {
|
|
var ret []RunnerNeed
|
|
return ret
|
|
}
|
|
return o.Needs
|
|
}
|
|
|
|
// GetNeedsOk returns a tuple with the Needs field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerTask) GetNeedsOk() ([]RunnerNeed, bool) {
|
|
if o == nil || IsNil(o.Needs) {
|
|
return nil, false
|
|
}
|
|
return o.Needs, true
|
|
}
|
|
|
|
// HasNeeds returns a boolean if a field has been set.
|
|
func (o *RunnerTask) HasNeeds() bool {
|
|
if o != nil && !IsNil(o.Needs) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetNeeds gets a reference to the given []RunnerNeed and assigns it to the Needs field.
|
|
func (o *RunnerTask) SetNeeds(v []RunnerNeed) {
|
|
o.Needs = v
|
|
}
|
|
|
|
// GetSecrets returns the Secrets field value if set, zero value otherwise.
|
|
func (o *RunnerTask) GetSecrets() []RunnerPair {
|
|
if o == nil || IsNil(o.Secrets) {
|
|
var ret []RunnerPair
|
|
return ret
|
|
}
|
|
return o.Secrets
|
|
}
|
|
|
|
// GetSecretsOk returns a tuple with the Secrets field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerTask) GetSecretsOk() ([]RunnerPair, bool) {
|
|
if o == nil || IsNil(o.Secrets) {
|
|
return nil, false
|
|
}
|
|
return o.Secrets, true
|
|
}
|
|
|
|
// HasSecrets returns a boolean if a field has been set.
|
|
func (o *RunnerTask) HasSecrets() bool {
|
|
if o != nil && !IsNil(o.Secrets) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetSecrets gets a reference to the given []RunnerPair and assigns it to the Secrets field.
|
|
func (o *RunnerTask) SetSecrets(v []RunnerPair) {
|
|
o.Secrets = v
|
|
}
|
|
|
|
// GetVars returns the Vars field value if set, zero value otherwise.
|
|
func (o *RunnerTask) GetVars() []RunnerPair {
|
|
if o == nil || IsNil(o.Vars) {
|
|
var ret []RunnerPair
|
|
return ret
|
|
}
|
|
return o.Vars
|
|
}
|
|
|
|
// GetVarsOk returns a tuple with the Vars field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerTask) GetVarsOk() ([]RunnerPair, bool) {
|
|
if o == nil || IsNil(o.Vars) {
|
|
return nil, false
|
|
}
|
|
return o.Vars, true
|
|
}
|
|
|
|
// HasVars returns a boolean if a field has been set.
|
|
func (o *RunnerTask) HasVars() bool {
|
|
if o != nil && !IsNil(o.Vars) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetVars gets a reference to the given []RunnerPair and assigns it to the Vars field.
|
|
func (o *RunnerTask) SetVars(v []RunnerPair) {
|
|
o.Vars = v
|
|
}
|
|
|
|
// GetWorkflow returns the Workflow field value if set, zero value otherwise.
|
|
func (o *RunnerTask) GetWorkflow() string {
|
|
if o == nil || IsNil(o.Workflow) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Workflow
|
|
}
|
|
|
|
// GetWorkflowOk returns a tuple with the Workflow field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *RunnerTask) GetWorkflowOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Workflow) {
|
|
return nil, false
|
|
}
|
|
return o.Workflow, true
|
|
}
|
|
|
|
// HasWorkflow returns a boolean if a field has been set.
|
|
func (o *RunnerTask) HasWorkflow() bool {
|
|
if o != nil && !IsNil(o.Workflow) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetWorkflow gets a reference to the given string and assigns it to the Workflow field.
|
|
func (o *RunnerTask) SetWorkflow(v string) {
|
|
o.Workflow = &v
|
|
}
|
|
|
|
func (o RunnerTask) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o RunnerTask) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Context) {
|
|
toSerialize["context"] = o.Context
|
|
}
|
|
if !IsNil(o.Id) {
|
|
toSerialize["id"] = o.Id
|
|
}
|
|
if !IsNil(o.Needs) {
|
|
toSerialize["needs"] = o.Needs
|
|
}
|
|
if !IsNil(o.Secrets) {
|
|
toSerialize["secrets"] = o.Secrets
|
|
}
|
|
if !IsNil(o.Vars) {
|
|
toSerialize["vars"] = o.Vars
|
|
}
|
|
if !IsNil(o.Workflow) {
|
|
toSerialize["workflow"] = o.Workflow
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *RunnerTask) UnmarshalJSON(data []byte) (err error) {
|
|
varRunnerTask := _RunnerTask{}
|
|
|
|
err = json.Unmarshal(data, &varRunnerTask)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = RunnerTask(varRunnerTask)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "context")
|
|
delete(additionalProperties, "id")
|
|
delete(additionalProperties, "needs")
|
|
delete(additionalProperties, "secrets")
|
|
delete(additionalProperties, "vars")
|
|
delete(additionalProperties, "workflow")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableRunnerTask struct {
|
|
value *RunnerTask
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableRunnerTask) Get() *RunnerTask {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableRunnerTask) Set(val *RunnerTask) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableRunnerTask) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableRunnerTask) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableRunnerTask(val *RunnerTask) *NullableRunnerTask {
|
|
return &NullableRunnerTask{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableRunnerTask) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableRunnerTask) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|