garage-admin-sdk-golang/model_node_cluster_info.go

185 lines
4.9 KiB
Go

/*
Garage Administration API v0+garage-v0.9.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.9.0
*/
// 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"`
Capacity NullableInt64 `json:"capacity,omitempty"`
// 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
func NewNodeClusterInfo(zone string, tags []string) *NodeClusterInfo {
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
}
// GetCapacity returns the Capacity field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *NodeClusterInfo) GetCapacity() int64 {
if o == nil || o.Capacity.Get() == nil {
var ret int64
return ret
}
return *o.Capacity.Get()
}
// GetCapacityOk returns a tuple with the Capacity field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *NodeClusterInfo) GetCapacityOk() (*int64, bool) {
if o == nil {
return nil, false
}
return o.Capacity.Get(), o.Capacity.IsSet()
}
// 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
}
// SetCapacity gets a reference to the given NullableInt64 and assigns it to the Capacity field.
func (o *NodeClusterInfo) SetCapacity(v int64) {
o.Capacity.Set(&v)
}
// 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()
}
// 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
}
if o.Capacity.IsSet() {
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)
}