garage-admin-sdk-golang/model_cluster_layout.go
2022-11-13 14:22:00 +01:00

166 lines
4.5 KiB
Go

/*
Garage Administration API v0+garage-v0.8.0
Administrate your Garage cluster programatically, including status, layout, keys, buckets, and maintainance tasks. *Disclaimer: The API is not stable yet, hence its v0 tag. The API can change at any time, and changes can include breaking backward compatibility. Read the changelog and upgrade your scripts before upgrading. Additionnaly, this specification is very early stage and can contain bugs, especially on error return codes/types that are not tested yet. Do not expect a well finished and polished product!*
API version: v0.8.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package garage
import (
"encoding/json"
)
// ClusterLayout struct for ClusterLayout
type ClusterLayout struct {
Version int32 `json:"version"`
Roles map[string]NodeClusterInfo `json:"roles"`
StagedRoleChanges map[string]NodeClusterInfo `json:"stagedRoleChanges"`
}
// NewClusterLayout instantiates a new ClusterLayout 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 NewClusterLayout(version int32, roles map[string]NodeClusterInfo, stagedRoleChanges map[string]NodeClusterInfo) *ClusterLayout {
this := ClusterLayout{}
this.Version = version
this.Roles = roles
this.StagedRoleChanges = stagedRoleChanges
return &this
}
// NewClusterLayoutWithDefaults instantiates a new ClusterLayout 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 NewClusterLayoutWithDefaults() *ClusterLayout {
this := ClusterLayout{}
return &this
}
// GetVersion returns the Version field value
func (o *ClusterLayout) GetVersion() int32 {
if o == nil {
var ret int32
return ret
}
return o.Version
}
// GetVersionOk returns a tuple with the Version field value
// and a boolean to check if the value has been set.
func (o *ClusterLayout) GetVersionOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.Version, true
}
// SetVersion sets field value
func (o *ClusterLayout) SetVersion(v int32) {
o.Version = v
}
// GetRoles returns the Roles field value
func (o *ClusterLayout) GetRoles() map[string]NodeClusterInfo {
if o == nil {
var ret map[string]NodeClusterInfo
return ret
}
return o.Roles
}
// GetRolesOk returns a tuple with the Roles field value
// and a boolean to check if the value has been set.
func (o *ClusterLayout) GetRolesOk() (*map[string]NodeClusterInfo, bool) {
if o == nil {
return nil, false
}
return &o.Roles, true
}
// SetRoles sets field value
func (o *ClusterLayout) SetRoles(v map[string]NodeClusterInfo) {
o.Roles = v
}
// GetStagedRoleChanges returns the StagedRoleChanges field value
func (o *ClusterLayout) GetStagedRoleChanges() map[string]NodeClusterInfo {
if o == nil {
var ret map[string]NodeClusterInfo
return ret
}
return o.StagedRoleChanges
}
// GetStagedRoleChangesOk returns a tuple with the StagedRoleChanges field value
// and a boolean to check if the value has been set.
func (o *ClusterLayout) GetStagedRoleChangesOk() (*map[string]NodeClusterInfo, bool) {
if o == nil {
return nil, false
}
return &o.StagedRoleChanges, true
}
// SetStagedRoleChanges sets field value
func (o *ClusterLayout) SetStagedRoleChanges(v map[string]NodeClusterInfo) {
o.StagedRoleChanges = v
}
func (o ClusterLayout) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["version"] = o.Version
}
if true {
toSerialize["roles"] = o.Roles
}
if true {
toSerialize["stagedRoleChanges"] = o.StagedRoleChanges
}
return json.Marshal(toSerialize)
}
type NullableClusterLayout struct {
value *ClusterLayout
isSet bool
}
func (v NullableClusterLayout) Get() *ClusterLayout {
return v.value
}
func (v *NullableClusterLayout) Set(val *ClusterLayout) {
v.value = val
v.isSet = true
}
func (v NullableClusterLayout) IsSet() bool {
return v.isSet
}
func (v *NullableClusterLayout) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableClusterLayout(val *ClusterLayout) *NullableClusterLayout {
return &NullableClusterLayout{value: val, isSet: true}
}
func (v NullableClusterLayout) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableClusterLayout) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}