Files
sdk/model_platform_secret_ref.go

269 lines
6.8 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 PlatformSecretRef type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformSecretRef{}
// PlatformSecretRef struct for PlatformSecretRef
type PlatformSecretRef struct {
// Env is the KMS environment slug.
Env *string `json:"env,omitempty"`
// Keys are the names read from the path; empty means the whole path.
Keys []string `json:"keys,omitempty"`
// Path is the secret path, always absolute.
Path *string `json:"path,omitempty"`
// Project is the KMS project slug the path lives in.
Project *string `json:"project,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformSecretRef PlatformSecretRef
// NewPlatformSecretRef instantiates a new PlatformSecretRef 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 NewPlatformSecretRef() *PlatformSecretRef {
this := PlatformSecretRef{}
return &this
}
// NewPlatformSecretRefWithDefaults instantiates a new PlatformSecretRef 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 NewPlatformSecretRefWithDefaults() *PlatformSecretRef {
this := PlatformSecretRef{}
return &this
}
// GetEnv returns the Env field value if set, zero value otherwise.
func (o *PlatformSecretRef) 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 *PlatformSecretRef) 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 *PlatformSecretRef) 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 *PlatformSecretRef) SetEnv(v string) {
o.Env = &v
}
// GetKeys returns the Keys field value if set, zero value otherwise.
func (o *PlatformSecretRef) 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 *PlatformSecretRef) 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 *PlatformSecretRef) 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 *PlatformSecretRef) SetKeys(v []string) {
o.Keys = v
}
// GetPath returns the Path field value if set, zero value otherwise.
func (o *PlatformSecretRef) 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 *PlatformSecretRef) 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 *PlatformSecretRef) 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 *PlatformSecretRef) SetPath(v string) {
o.Path = &v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *PlatformSecretRef) 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 *PlatformSecretRef) 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 *PlatformSecretRef) 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 *PlatformSecretRef) SetProject(v string) {
o.Project = &v
}
func (o PlatformSecretRef) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformSecretRef) 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 *PlatformSecretRef) UnmarshalJSON(data []byte) (err error) {
varPlatformSecretRef := _PlatformSecretRef{}
err = json.Unmarshal(data, &varPlatformSecretRef)
if err != nil {
return err
}
*o = PlatformSecretRef(varPlatformSecretRef)
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 NullablePlatformSecretRef struct {
value *PlatformSecretRef
isSet bool
}
func (v NullablePlatformSecretRef) Get() *PlatformSecretRef {
return v.value
}
func (v *NullablePlatformSecretRef) Set(val *PlatformSecretRef) {
v.value = val
v.isSet = true
}
func (v NullablePlatformSecretRef) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformSecretRef) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformSecretRef(val *PlatformSecretRef) *NullablePlatformSecretRef {
return &NullablePlatformSecretRef{value: val, isSet: true}
}
func (v NullablePlatformSecretRef) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformSecretRef) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}