Files
sdk/model_platform_set_env_req.go

231 lines
6.1 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 PlatformSetEnvReq type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformSetEnvReq{}
// PlatformSetEnvReq struct for PlatformSetEnvReq
type PlatformSetEnvReq struct {
// App is the application's slug, from the path.
App *string `json:"app,omitempty"`
// Env is the app's whole environment set, REPLACING what it had. Keys must match `^[A-Za-z_][A-Za-z0-9_]*$`; a variable marked `secret: true` is sealed into KMS and blanked in the database.
Env []PlatformEnvVarJSON `json:"env,omitempty"`
// Project is the project the application lives under, from the path.
Project *string `json:"project,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformSetEnvReq PlatformSetEnvReq
// NewPlatformSetEnvReq instantiates a new PlatformSetEnvReq 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 NewPlatformSetEnvReq() *PlatformSetEnvReq {
this := PlatformSetEnvReq{}
return &this
}
// NewPlatformSetEnvReqWithDefaults instantiates a new PlatformSetEnvReq 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 NewPlatformSetEnvReqWithDefaults() *PlatformSetEnvReq {
this := PlatformSetEnvReq{}
return &this
}
// GetApp returns the App field value if set, zero value otherwise.
func (o *PlatformSetEnvReq) GetApp() string {
if o == nil || IsNil(o.App) {
var ret string
return ret
}
return *o.App
}
// GetAppOk returns a tuple with the App field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformSetEnvReq) GetAppOk() (*string, bool) {
if o == nil || IsNil(o.App) {
return nil, false
}
return o.App, true
}
// HasApp returns a boolean if a field has been set.
func (o *PlatformSetEnvReq) HasApp() bool {
if o != nil && !IsNil(o.App) {
return true
}
return false
}
// SetApp gets a reference to the given string and assigns it to the App field.
func (o *PlatformSetEnvReq) SetApp(v string) {
o.App = &v
}
// GetEnv returns the Env field value if set, zero value otherwise.
func (o *PlatformSetEnvReq) GetEnv() []PlatformEnvVarJSON {
if o == nil || IsNil(o.Env) {
var ret []PlatformEnvVarJSON
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 *PlatformSetEnvReq) GetEnvOk() ([]PlatformEnvVarJSON, 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 *PlatformSetEnvReq) HasEnv() bool {
if o != nil && !IsNil(o.Env) {
return true
}
return false
}
// SetEnv gets a reference to the given []PlatformEnvVarJSON and assigns it to the Env field.
func (o *PlatformSetEnvReq) SetEnv(v []PlatformEnvVarJSON) {
o.Env = v
}
// GetProject returns the Project field value if set, zero value otherwise.
func (o *PlatformSetEnvReq) 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 *PlatformSetEnvReq) 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 *PlatformSetEnvReq) 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 *PlatformSetEnvReq) SetProject(v string) {
o.Project = &v
}
func (o PlatformSetEnvReq) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformSetEnvReq) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.App) {
toSerialize["app"] = o.App
}
if !IsNil(o.Env) {
toSerialize["env"] = o.Env
}
if !IsNil(o.Project) {
toSerialize["project"] = o.Project
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformSetEnvReq) UnmarshalJSON(data []byte) (err error) {
varPlatformSetEnvReq := _PlatformSetEnvReq{}
err = json.Unmarshal(data, &varPlatformSetEnvReq)
if err != nil {
return err
}
*o = PlatformSetEnvReq(varPlatformSetEnvReq)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "app")
delete(additionalProperties, "env")
delete(additionalProperties, "project")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformSetEnvReq struct {
value *PlatformSetEnvReq
isSet bool
}
func (v NullablePlatformSetEnvReq) Get() *PlatformSetEnvReq {
return v.value
}
func (v *NullablePlatformSetEnvReq) Set(val *PlatformSetEnvReq) {
v.value = val
v.isSet = true
}
func (v NullablePlatformSetEnvReq) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformSetEnvReq) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformSetEnvReq(val *PlatformSetEnvReq) *NullablePlatformSetEnvReq {
return &NullablePlatformSetEnvReq{value: val, isSet: true}
}
func (v NullablePlatformSetEnvReq) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformSetEnvReq) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}