garage-admin-sdk-golang/model_node_cluster_info.go

185 lines
4.9 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"
)
// NodeClusterInfo struct for NodeClusterInfo
type NodeClusterInfo struct {
Zone string `json:"zone"`
2023-11-23 09:04:11 +00:00
Capacity NullableInt64 `json:"capacity,omitempty"`
2022-11-13 13:22:00 +00:00
// User defined tags, put whatever makes sense for you, these tags are not interpreted by Garage
Tags []string `json:"tags"`
}
// NewNodeClusterInfo instantiates a new NodeClusterInfo 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 NewNodeClusterInfo(zone string, tags []string) *NodeClusterInfo {
2022-11-13 13:22:00 +00:00
this := NodeClusterInfo{}
this.Zone = zone
this.Tags = tags
return &this
}
// NewNodeClusterInfoWithDefaults instantiates a new NodeClusterInfo 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 NewNodeClusterInfoWithDefaults() *NodeClusterInfo {
this := NodeClusterInfo{}
return &this
}
// GetZone returns the Zone field value
func (o *NodeClusterInfo) GetZone() string {
if o == nil {
var ret string
return ret
}
return o.Zone
}
// GetZoneOk returns a tuple with the Zone field value
// and a boolean to check if the value has been set.
func (o *NodeClusterInfo) GetZoneOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Zone, true
}
// SetZone sets field value
func (o *NodeClusterInfo) SetZone(v string) {
o.Zone = v
}
2023-11-22 17:28:14 +00:00
// GetCapacity returns the Capacity field value if set, zero value otherwise (both if not set or set to explicit null).
2023-11-23 09:04:11 +00:00
func (o *NodeClusterInfo) GetCapacity() int64 {
2022-11-13 13:22:00 +00:00
if o == nil || o.Capacity.Get() == nil {
2023-11-23 09:04:11 +00:00
var ret int64
2022-11-13 13:22:00 +00:00
return ret
}
return *o.Capacity.Get()
}
2023-11-22 17:28:14 +00:00
// GetCapacityOk returns a tuple with the Capacity field value if set, nil otherwise
2022-11-13 13:22:00 +00:00
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
2023-11-23 09:04:11 +00:00
func (o *NodeClusterInfo) GetCapacityOk() (*int64, bool) {
2022-11-13 13:22:00 +00:00
if o == nil {
return nil, false
}
return o.Capacity.Get(), o.Capacity.IsSet()
}
2023-11-22 17:28:14 +00:00
// HasCapacity returns a boolean if a field has been set.
func (o *NodeClusterInfo) HasCapacity() bool {
if o != nil && o.Capacity.IsSet() {
return true
}
return false
}
2023-11-23 09:04:11 +00:00
// SetCapacity gets a reference to the given NullableInt64 and assigns it to the Capacity field.
func (o *NodeClusterInfo) SetCapacity(v int64) {
2022-11-13 13:22:00 +00:00
o.Capacity.Set(&v)
}
2023-11-22 17:28:14 +00:00
// SetCapacityNil sets the value for Capacity to be an explicit nil
func (o *NodeClusterInfo) SetCapacityNil() {
o.Capacity.Set(nil)
}
// UnsetCapacity ensures that no value is present for Capacity, not even an explicit nil
func (o *NodeClusterInfo) UnsetCapacity() {
o.Capacity.Unset()
}
2022-11-13 13:22:00 +00:00
// GetTags returns the Tags field value
func (o *NodeClusterInfo) GetTags() []string {
if o == nil {
var ret []string
return ret
}
return o.Tags
}
// GetTagsOk returns a tuple with the Tags field value
// and a boolean to check if the value has been set.
func (o *NodeClusterInfo) GetTagsOk() ([]string, bool) {
if o == nil {
return nil, false
}
return o.Tags, true
}
// SetTags sets field value
func (o *NodeClusterInfo) SetTags(v []string) {
o.Tags = v
}
func (o NodeClusterInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if true {
toSerialize["zone"] = o.Zone
}
2023-11-22 17:28:14 +00:00
if o.Capacity.IsSet() {
2022-11-13 13:22:00 +00:00
toSerialize["capacity"] = o.Capacity.Get()
}
if true {
toSerialize["tags"] = o.Tags
}
return json.Marshal(toSerialize)
}
type NullableNodeClusterInfo struct {
value *NodeClusterInfo
isSet bool
}
func (v NullableNodeClusterInfo) Get() *NodeClusterInfo {
return v.value
}
func (v *NullableNodeClusterInfo) Set(val *NodeClusterInfo) {
v.value = val
v.isSet = true
}
func (v NullableNodeClusterInfo) IsSet() bool {
return v.isSet
}
func (v *NullableNodeClusterInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNodeClusterInfo(val *NodeClusterInfo) *NullableNodeClusterInfo {
return &NullableNodeClusterInfo{value: val, isSet: true}
}
func (v NullableNodeClusterInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNodeClusterInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}