mirror of
https://github.com/hanzo-go/sdk.git
synced 2026-11-20 20:13:42 +00:00
231 lines
5.6 KiB
Go
231 lines
5.6 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 GitJobView type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &GitJobView{}
|
|
|
|
// GitJobView struct for GitJobView
|
|
type GitJobView struct {
|
|
// Name is the job's id in the workflow document.
|
|
Name *string `json:"name,omitempty"`
|
|
// Pool is the declared pool carrying every one of those labels, or empty when no pool does — which is the answer to \"why is nothing running\".
|
|
Pool *string `json:"pool,omitempty"`
|
|
// RunsOn is the labels the job asked for.
|
|
RunsOn []string `json:"runsOn,omitempty"`
|
|
AdditionalProperties map[string]interface{}
|
|
}
|
|
|
|
type _GitJobView GitJobView
|
|
|
|
// NewGitJobView instantiates a new GitJobView 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 NewGitJobView() *GitJobView {
|
|
this := GitJobView{}
|
|
return &this
|
|
}
|
|
|
|
// NewGitJobViewWithDefaults instantiates a new GitJobView 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 NewGitJobViewWithDefaults() *GitJobView {
|
|
this := GitJobView{}
|
|
return &this
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *GitJobView) 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 *GitJobView) 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 *GitJobView) 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 *GitJobView) SetName(v string) {
|
|
o.Name = &v
|
|
}
|
|
|
|
// GetPool returns the Pool field value if set, zero value otherwise.
|
|
func (o *GitJobView) GetPool() string {
|
|
if o == nil || IsNil(o.Pool) {
|
|
var ret string
|
|
return ret
|
|
}
|
|
return *o.Pool
|
|
}
|
|
|
|
// GetPoolOk returns a tuple with the Pool field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitJobView) GetPoolOk() (*string, bool) {
|
|
if o == nil || IsNil(o.Pool) {
|
|
return nil, false
|
|
}
|
|
return o.Pool, true
|
|
}
|
|
|
|
// HasPool returns a boolean if a field has been set.
|
|
func (o *GitJobView) HasPool() bool {
|
|
if o != nil && !IsNil(o.Pool) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetPool gets a reference to the given string and assigns it to the Pool field.
|
|
func (o *GitJobView) SetPool(v string) {
|
|
o.Pool = &v
|
|
}
|
|
|
|
// GetRunsOn returns the RunsOn field value if set, zero value otherwise.
|
|
func (o *GitJobView) GetRunsOn() []string {
|
|
if o == nil || IsNil(o.RunsOn) {
|
|
var ret []string
|
|
return ret
|
|
}
|
|
return o.RunsOn
|
|
}
|
|
|
|
// GetRunsOnOk returns a tuple with the RunsOn field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *GitJobView) GetRunsOnOk() ([]string, bool) {
|
|
if o == nil || IsNil(o.RunsOn) {
|
|
return nil, false
|
|
}
|
|
return o.RunsOn, true
|
|
}
|
|
|
|
// HasRunsOn returns a boolean if a field has been set.
|
|
func (o *GitJobView) HasRunsOn() bool {
|
|
if o != nil && !IsNil(o.RunsOn) {
|
|
return true
|
|
}
|
|
|
|
return false
|
|
}
|
|
|
|
// SetRunsOn gets a reference to the given []string and assigns it to the RunsOn field.
|
|
func (o *GitJobView) SetRunsOn(v []string) {
|
|
o.RunsOn = v
|
|
}
|
|
|
|
func (o GitJobView) MarshalJSON() ([]byte, error) {
|
|
toSerialize, err := o.ToMap()
|
|
if err != nil {
|
|
return []byte{}, err
|
|
}
|
|
return json.Marshal(toSerialize)
|
|
}
|
|
|
|
func (o GitJobView) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if !IsNil(o.Name) {
|
|
toSerialize["name"] = o.Name
|
|
}
|
|
if !IsNil(o.Pool) {
|
|
toSerialize["pool"] = o.Pool
|
|
}
|
|
if !IsNil(o.RunsOn) {
|
|
toSerialize["runsOn"] = o.RunsOn
|
|
}
|
|
|
|
for key, value := range o.AdditionalProperties {
|
|
toSerialize[key] = value
|
|
}
|
|
|
|
return toSerialize, nil
|
|
}
|
|
|
|
func (o *GitJobView) UnmarshalJSON(data []byte) (err error) {
|
|
varGitJobView := _GitJobView{}
|
|
|
|
err = json.Unmarshal(data, &varGitJobView)
|
|
|
|
if err != nil {
|
|
return err
|
|
}
|
|
|
|
*o = GitJobView(varGitJobView)
|
|
|
|
additionalProperties := make(map[string]interface{})
|
|
|
|
if err = json.Unmarshal(data, &additionalProperties); err == nil {
|
|
delete(additionalProperties, "name")
|
|
delete(additionalProperties, "pool")
|
|
delete(additionalProperties, "runsOn")
|
|
o.AdditionalProperties = additionalProperties
|
|
}
|
|
|
|
return err
|
|
}
|
|
|
|
type NullableGitJobView struct {
|
|
value *GitJobView
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableGitJobView) Get() *GitJobView {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableGitJobView) Set(val *GitJobView) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableGitJobView) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableGitJobView) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableGitJobView(val *GitJobView) *NullableGitJobView {
|
|
return &NullableGitJobView{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableGitJobView) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableGitJobView) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|