garage-admin-sdk-golang/model_cluster_layout.go

167 lines
4.4 KiB
Go
Raw Normal View History

2022-11-13 13:22:00 +00:00
/*
2023-11-22 17:28:14 +00:00
Garage Administration API v0+garage-v0.9.0
2022-11-13 13:22:00 +00:00
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!*
2023-11-22 17:28:14 +00:00
API version: v0.9.0
2022-11-13 13:22:00 +00:00
*/
// 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"`
2023-11-22 17:28:14 +00:00
Roles []NodeClusterInfo `json:"roles"`
StagedRoleChanges []NodeRoleChange `json:"stagedRoleChanges"`
2022-11-13 13:22:00 +00:00
}
// 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
2023-11-22 17:28:14 +00:00
func NewClusterLayout(version int32, roles []NodeClusterInfo, stagedRoleChanges []NodeRoleChange) *ClusterLayout {
2022-11-13 13:22:00 +00:00
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
2023-11-22 17:28:14 +00:00
func (o *ClusterLayout) GetRoles() []NodeClusterInfo {
2022-11-13 13:22:00 +00:00
if o == nil {
2023-11-22 17:28:14 +00:00
var ret []NodeClusterInfo
2022-11-13 13:22:00 +00:00
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.
2023-11-22 17:28:14 +00:00
func (o *ClusterLayout) GetRolesOk() ([]NodeClusterInfo, bool) {
2022-11-13 13:22:00 +00:00
if o == nil {
return nil, false
}
2023-11-22 17:28:14 +00:00
return o.Roles, true
2022-11-13 13:22:00 +00:00
}
// SetRoles sets field value
2023-11-22 17:28:14 +00:00
func (o *ClusterLayout) SetRoles(v []NodeClusterInfo) {
2022-11-13 13:22:00 +00:00
o.Roles = v
}
// GetStagedRoleChanges returns the StagedRoleChanges field value
2023-11-22 17:28:14 +00:00
func (o *ClusterLayout) GetStagedRoleChanges() []NodeRoleChange {
2022-11-13 13:22:00 +00:00
if o == nil {
2023-11-22 17:28:14 +00:00
var ret []NodeRoleChange
2022-11-13 13:22:00 +00:00
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.
2023-11-22 17:28:14 +00:00
func (o *ClusterLayout) GetStagedRoleChangesOk() ([]NodeRoleChange, bool) {
2022-11-13 13:22:00 +00:00
if o == nil {
return nil, false
}
2023-11-22 17:28:14 +00:00
return o.StagedRoleChanges, true
2022-11-13 13:22:00 +00:00
}
// SetStagedRoleChanges sets field value
2023-11-22 17:28:14 +00:00
func (o *ClusterLayout) SetStagedRoleChanges(v []NodeRoleChange) {
2022-11-13 13:22:00 +00:00
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)
}