garage-admin-sdk-golang/model_bucket_info.go

414 lines
11 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"
)
// BucketInfo struct for BucketInfo
type BucketInfo struct {
Id *string `json:"id,omitempty"`
GlobalAliases []string `json:"globalAliases,omitempty"`
WebsiteAccess *bool `json:"websiteAccess,omitempty"`
WebsiteConfig NullableBucketInfoWebsiteConfig `json:"websiteConfig,omitempty"`
Keys []BucketKeyInfo `json:"keys,omitempty"`
Objects *int64 `json:"objects,omitempty"`
Bytes *int64 `json:"bytes,omitempty"`
UnfinishedUploads *int32 `json:"unfinishedUploads,omitempty"`
Quotas *BucketInfoQuotas `json:"quotas,omitempty"`
}
// NewBucketInfo instantiates a new BucketInfo 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 NewBucketInfo() *BucketInfo {
this := BucketInfo{}
return &this
}
// NewBucketInfoWithDefaults instantiates a new BucketInfo 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 NewBucketInfoWithDefaults() *BucketInfo {
this := BucketInfo{}
return &this
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *BucketInfo) GetId() string {
if o == nil || o.Id == nil {
var ret string
return ret
}
return *o.Id
}
// GetIdOk returns a tuple with the Id field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetIdOk() (*string, bool) {
if o == nil || o.Id == nil {
return nil, false
}
return o.Id, true
}
// HasId returns a boolean if a field has been set.
func (o *BucketInfo) HasId() bool {
if o != nil && o.Id != nil {
return true
}
return false
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *BucketInfo) SetId(v string) {
o.Id = &v
}
// GetGlobalAliases returns the GlobalAliases field value if set, zero value otherwise.
func (o *BucketInfo) GetGlobalAliases() []string {
if o == nil || o.GlobalAliases == nil {
var ret []string
return ret
}
return o.GlobalAliases
}
// GetGlobalAliasesOk returns a tuple with the GlobalAliases field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetGlobalAliasesOk() ([]string, bool) {
if o == nil || o.GlobalAliases == nil {
return nil, false
}
return o.GlobalAliases, true
}
// HasGlobalAliases returns a boolean if a field has been set.
func (o *BucketInfo) HasGlobalAliases() bool {
if o != nil && o.GlobalAliases != nil {
return true
}
return false
}
// SetGlobalAliases gets a reference to the given []string and assigns it to the GlobalAliases field.
func (o *BucketInfo) SetGlobalAliases(v []string) {
o.GlobalAliases = v
}
// GetWebsiteAccess returns the WebsiteAccess field value if set, zero value otherwise.
func (o *BucketInfo) GetWebsiteAccess() bool {
if o == nil || o.WebsiteAccess == nil {
var ret bool
return ret
}
return *o.WebsiteAccess
}
// GetWebsiteAccessOk returns a tuple with the WebsiteAccess field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetWebsiteAccessOk() (*bool, bool) {
if o == nil || o.WebsiteAccess == nil {
return nil, false
}
return o.WebsiteAccess, true
}
// HasWebsiteAccess returns a boolean if a field has been set.
func (o *BucketInfo) HasWebsiteAccess() bool {
if o != nil && o.WebsiteAccess != nil {
return true
}
return false
}
// SetWebsiteAccess gets a reference to the given bool and assigns it to the WebsiteAccess field.
func (o *BucketInfo) SetWebsiteAccess(v bool) {
o.WebsiteAccess = &v
}
// GetWebsiteConfig returns the WebsiteConfig field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *BucketInfo) GetWebsiteConfig() BucketInfoWebsiteConfig {
if o == nil || o.WebsiteConfig.Get() == nil {
var ret BucketInfoWebsiteConfig
return ret
}
return *o.WebsiteConfig.Get()
}
// GetWebsiteConfigOk returns a tuple with the WebsiteConfig 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 *BucketInfo) GetWebsiteConfigOk() (*BucketInfoWebsiteConfig, bool) {
if o == nil {
return nil, false
}
return o.WebsiteConfig.Get(), o.WebsiteConfig.IsSet()
}
// HasWebsiteConfig returns a boolean if a field has been set.
func (o *BucketInfo) HasWebsiteConfig() bool {
if o != nil && o.WebsiteConfig.IsSet() {
return true
}
return false
}
// SetWebsiteConfig gets a reference to the given NullableBucketInfoWebsiteConfig and assigns it to the WebsiteConfig field.
func (o *BucketInfo) SetWebsiteConfig(v BucketInfoWebsiteConfig) {
o.WebsiteConfig.Set(&v)
}
// SetWebsiteConfigNil sets the value for WebsiteConfig to be an explicit nil
func (o *BucketInfo) SetWebsiteConfigNil() {
o.WebsiteConfig.Set(nil)
}
// UnsetWebsiteConfig ensures that no value is present for WebsiteConfig, not even an explicit nil
func (o *BucketInfo) UnsetWebsiteConfig() {
o.WebsiteConfig.Unset()
}
// GetKeys returns the Keys field value if set, zero value otherwise.
func (o *BucketInfo) GetKeys() []BucketKeyInfo {
if o == nil || o.Keys == nil {
var ret []BucketKeyInfo
return ret
}
return o.Keys
}
// GetKeysOk returns a tuple with the Keys field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetKeysOk() ([]BucketKeyInfo, bool) {
if o == nil || o.Keys == nil {
return nil, false
}
return o.Keys, true
}
// HasKeys returns a boolean if a field has been set.
func (o *BucketInfo) HasKeys() bool {
if o != nil && o.Keys != nil {
return true
}
return false
}
// SetKeys gets a reference to the given []BucketKeyInfo and assigns it to the Keys field.
func (o *BucketInfo) SetKeys(v []BucketKeyInfo) {
o.Keys = v
}
// GetObjects returns the Objects field value if set, zero value otherwise.
func (o *BucketInfo) GetObjects() int64 {
if o == nil || o.Objects == nil {
var ret int64
return ret
}
return *o.Objects
}
// GetObjectsOk returns a tuple with the Objects field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetObjectsOk() (*int64, bool) {
if o == nil || o.Objects == nil {
return nil, false
}
return o.Objects, true
}
// HasObjects returns a boolean if a field has been set.
func (o *BucketInfo) HasObjects() bool {
if o != nil && o.Objects != nil {
return true
}
return false
}
// SetObjects gets a reference to the given int64 and assigns it to the Objects field.
func (o *BucketInfo) SetObjects(v int64) {
o.Objects = &v
}
// GetBytes returns the Bytes field value if set, zero value otherwise.
func (o *BucketInfo) GetBytes() int64 {
if o == nil || o.Bytes == nil {
var ret int64
return ret
}
return *o.Bytes
}
// GetBytesOk returns a tuple with the Bytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetBytesOk() (*int64, bool) {
if o == nil || o.Bytes == nil {
return nil, false
}
return o.Bytes, true
}
// HasBytes returns a boolean if a field has been set.
func (o *BucketInfo) HasBytes() bool {
if o != nil && o.Bytes != nil {
return true
}
return false
}
// SetBytes gets a reference to the given int64 and assigns it to the Bytes field.
func (o *BucketInfo) SetBytes(v int64) {
o.Bytes = &v
}
// GetUnfinishedUploads returns the UnfinishedUploads field value if set, zero value otherwise.
func (o *BucketInfo) GetUnfinishedUploads() int32 {
if o == nil || o.UnfinishedUploads == nil {
var ret int32
return ret
}
return *o.UnfinishedUploads
}
// GetUnfinishedUploadsOk returns a tuple with the UnfinishedUploads field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetUnfinishedUploadsOk() (*int32, bool) {
if o == nil || o.UnfinishedUploads == nil {
return nil, false
}
return o.UnfinishedUploads, true
}
// HasUnfinishedUploads returns a boolean if a field has been set.
func (o *BucketInfo) HasUnfinishedUploads() bool {
if o != nil && o.UnfinishedUploads != nil {
return true
}
return false
}
// SetUnfinishedUploads gets a reference to the given int32 and assigns it to the UnfinishedUploads field.
func (o *BucketInfo) SetUnfinishedUploads(v int32) {
o.UnfinishedUploads = &v
}
// GetQuotas returns the Quotas field value if set, zero value otherwise.
func (o *BucketInfo) GetQuotas() BucketInfoQuotas {
if o == nil || o.Quotas == nil {
var ret BucketInfoQuotas
return ret
}
return *o.Quotas
}
// GetQuotasOk returns a tuple with the Quotas field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *BucketInfo) GetQuotasOk() (*BucketInfoQuotas, bool) {
if o == nil || o.Quotas == nil {
return nil, false
}
return o.Quotas, true
}
// HasQuotas returns a boolean if a field has been set.
func (o *BucketInfo) HasQuotas() bool {
if o != nil && o.Quotas != nil {
return true
}
return false
}
// SetQuotas gets a reference to the given BucketInfoQuotas and assigns it to the Quotas field.
func (o *BucketInfo) SetQuotas(v BucketInfoQuotas) {
o.Quotas = &v
}
func (o BucketInfo) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.Id != nil {
toSerialize["id"] = o.Id
}
if o.GlobalAliases != nil {
toSerialize["globalAliases"] = o.GlobalAliases
}
if o.WebsiteAccess != nil {
toSerialize["websiteAccess"] = o.WebsiteAccess
}
if o.WebsiteConfig.IsSet() {
toSerialize["websiteConfig"] = o.WebsiteConfig.Get()
}
if o.Keys != nil {
toSerialize["keys"] = o.Keys
}
if o.Objects != nil {
toSerialize["objects"] = o.Objects
}
if o.Bytes != nil {
toSerialize["bytes"] = o.Bytes
}
if o.UnfinishedUploads != nil {
toSerialize["unfinishedUploads"] = o.UnfinishedUploads
}
if o.Quotas != nil {
toSerialize["quotas"] = o.Quotas
}
return json.Marshal(toSerialize)
}
type NullableBucketInfo struct {
value *BucketInfo
isSet bool
}
func (v NullableBucketInfo) Get() *BucketInfo {
return v.value
}
func (v *NullableBucketInfo) Set(val *BucketInfo) {
v.value = val
v.isSet = true
}
func (v NullableBucketInfo) IsSet() bool {
return v.isSet
}
func (v *NullableBucketInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableBucketInfo(val *BucketInfo) *NullableBucketInfo {
return &NullableBucketInfo{value: val, isSet: true}
}
func (v NullableBucketInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableBucketInfo) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}