Files
sdk/model_secret_ref.go

265 lines
6.2 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 SecretRef type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &SecretRef{}
// SecretRef struct for SecretRef
type SecretRef struct {
Env *string `json:"env,omitempty"`
Keys []string `json:"keys,omitempty"`
Path *string `json:"path,omitempty"`
Project *string `json:"project,omitempty"`
AdditionalProperties map[string]interface{}
}
type _SecretRef SecretRef
// NewSecretRef instantiates a new SecretRef 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 NewSecretRef() *SecretRef {
this := SecretRef{}
return &this
}
// NewSecretRefWithDefaults instantiates a new SecretRef 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 NewSecretRefWithDefaults() *SecretRef {
this := SecretRef{}
return &this
}
// GetEnv returns the Env field value if set, zero value otherwise.
func (o *SecretRef) GetEnv() string {
if o == nil || IsNil(o.Env) {
var ret string
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 *SecretRef) GetEnvOk() (*string, 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 *SecretRef) HasEnv() bool {
if o != nil && !IsNil(o.Env) {
return true
}
return false
}
// SetEnv gets a reference to the given string and assigns it to the Env field.
func (o *SecretRef) SetEnv(v string) {
o.Env = &v
}
// GetKeys returns the Keys field value if set, zero value otherwise.
func (o *SecretRef) GetKeys() []string {
if o == nil || IsNil(o.Keys) {
var ret []string
return ret
}
return o.Keys
}
// GetKeysOk returns a tuple with the Keys field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *SecretRef) GetKeysOk() ([]string, bool) {
if o == nil || IsNil(o.Keys) {
return nil, false
}
return o.Keys, true
}
// HasKeys returns a boolean if a field has been set.
func (o *SecretRef) HasKeys() bool {
if o != nil && !IsNil(o.Keys) {
return true
}
return false
}
// SetKeys gets a reference to the given []string and assigns it to the Keys field.
func (o *SecretRef) SetKeys(v []string) {
o.Keys = v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *SecretRef) 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 *SecretRef) 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 *SecretRef) 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 *SecretRef) SetPath(v string) {
o.Path = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *SecretRef) 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 *SecretRef) 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 *SecretRef) 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 *SecretRef) SetProject(v string) {
o.Project = &v
}
func (o SecretRef) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o SecretRef) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Env) {
toSerialize["env"] = o.Env
}
if !IsNil(o.Keys) {
toSerialize["keys"] = o.Keys
}
if !IsNil(o.Path) {
toSerialize["path"] = o.Path
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *SecretRef) UnmarshalJSON(data []byte) (err error) {
varSecretRef := _SecretRef{}
err = json.Unmarshal(data, &varSecretRef)
if err != nil {
return err
}
*o = SecretRef(varSecretRef)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "env")
delete(additionalProperties, "keys")
delete(additionalProperties, "path")
delete(additionalProperties, "project")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableSecretRef struct {
value *SecretRef
isSet bool
}
func (v NullableSecretRef) Get() *SecretRef {
return v.value
}
func (v *NullableSecretRef) Set(val *SecretRef) {
v.value = val
v.isSet = true
}
func (v NullableSecretRef) IsSet() bool {
return v.isSet
}
func (v *NullableSecretRef) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSecretRef(val *SecretRef) *NullableSecretRef {
return &NullableSecretRef{value: val, isSet: true}
}
func (v NullableSecretRef) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSecretRef) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}