Files
sdk/model_platform_environment_board.go

155 lines
4.5 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 PlatformEnvironmentBoard type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlatformEnvironmentBoard{}
// PlatformEnvironmentBoard struct for PlatformEnvironmentBoard
type PlatformEnvironmentBoard struct {
// Environments are the org's deploy targets, in first-seen order.
Environments []PlatformEnvironmentRow `json:"environments,omitempty"`
AdditionalProperties map[string]interface{}
}
type _PlatformEnvironmentBoard PlatformEnvironmentBoard
// NewPlatformEnvironmentBoard instantiates a new PlatformEnvironmentBoard 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 NewPlatformEnvironmentBoard() *PlatformEnvironmentBoard {
this := PlatformEnvironmentBoard{}
return &this
}
// NewPlatformEnvironmentBoardWithDefaults instantiates a new PlatformEnvironmentBoard 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 NewPlatformEnvironmentBoardWithDefaults() *PlatformEnvironmentBoard {
this := PlatformEnvironmentBoard{}
return &this
}
// GetEnvironments returns the Environments field value if set, zero value otherwise.
func (o *PlatformEnvironmentBoard) GetEnvironments() []PlatformEnvironmentRow {
if o == nil || IsNil(o.Environments) {
var ret []PlatformEnvironmentRow
return ret
}
return o.Environments
}
// GetEnvironmentsOk returns a tuple with the Environments field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlatformEnvironmentBoard) GetEnvironmentsOk() ([]PlatformEnvironmentRow, bool) {
if o == nil || IsNil(o.Environments) {
return nil, false
}
return o.Environments, true
}
// HasEnvironments returns a boolean if a field has been set.
func (o *PlatformEnvironmentBoard) HasEnvironments() bool {
if o != nil && !IsNil(o.Environments) {
return true
}
return false
}
// SetEnvironments gets a reference to the given []PlatformEnvironmentRow and assigns it to the Environments field.
func (o *PlatformEnvironmentBoard) SetEnvironments(v []PlatformEnvironmentRow) {
o.Environments = v
}
func (o PlatformEnvironmentBoard) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlatformEnvironmentBoard) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Environments) {
toSerialize["environments"] = o.Environments
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *PlatformEnvironmentBoard) UnmarshalJSON(data []byte) (err error) {
varPlatformEnvironmentBoard := _PlatformEnvironmentBoard{}
err = json.Unmarshal(data, &varPlatformEnvironmentBoard)
if err != nil {
return err
}
*o = PlatformEnvironmentBoard(varPlatformEnvironmentBoard)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "environments")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullablePlatformEnvironmentBoard struct {
value *PlatformEnvironmentBoard
isSet bool
}
func (v NullablePlatformEnvironmentBoard) Get() *PlatformEnvironmentBoard {
return v.value
}
func (v *NullablePlatformEnvironmentBoard) Set(val *PlatformEnvironmentBoard) {
v.value = val
v.isSet = true
}
func (v NullablePlatformEnvironmentBoard) IsSet() bool {
return v.isSet
}
func (v *NullablePlatformEnvironmentBoard) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlatformEnvironmentBoard(val *PlatformEnvironmentBoard) *NullablePlatformEnvironmentBoard {
return &NullablePlatformEnvironmentBoard{value: val, isSet: true}
}
func (v NullablePlatformEnvironmentBoard) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlatformEnvironmentBoard) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}