Files
sdk/model_declaration.go

672 lines
17 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 Declaration type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Declaration{}
// Declaration struct for Declaration
type Declaration struct {
Application *string `json:"application,omitempty"`
Automated *bool `json:"automated,omitempty"`
Component *string `json:"component,omitempty"`
Digest *string `json:"digest,omitempty"`
Env []DeclareEnv `json:"env,omitempty"`
Hosts []string `json:"hosts,omitempty"`
Name *string `json:"name,omitempty"`
Org *string `json:"org,omitempty"`
PartOf *string `json:"partOf,omitempty"`
Path *string `json:"path,omitempty"`
Project *string `json:"project,omitempty"`
Replicas *int32 `json:"replicas,omitempty"`
Repository *string `json:"repository,omitempty"`
Secrets []SecretRef `json:"secrets,omitempty"`
Tag *string `json:"tag,omitempty"`
AdditionalProperties map[string]interface{}
}
type _Declaration Declaration
// NewDeclaration instantiates a new Declaration 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 NewDeclaration() *Declaration {
this := Declaration{}
return &this
}
// NewDeclarationWithDefaults instantiates a new Declaration 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 NewDeclarationWithDefaults() *Declaration {
this := Declaration{}
return &this
}
// GetApplication returns the Application field value if set, zero value otherwise.
func (o *Declaration) GetApplication() string {
if o == nil || IsNil(o.Application) {
var ret string
return ret
}
return *o.Application
}
// GetApplicationOk returns a tuple with the Application field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Declaration) GetApplicationOk() (*string, bool) {
if o == nil || IsNil(o.Application) {
return nil, false
}
return o.Application, true
}
// HasApplication returns a boolean if a field has been set.
func (o *Declaration) HasApplication() bool {
if o != nil && !IsNil(o.Application) {
return true
}
return false
}
// SetApplication gets a reference to the given string and assigns it to the Application field.
func (o *Declaration) SetApplication(v string) {
o.Application = &v
}
// GetAutomated returns the Automated field value if set, zero value otherwise.
func (o *Declaration) GetAutomated() bool {
if o == nil || IsNil(o.Automated) {
var ret bool
return ret
}
return *o.Automated
}
// GetAutomatedOk returns a tuple with the Automated field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Declaration) GetAutomatedOk() (*bool, bool) {
if o == nil || IsNil(o.Automated) {
return nil, false
}
return o.Automated, true
}
// HasAutomated returns a boolean if a field has been set.
func (o *Declaration) HasAutomated() bool {
if o != nil && !IsNil(o.Automated) {
return true
}
return false
}
// SetAutomated gets a reference to the given bool and assigns it to the Automated field.
func (o *Declaration) SetAutomated(v bool) {
o.Automated = &v
}
// GetComponent returns the Component field value if set, zero value otherwise.
func (o *Declaration) GetComponent() string {
if o == nil || IsNil(o.Component) {
var ret string
return ret
}
return *o.Component
}
// GetComponentOk returns a tuple with the Component field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Declaration) GetComponentOk() (*string, bool) {
if o == nil || IsNil(o.Component) {
return nil, false
}
return o.Component, true
}
// HasComponent returns a boolean if a field has been set.
func (o *Declaration) HasComponent() bool {
if o != nil && !IsNil(o.Component) {
return true
}
return false
}
// SetComponent gets a reference to the given string and assigns it to the Component field.
func (o *Declaration) SetComponent(v string) {
o.Component = &v
}
// GetDigest returns the Digest field value if set, zero value otherwise.
func (o *Declaration) GetDigest() string {
if o == nil || IsNil(o.Digest) {
var ret string
return ret
}
return *o.Digest
}
// GetDigestOk returns a tuple with the Digest field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Declaration) GetDigestOk() (*string, bool) {
if o == nil || IsNil(o.Digest) {
return nil, false
}
return o.Digest, true
}
// HasDigest returns a boolean if a field has been set.
func (o *Declaration) HasDigest() bool {
if o != nil && !IsNil(o.Digest) {
return true
}
return false
}
// SetDigest gets a reference to the given string and assigns it to the Digest field.
func (o *Declaration) SetDigest(v string) {
o.Digest = &v
}
// GetEnv returns the Env field value if set, zero value otherwise.
func (o *Declaration) 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 *Declaration) 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 *Declaration) 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 *Declaration) SetEnv(v []DeclareEnv) {
o.Env = v
}
// GetHosts returns the Hosts field value if set, zero value otherwise.
func (o *Declaration) GetHosts() []string {
if o == nil || IsNil(o.Hosts) {
var ret []string
return ret
}
return o.Hosts
}
// GetHostsOk returns a tuple with the Hosts field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Declaration) GetHostsOk() ([]string, bool) {
if o == nil || IsNil(o.Hosts) {
return nil, false
}
return o.Hosts, true
}
// HasHosts returns a boolean if a field has been set.
func (o *Declaration) HasHosts() bool {
if o != nil && !IsNil(o.Hosts) {
return true
}
return false
}
// SetHosts gets a reference to the given []string and assigns it to the Hosts field.
func (o *Declaration) SetHosts(v []string) {
o.Hosts = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Declaration) 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 *Declaration) 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 *Declaration) 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 *Declaration) SetName(v string) {
o.Name = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *Declaration) 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 *Declaration) 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 *Declaration) 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 *Declaration) SetOrg(v string) {
o.Org = &v
}
// GetPartOf returns the PartOf field value if set, zero value otherwise.
func (o *Declaration) 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 *Declaration) 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 *Declaration) 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 *Declaration) SetPartOf(v string) {
o.PartOf = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *Declaration) GetPath() string {
if o == nil || IsNil(o.Path) {
var ret string
return ret
}
return *o.Path
}
// GetPathOk returns a tuple with the Path field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Declaration) GetPathOk() (*string, bool) {
if o == nil || IsNil(o.Path) {
return nil, false
}
return o.Path, true
}
// HasPath returns a boolean if a field has been set.
func (o *Declaration) HasPath() bool {
if o != nil && !IsNil(o.Path) {
return true
}
return false
}
// SetPath gets a reference to the given string and assigns it to the Path field.
func (o *Declaration) SetPath(v string) {
o.Path = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *Declaration) GetProject() string {
if o == nil || IsNil(o.Project) {
var ret string
return ret
}
return *o.Project
}
// GetProjectOk returns a tuple with the Project field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Declaration) GetProjectOk() (*string, bool) {
if o == nil || IsNil(o.Project) {
return nil, false
}
return o.Project, true
}
// HasProject returns a boolean if a field has been set.
func (o *Declaration) HasProject() bool {
if o != nil && !IsNil(o.Project) {
return true
}
return false
}
// SetProject gets a reference to the given string and assigns it to the Project field.
func (o *Declaration) SetProject(v string) {
o.Project = &v
}
// GetReplicas returns the Replicas field value if set, zero value otherwise.
func (o *Declaration) 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 *Declaration) 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 *Declaration) 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 *Declaration) SetReplicas(v int32) {
o.Replicas = &v
}
// GetRepository returns the Repository field value if set, zero value otherwise.
func (o *Declaration) GetRepository() string {
if o == nil || IsNil(o.Repository) {
var ret string
return ret
}
return *o.Repository
}
// GetRepositoryOk returns a tuple with the Repository field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Declaration) GetRepositoryOk() (*string, bool) {
if o == nil || IsNil(o.Repository) {
return nil, false
}
return o.Repository, true
}
// HasRepository returns a boolean if a field has been set.
func (o *Declaration) HasRepository() bool {
if o != nil && !IsNil(o.Repository) {
return true
}
return false
}
// SetRepository gets a reference to the given string and assigns it to the Repository field.
func (o *Declaration) SetRepository(v string) {
o.Repository = &v
}
// GetSecrets returns the Secrets field value if set, zero value otherwise.
func (o *Declaration) GetSecrets() []SecretRef {
if o == nil || IsNil(o.Secrets) {
var ret []SecretRef
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 *Declaration) GetSecretsOk() ([]SecretRef, 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 *Declaration) HasSecrets() bool {
if o != nil && !IsNil(o.Secrets) {
return true
}
return false
}
// SetSecrets gets a reference to the given []SecretRef and assigns it to the Secrets field.
func (o *Declaration) SetSecrets(v []SecretRef) {
o.Secrets = v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *Declaration) 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 *Declaration) 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 *Declaration) 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 *Declaration) SetTag(v string) {
o.Tag = &v
}
func (o Declaration) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Declaration) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Application) {
toSerialize["application"] = o.Application
}
if !IsNil(o.Automated) {
toSerialize["automated"] = o.Automated
}
if !IsNil(o.Component) {
toSerialize["component"] = o.Component
}
if !IsNil(o.Digest) {
toSerialize["digest"] = o.Digest
}
if !IsNil(o.Env) {
toSerialize["env"] = o.Env
}
if !IsNil(o.Hosts) {
toSerialize["hosts"] = o.Hosts
}
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.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Replicas) {
toSerialize["replicas"] = o.Replicas
}
if !IsNil(o.Repository) {
toSerialize["repository"] = o.Repository
}
if !IsNil(o.Secrets) {
toSerialize["secrets"] = o.Secrets
}
if !IsNil(o.Tag) {
toSerialize["tag"] = o.Tag
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *Declaration) UnmarshalJSON(data []byte) (err error) {
varDeclaration := _Declaration{}
err = json.Unmarshal(data, &varDeclaration)
if err != nil {
return err
}
*o = Declaration(varDeclaration)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "application")
delete(additionalProperties, "automated")
delete(additionalProperties, "component")
delete(additionalProperties, "digest")
delete(additionalProperties, "env")
delete(additionalProperties, "hosts")
delete(additionalProperties, "name")
delete(additionalProperties, "org")
delete(additionalProperties, "partOf")
delete(additionalProperties, "path")
delete(additionalProperties, "project")
delete(additionalProperties, "replicas")
delete(additionalProperties, "repository")
delete(additionalProperties, "secrets")
delete(additionalProperties, "tag")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDeclaration struct {
value *Declaration
isSet bool
}
func (v NullableDeclaration) Get() *Declaration {
return v.value
}
func (v *NullableDeclaration) Set(val *Declaration) {
v.value = val
v.isSet = true
}
func (v NullableDeclaration) IsSet() bool {
return v.isSet
}
func (v *NullableDeclaration) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeclaration(val *Declaration) *NullableDeclaration {
return &NullableDeclaration{value: val, isSet: true}
}
func (v NullableDeclaration) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeclaration) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}