Files
sdk/model_deploy_argo_spec.go

231 lines
6.4 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 DeployArgoSpec type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DeployArgoSpec{}
// DeployArgoSpec struct for DeployArgoSpec
type DeployArgoSpec struct {
// Destination is which cluster and namespace it lands in. Zero-valued on a CD row: this projection reports CD's source, not its destination.
Destination *DeployArgoDestination `json:"destination,omitempty"`
// Project is the AppProject this application is grouped and filtered under. For an App CR it is the app.kubernetes.io/part-of label — the IAM project name — falling back to \"default\" when the CR carries no such label.
Project *string `json:"project,omitempty"`
// Source is where the desired state is declared.
Source *DeployArgoSource `json:"source,omitempty"`
AdditionalProperties map[string]interface{}
}
type _DeployArgoSpec DeployArgoSpec
// NewDeployArgoSpec instantiates a new DeployArgoSpec 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 NewDeployArgoSpec() *DeployArgoSpec {
this := DeployArgoSpec{}
return &this
}
// NewDeployArgoSpecWithDefaults instantiates a new DeployArgoSpec 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 NewDeployArgoSpecWithDefaults() *DeployArgoSpec {
this := DeployArgoSpec{}
return &this
}
// GetDestination returns the Destination field value if set, zero value otherwise.
func (o *DeployArgoSpec) GetDestination() DeployArgoDestination {
if o == nil || IsNil(o.Destination) {
var ret DeployArgoDestination
return ret
}
return *o.Destination
}
// GetDestinationOk returns a tuple with the Destination field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeployArgoSpec) GetDestinationOk() (*DeployArgoDestination, bool) {
if o == nil || IsNil(o.Destination) {
return nil, false
}
return o.Destination, true
}
// HasDestination returns a boolean if a field has been set.
func (o *DeployArgoSpec) HasDestination() bool {
if o != nil && !IsNil(o.Destination) {
return true
}
return false
}
// SetDestination gets a reference to the given DeployArgoDestination and assigns it to the Destination field.
func (o *DeployArgoSpec) SetDestination(v DeployArgoDestination) {
o.Destination = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *DeployArgoSpec) 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 *DeployArgoSpec) 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 *DeployArgoSpec) 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 *DeployArgoSpec) SetProject(v string) {
o.Project = &v
}
// GetSource returns the Source field value if set, zero value otherwise.
func (o *DeployArgoSpec) GetSource() DeployArgoSource {
if o == nil || IsNil(o.Source) {
var ret DeployArgoSource
return ret
}
return *o.Source
}
// GetSourceOk returns a tuple with the Source field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DeployArgoSpec) GetSourceOk() (*DeployArgoSource, bool) {
if o == nil || IsNil(o.Source) {
return nil, false
}
return o.Source, true
}
// HasSource returns a boolean if a field has been set.
func (o *DeployArgoSpec) HasSource() bool {
if o != nil && !IsNil(o.Source) {
return true
}
return false
}
// SetSource gets a reference to the given DeployArgoSource and assigns it to the Source field.
func (o *DeployArgoSpec) SetSource(v DeployArgoSource) {
o.Source = &v
}
func (o DeployArgoSpec) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DeployArgoSpec) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Destination) {
toSerialize["destination"] = o.Destination
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
if !IsNil(o.Source) {
toSerialize["source"] = o.Source
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *DeployArgoSpec) UnmarshalJSON(data []byte) (err error) {
varDeployArgoSpec := _DeployArgoSpec{}
err = json.Unmarshal(data, &varDeployArgoSpec)
if err != nil {
return err
}
*o = DeployArgoSpec(varDeployArgoSpec)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "destination")
delete(additionalProperties, "project")
delete(additionalProperties, "source")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableDeployArgoSpec struct {
value *DeployArgoSpec
isSet bool
}
func (v NullableDeployArgoSpec) Get() *DeployArgoSpec {
return v.value
}
func (v *NullableDeployArgoSpec) Set(val *DeployArgoSpec) {
v.value = val
v.isSet = true
}
func (v NullableDeployArgoSpec) IsSet() bool {
return v.isSet
}
func (v *NullableDeployArgoSpec) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDeployArgoSpec(val *DeployArgoSpec) *NullableDeployArgoSpec {
return &NullableDeployArgoSpec{value: val, isSet: true}
}
func (v NullableDeployArgoSpec) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDeployArgoSpec) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}