Files
sdk/model_declare_req.go

598 lines
14 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 DeclareReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DeclareReq{}
// DeclareReq struct for DeclareReq
type DeclareReq struct {
Build *bool `json:"build,omitempty"`
Dockerfile *string `json:"dockerfile,omitempty"`
Env []DeclareEnv `json:"env,omitempty"`
Host *string `json:"host,omitempty"`
Mode *string `json:"mode,omitempty"`
Name *string `json:"name,omitempty"`
Org *string `json:"org,omitempty"`
PartOf *string `json:"partOf,omitempty"`
Port *int32 `json:"port,omitempty"`
Ref *string `json:"ref,omitempty"`
Replicas *int32 `json:"replicas,omitempty"`
Repo *string `json:"repo,omitempty"`
Tag *string `json:"tag,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DeclareReq DeclareReq
// NewDeclareReq instantiates a new DeclareReq 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 NewDeclareReq() *DeclareReq {
this := DeclareReq{}
return &this
}
// NewDeclareReqWithDefaults instantiates a new DeclareReq 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 NewDeclareReqWithDefaults() *DeclareReq {
this := DeclareReq{}
return &this
}
// GetBuild returns the Build field value if set, zero value otherwise.
func (o *DeclareReq) GetBuild() bool {
if o == nil || IsNil(o.Build) {
var ret bool
return ret
}
return *o.Build
}
// GetBuildOk returns a tuple with the Build field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetBuildOk() (*bool, bool) {
if o == nil || IsNil(o.Build) {
return nil, false
}
return o.Build, true
}
// HasBuild returns a boolean if a field has been set.
func (o *DeclareReq) HasBuild() bool {
if o != nil && !IsNil(o.Build) {
return true
}
return false
}
// SetBuild gets a reference to the given bool and assigns it to the Build field.
func (o *DeclareReq) SetBuild(v bool) {
o.Build = &v
}
// GetDockerfile returns the Dockerfile field value if set, zero value otherwise.
func (o *DeclareReq) GetDockerfile() string {
if o == nil || IsNil(o.Dockerfile) {
var ret string
return ret
}
return *o.Dockerfile
}
// GetDockerfileOk returns a tuple with the Dockerfile field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetDockerfileOk() (*string, bool) {
if o == nil || IsNil(o.Dockerfile) {
return nil, false
}
return o.Dockerfile, true
}
// HasDockerfile returns a boolean if a field has been set.
func (o *DeclareReq) HasDockerfile() bool {
if o != nil && !IsNil(o.Dockerfile) {
return true
}
return false
}
// SetDockerfile gets a reference to the given string and assigns it to the Dockerfile field.
func (o *DeclareReq) SetDockerfile(v string) {
o.Dockerfile = &v
}
// GetEnv returns the Env field value if set, zero value otherwise.
func (o *DeclareReq) GetEnv() []DeclareEnv {
if o == nil || IsNil(o.Env) {
var ret []DeclareEnv
return ret
}
return o.Env
}
// GetEnvOk returns a tuple with the Env field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetEnvOk() ([]DeclareEnv, bool) {
if o == nil || IsNil(o.Env) {
return nil, false
}
return o.Env, true
}
// HasEnv returns a boolean if a field has been set.
func (o *DeclareReq) HasEnv() bool {
if o != nil && !IsNil(o.Env) {
return true
}
return false
}
// SetEnv gets a reference to the given []DeclareEnv and assigns it to the Env field.
func (o *DeclareReq) SetEnv(v []DeclareEnv) {
o.Env = v
}
// GetHost returns the Host field value if set, zero value otherwise.
func (o *DeclareReq) GetHost() string {
if o == nil || IsNil(o.Host) {
var ret string
return ret
}
return *o.Host
}
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetHostOk() (*string, bool) {
if o == nil || IsNil(o.Host) {
return nil, false
}
return o.Host, true
}
// HasHost returns a boolean if a field has been set.
func (o *DeclareReq) HasHost() bool {
if o != nil && !IsNil(o.Host) {
return true
}
return false
}
// SetHost gets a reference to the given string and assigns it to the Host field.
func (o *DeclareReq) SetHost(v string) {
o.Host = &v
}
// GetMode returns the Mode field value if set, zero value otherwise.
func (o *DeclareReq) GetMode() string {
if o == nil || IsNil(o.Mode) {
var ret string
return ret
}
return *o.Mode
}
// GetModeOk returns a tuple with the Mode field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetModeOk() (*string, bool) {
if o == nil || IsNil(o.Mode) {
return nil, false
}
return o.Mode, true
}
// HasMode returns a boolean if a field has been set.
func (o *DeclareReq) HasMode() bool {
if o != nil && !IsNil(o.Mode) {
return true
}
return false
}
// SetMode gets a reference to the given string and assigns it to the Mode field.
func (o *DeclareReq) SetMode(v string) {
o.Mode = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *DeclareReq) 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 *DeclareReq) 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 *DeclareReq) 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 *DeclareReq) SetName(v string) {
o.Name = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *DeclareReq) GetOrg() string {
if o == nil || IsNil(o.Org) {
var ret string
return ret
}
return *o.Org
}
// GetOrgOk returns a tuple with the Org field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetOrgOk() (*string, bool) {
if o == nil || IsNil(o.Org) {
return nil, false
}
return o.Org, true
}
// HasOrg returns a boolean if a field has been set.
func (o *DeclareReq) HasOrg() bool {
if o != nil && !IsNil(o.Org) {
return true
}
return false
}
// SetOrg gets a reference to the given string and assigns it to the Org field.
func (o *DeclareReq) SetOrg(v string) {
o.Org = &v
}
// GetPartOf returns the PartOf field value if set, zero value otherwise.
func (o *DeclareReq) GetPartOf() string {
if o == nil || IsNil(o.PartOf) {
var ret string
return ret
}
return *o.PartOf
}
// GetPartOfOk returns a tuple with the PartOf field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetPartOfOk() (*string, bool) {
if o == nil || IsNil(o.PartOf) {
return nil, false
}
return o.PartOf, true
}
// HasPartOf returns a boolean if a field has been set.
func (o *DeclareReq) HasPartOf() bool {
if o != nil && !IsNil(o.PartOf) {
return true
}
return false
}
// SetPartOf gets a reference to the given string and assigns it to the PartOf field.
func (o *DeclareReq) SetPartOf(v string) {
o.PartOf = &v
}
// GetPort returns the Port field value if set, zero value otherwise.
func (o *DeclareReq) GetPort() int32 {
if o == nil || IsNil(o.Port) {
var ret int32
return ret
}
return *o.Port
}
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetPortOk() (*int32, bool) {
if o == nil || IsNil(o.Port) {
return nil, false
}
return o.Port, true
}
// HasPort returns a boolean if a field has been set.
func (o *DeclareReq) HasPort() bool {
if o != nil && !IsNil(o.Port) {
return true
}
return false
}
// SetPort gets a reference to the given int32 and assigns it to the Port field.
func (o *DeclareReq) SetPort(v int32) {
o.Port = &v
}
// GetRef returns the Ref field value if set, zero value otherwise.
func (o *DeclareReq) GetRef() string {
if o == nil || IsNil(o.Ref) {
var ret string
return ret
}
return *o.Ref
}
// GetRefOk returns a tuple with the Ref field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetRefOk() (*string, bool) {
if o == nil || IsNil(o.Ref) {
return nil, false
}
return o.Ref, true
}
// HasRef returns a boolean if a field has been set.
func (o *DeclareReq) HasRef() bool {
if o != nil && !IsNil(o.Ref) {
return true
}
return false
}
// SetRef gets a reference to the given string and assigns it to the Ref field.
func (o *DeclareReq) SetRef(v string) {
o.Ref = &v
}
// GetReplicas returns the Replicas field value if set, zero value otherwise.
func (o *DeclareReq) GetReplicas() int32 {
if o == nil || IsNil(o.Replicas) {
var ret int32
return ret
}
return *o.Replicas
}
// GetReplicasOk returns a tuple with the Replicas field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetReplicasOk() (*int32, bool) {
if o == nil || IsNil(o.Replicas) {
return nil, false
}
return o.Replicas, true
}
// HasReplicas returns a boolean if a field has been set.
func (o *DeclareReq) HasReplicas() bool {
if o != nil && !IsNil(o.Replicas) {
return true
}
return false
}
// SetReplicas gets a reference to the given int32 and assigns it to the Replicas field.
func (o *DeclareReq) SetReplicas(v int32) {
o.Replicas = &v
}
// GetRepo returns the Repo field value if set, zero value otherwise.
func (o *DeclareReq) GetRepo() string {
if o == nil || IsNil(o.Repo) {
var ret string
return ret
}
return *o.Repo
}
// GetRepoOk returns a tuple with the Repo field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetRepoOk() (*string, bool) {
if o == nil || IsNil(o.Repo) {
return nil, false
}
return o.Repo, true
}
// HasRepo returns a boolean if a field has been set.
func (o *DeclareReq) HasRepo() bool {
if o != nil && !IsNil(o.Repo) {
return true
}
return false
}
// SetRepo gets a reference to the given string and assigns it to the Repo field.
func (o *DeclareReq) SetRepo(v string) {
o.Repo = &v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *DeclareReq) GetTag() string {
if o == nil || IsNil(o.Tag) {
var ret string
return ret
}
return *o.Tag
}
// GetTagOk returns a tuple with the Tag field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeclareReq) GetTagOk() (*string, bool) {
if o == nil || IsNil(o.Tag) {
return nil, false
}
return o.Tag, true
}
// HasTag returns a boolean if a field has been set.
func (o *DeclareReq) HasTag() bool {
if o != nil && !IsNil(o.Tag) {
return true
}
return false
}
// SetTag gets a reference to the given string and assigns it to the Tag field.
func (o *DeclareReq) SetTag(v string) {
o.Tag = &v
}
func (o DeclareReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DeclareReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Build) {
toSerialize["build"] = o.Build
}
if !IsNil(o.Dockerfile) {
toSerialize["dockerfile"] = o.Dockerfile
}
if !IsNil(o.Env) {
toSerialize["env"] = o.Env
}
if !IsNil(o.Host) {
toSerialize["host"] = o.Host
}
if !IsNil(o.Mode) {
toSerialize["mode"] = o.Mode
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Org) {
toSerialize["org"] = o.Org
}
if !IsNil(o.PartOf) {
toSerialize["partOf"] = o.PartOf
}
if !IsNil(o.Port) {
toSerialize["port"] = o.Port
}
if !IsNil(o.Ref) {
toSerialize["ref"] = o.Ref
}
if !IsNil(o.Replicas) {
toSerialize["replicas"] = o.Replicas
}
if !IsNil(o.Repo) {
toSerialize["repo"] = o.Repo
}
if !IsNil(o.Tag) {
toSerialize["tag"] = o.Tag
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DeclareReq) UnmarshalJSON(data []byte) (err error) {
varDeclareReq := _DeclareReq{}
err = json.Unmarshal(data, &varDeclareReq)
if err != nil {
return err
}
*o = DeclareReq(varDeclareReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "build")
delete(additionalProperties, "dockerfile")
delete(additionalProperties, "env")
delete(additionalProperties, "host")
delete(additionalProperties, "mode")
delete(additionalProperties, "name")
delete(additionalProperties, "org")
delete(additionalProperties, "partOf")
delete(additionalProperties, "port")
delete(additionalProperties, "ref")
delete(additionalProperties, "replicas")
delete(additionalProperties, "repo")
delete(additionalProperties, "tag")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDeclareReq struct {
value *DeclareReq
isSet bool
}
func (v NullableDeclareReq) Get() *DeclareReq {
return v.value
}
func (v *NullableDeclareReq) Set(val *DeclareReq) {
v.value = val
v.isSet = true
}
func (v NullableDeclareReq) IsSet() bool {
return v.isSet
}
func (v *NullableDeclareReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeclareReq(val *DeclareReq) *NullableDeclareReq {
return &NullableDeclareReq{value: val, isSet: true}
}
func (v NullableDeclareReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeclareReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}