Files
sdk/model_platform_env_var_json.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 PlatformEnvVarJSON type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformEnvVarJSON{}
// PlatformEnvVarJSON struct for PlatformEnvVarJSON
type PlatformEnvVarJSON struct {
// Key is the variable's name in the container, which must match `^[A-Za-z_][A-Za-z0-9_]*$`. For a sealed value it is also the last segment of the KMS ref, so it is what identifies the value across a round trip.
Key *string `json:"key,omitempty"`
// Secret says the value lives in KMS and never in the database. A caller may only ADD secrecy: the server seals a value whose key or shape looks like a credential anyway (secretshape.go), so an entry can come back secret that was not sent that way.
Secret *bool `json:"secret,omitempty"`
// Value is the plaintext, and it is WRITE-ONLY once the entry is secret: a sealed value reads back as \"\", and sending \"\" again KEEPS what is sealed rather than wiping it. Only a non-empty value seals a new one.
Value *string `json:"value,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformEnvVarJSON PlatformEnvVarJSON
// NewPlatformEnvVarJSON instantiates a new PlatformEnvVarJSON 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 NewPlatformEnvVarJSON() *PlatformEnvVarJSON {
this := PlatformEnvVarJSON{}
return &this
}
// NewPlatformEnvVarJSONWithDefaults instantiates a new PlatformEnvVarJSON 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 NewPlatformEnvVarJSONWithDefaults() *PlatformEnvVarJSON {
this := PlatformEnvVarJSON{}
return &this
}
// GetKey returns the Key field value if set, zero value otherwise.
func (o *PlatformEnvVarJSON) GetKey() string {
if o == nil || IsNil(o.Key) {
var ret string
return ret
}
return *o.Key
}
// GetKeyOk returns a tuple with the Key field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformEnvVarJSON) GetKeyOk() (*string, bool) {
if o == nil || IsNil(o.Key) {
return nil, false
}
return o.Key, true
}
// HasKey returns a boolean if a field has been set.
func (o *PlatformEnvVarJSON) HasKey() bool {
if o != nil && !IsNil(o.Key) {
return true
}
return false
}
// SetKey gets a reference to the given string and assigns it to the Key field.
func (o *PlatformEnvVarJSON) SetKey(v string) {
o.Key = &v
}
// GetSecret returns the Secret field value if set, zero value otherwise.
func (o *PlatformEnvVarJSON) GetSecret() bool {
if o == nil || IsNil(o.Secret) {
var ret bool
return ret
}
return *o.Secret
}
// GetSecretOk returns a tuple with the Secret field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformEnvVarJSON) GetSecretOk() (*bool, bool) {
if o == nil || IsNil(o.Secret) {
return nil, false
}
return o.Secret, true
}
// HasSecret returns a boolean if a field has been set.
func (o *PlatformEnvVarJSON) HasSecret() bool {
if o != nil && !IsNil(o.Secret) {
return true
}
return false
}
// SetSecret gets a reference to the given bool and assigns it to the Secret field.
func (o *PlatformEnvVarJSON) SetSecret(v bool) {
o.Secret = &v
}
// GetValue returns the Value field value if set, zero value otherwise.
func (o *PlatformEnvVarJSON) GetValue() string {
if o == nil || IsNil(o.Value) {
var ret string
return ret
}
return *o.Value
}
// GetValueOk returns a tuple with the Value field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformEnvVarJSON) GetValueOk() (*string, bool) {
if o == nil || IsNil(o.Value) {
return nil, false
}
return o.Value, true
}
// HasValue returns a boolean if a field has been set.
func (o *PlatformEnvVarJSON) HasValue() bool {
if o != nil && !IsNil(o.Value) {
return true
}
return false
}
// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *PlatformEnvVarJSON) SetValue(v string) {
o.Value = &v
}
func (o PlatformEnvVarJSON) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformEnvVarJSON) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Key) {
toSerialize["key"] = o.Key
}
if !IsNil(o.Secret) {
toSerialize["secret"] = o.Secret
}
if !IsNil(o.Value) {
toSerialize["value"] = o.Value
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformEnvVarJSON) UnmarshalJSON(data []byte) (err error) {
varPlatformEnvVarJSON := _PlatformEnvVarJSON{}
err = json.Unmarshal(data, &varPlatformEnvVarJSON)
if err != nil {
return err
}
*o = PlatformEnvVarJSON(varPlatformEnvVarJSON)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "key")
delete(additionalProperties, "secret")
delete(additionalProperties, "value")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformEnvVarJSON struct {
value *PlatformEnvVarJSON
isSet bool
}
func (v NullablePlatformEnvVarJSON) Get() *PlatformEnvVarJSON {
return v.value
}
func (v *NullablePlatformEnvVarJSON) Set(val *PlatformEnvVarJSON) {
v.value = val
v.isSet = true
}
func (v NullablePlatformEnvVarJSON) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformEnvVarJSON) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformEnvVarJSON(val *PlatformEnvVarJSON) *NullablePlatformEnvVarJSON {
return &NullablePlatformEnvVarJSON{value: val, isSet: true}
}
func (v NullablePlatformEnvVarJSON) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformEnvVarJSON) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}