Files
sdk/model_platform_declared.go

723 lines
20 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 PlatformDeclared type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformDeclared{}
// PlatformDeclared struct for PlatformDeclared
type PlatformDeclared struct {
// Application is the CD Application name the generator mints from the path — the directory joined to the file name, less any words the two share (applicationName). It is how cd.hanzo.ai names the app.
Application *string `json:"application,omitempty"`
// Automated is cd.automated: false means the Application reports drift and NOTHING moves. It is off by default for a new file on purpose.
Automated *bool `json:"automated,omitempty"`
Cd *PlatformCDApp `json:"cd,omitempty"`
// Component is the app's role within its project (`component`), \"\" when unnamed.
Component *string `json:"component,omitempty"`
// image.digest — wins over tag
Digest *string `json:"digest,omitempty"`
// Env is the declared container environment, as the chart's list of {name,value}. It is read back so a re-declare of an identical body is a no-op rather than a refusal — idempotency is what makes a retry safe.
Env []PlatformDeclareEnv `json:"env,omitempty"`
// ingress.hosts, both shapes flattened
Hosts []string `json:"hosts,omitempty"`
// the Helm release name — the file's basename
Name *string `json:"name,omitempty"`
// Org is the owner. It is ALSO the values directory and the destination namespace, because those are one value under one name — see the header.
Org *string `json:"org,omitempty"`
// PartOf is the platform project this app belongs to: the values file's own `partOf` key, which the chart also stamps on every object it renders as app.kubernetes.io/part-of. It is the ONE declaration of membership — there is no project table — and \"\" means the file names none.
PartOf *string `json:"partOf,omitempty"`
// Path is the file, relative to the repository root.
Path *string `json:"path,omitempty"`
// Project is the AppProject the sync is admitted under, derived from the directory exactly as the ApplicationSet derives it. It differs from Org for a reserved directory, which syncs under the platform fence.
Project *string `json:"project,omitempty"`
Replicas *int64 `json:"replicas,omitempty"`
// image.repository
Repository *string `json:"repository,omitempty"`
// Secrets are the KMS coordinates the app reads — kmsSecrets and secrets.paths — as paths and key names. A values file never carries a secret value, so neither does this.
Secrets []PlatformSecretRef `json:"secrets,omitempty"`
// image.tag
Tag *string `json:"tag,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformDeclared PlatformDeclared
// NewPlatformDeclared instantiates a new PlatformDeclared 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 NewPlatformDeclared() *PlatformDeclared {
this := PlatformDeclared{}
return &this
}
// NewPlatformDeclaredWithDefaults instantiates a new PlatformDeclared 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 NewPlatformDeclaredWithDefaults() *PlatformDeclared {
this := PlatformDeclared{}
return &this
}
// GetApplication returns the Application field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetApplication(v string) {
o.Application = &v
}
// GetAutomated returns the Automated field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetAutomated(v bool) {
o.Automated = &v
}
// GetCd returns the Cd field value if set, zero value otherwise.
func (o *PlatformDeclared) GetCd() PlatformCDApp {
if o == nil || IsNil(o.Cd) {
var ret PlatformCDApp
return ret
}
return *o.Cd
}
// GetCdOk returns a tuple with the Cd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformDeclared) GetCdOk() (*PlatformCDApp, bool) {
if o == nil || IsNil(o.Cd) {
return nil, false
}
return o.Cd, true
}
// HasCd returns a boolean if a field has been set.
func (o *PlatformDeclared) HasCd() bool {
if o != nil && !IsNil(o.Cd) {
return true
}
return false
}
// SetCd gets a reference to the given PlatformCDApp and assigns it to the Cd field.
func (o *PlatformDeclared) SetCd(v PlatformCDApp) {
o.Cd = &v
}
// GetComponent returns the Component field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetComponent(v string) {
o.Component = &v
}
// GetDigest returns the Digest field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetDigest(v string) {
o.Digest = &v
}
// GetEnv returns the Env field value if set, zero value otherwise.
func (o *PlatformDeclared) GetEnv() []PlatformDeclareEnv {
if o == nil || IsNil(o.Env) {
var ret []PlatformDeclareEnv
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 *PlatformDeclared) GetEnvOk() ([]PlatformDeclareEnv, 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 *PlatformDeclared) HasEnv() bool {
if o != nil && !IsNil(o.Env) {
return true
}
return false
}
// SetEnv gets a reference to the given []PlatformDeclareEnv and assigns it to the Env field.
func (o *PlatformDeclared) SetEnv(v []PlatformDeclareEnv) {
o.Env = v
}
// GetHosts returns the Hosts field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetHosts(v []string) {
o.Hosts = v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetName(v string) {
o.Name = &v
}
// GetOrg returns the Org field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetOrg(v string) {
o.Org = &v
}
// GetPartOf returns the PartOf field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetPartOf(v string) {
o.PartOf = &v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetPath(v string) {
o.Path = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetProject(v string) {
o.Project = &v
}
// GetReplicas returns the Replicas field value if set, zero value otherwise.
func (o *PlatformDeclared) GetReplicas() int64 {
if o == nil || IsNil(o.Replicas) {
var ret int64
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 *PlatformDeclared) GetReplicasOk() (*int64, 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 *PlatformDeclared) HasReplicas() bool {
if o != nil && !IsNil(o.Replicas) {
return true
}
return false
}
// SetReplicas gets a reference to the given int64 and assigns it to the Replicas field.
func (o *PlatformDeclared) SetReplicas(v int64) {
o.Replicas = &v
}
// GetRepository returns the Repository field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetRepository(v string) {
o.Repository = &v
}
// GetSecrets returns the Secrets field value if set, zero value otherwise.
func (o *PlatformDeclared) GetSecrets() []PlatformSecretRef {
if o == nil || IsNil(o.Secrets) {
var ret []PlatformSecretRef
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 *PlatformDeclared) GetSecretsOk() ([]PlatformSecretRef, 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 *PlatformDeclared) HasSecrets() bool {
if o != nil && !IsNil(o.Secrets) {
return true
}
return false
}
// SetSecrets gets a reference to the given []PlatformSecretRef and assigns it to the Secrets field.
func (o *PlatformDeclared) SetSecrets(v []PlatformSecretRef) {
o.Secrets = v
}
// GetTag returns the Tag field value if set, zero value otherwise.
func (o *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) 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 *PlatformDeclared) SetTag(v string) {
o.Tag = &v
}
func (o PlatformDeclared) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformDeclared) 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.Cd) {
toSerialize["cd"] = o.Cd
}
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 *PlatformDeclared) UnmarshalJSON(data []byte) (err error) {
varPlatformDeclared := _PlatformDeclared{}
err = json.Unmarshal(data, &varPlatformDeclared)
if err != nil {
return err
}
*o = PlatformDeclared(varPlatformDeclared)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "application")
delete(additionalProperties, "automated")
delete(additionalProperties, "cd")
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 NullablePlatformDeclared struct {
value *PlatformDeclared
isSet bool
}
func (v NullablePlatformDeclared) Get() *PlatformDeclared {
return v.value
}
func (v *NullablePlatformDeclared) Set(val *PlatformDeclared) {
v.value = val
v.isSet = true
}
func (v NullablePlatformDeclared) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformDeclared) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformDeclared(val *PlatformDeclared) *NullablePlatformDeclared {
return &NullablePlatformDeclared{value: val, isSet: true}
}
func (v NullablePlatformDeclared) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformDeclared) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}