terraform-provider-stackitp.../pkg/postgresflexalpha/model_storage.go

177 lines
4.9 KiB
Go

/*
PostgreSQL Flex API
This is the documentation for the STACKIT Postgres Flex service
API version: 3alpha1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package postgresflexalpha
import (
"encoding/json"
)
// checks if the Storage type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Storage{}
/*
types and functions for performanceClass
*/
// isNotNullableString
type StorageGetPerformanceClassAttributeType = *string
func getStorageGetPerformanceClassAttributeTypeOk(arg StorageGetPerformanceClassAttributeType) (ret StorageGetPerformanceClassRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setStorageGetPerformanceClassAttributeType(arg *StorageGetPerformanceClassAttributeType, val StorageGetPerformanceClassRetType) {
*arg = &val
}
type StorageGetPerformanceClassArgType = string
type StorageGetPerformanceClassRetType = string
/*
types and functions for size
*/
// isLong
type StorageGetSizeAttributeType = *int64
type StorageGetSizeArgType = int64
type StorageGetSizeRetType = int64
func getStorageGetSizeAttributeTypeOk(arg StorageGetSizeAttributeType) (ret StorageGetSizeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setStorageGetSizeAttributeType(arg *StorageGetSizeAttributeType, val StorageGetSizeRetType) {
*arg = &val
}
// Storage The object containing information about the storage size and class.
type Storage struct {
// The storage class for the storage.
PerformanceClass StorageGetPerformanceClassAttributeType `json:"performanceClass,omitempty"`
// The storage size in Gigabytes.
Size StorageGetSizeAttributeType `json:"size,omitempty"`
}
// NewStorage instantiates a new Storage 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 NewStorage() *Storage {
this := Storage{}
return &this
}
// NewStorageWithDefaults instantiates a new Storage 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 NewStorageWithDefaults() *Storage {
this := Storage{}
return &this
}
// GetPerformanceClass returns the PerformanceClass field value if set, zero value otherwise.
func (o *Storage) GetPerformanceClass() (res StorageGetPerformanceClassRetType) {
res, _ = o.GetPerformanceClassOk()
return
}
// GetPerformanceClassOk returns a tuple with the PerformanceClass field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Storage) GetPerformanceClassOk() (ret StorageGetPerformanceClassRetType, ok bool) {
return getStorageGetPerformanceClassAttributeTypeOk(o.PerformanceClass)
}
// HasPerformanceClass returns a boolean if a field has been set.
func (o *Storage) HasPerformanceClass() bool {
_, ok := o.GetPerformanceClassOk()
return ok
}
// SetPerformanceClass gets a reference to the given string and assigns it to the PerformanceClass field.
func (o *Storage) SetPerformanceClass(v StorageGetPerformanceClassRetType) {
setStorageGetPerformanceClassAttributeType(&o.PerformanceClass, v)
}
// GetSize returns the Size field value if set, zero value otherwise.
func (o *Storage) GetSize() (res StorageGetSizeRetType) {
res, _ = o.GetSizeOk()
return
}
// GetSizeOk returns a tuple with the Size field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Storage) GetSizeOk() (ret StorageGetSizeRetType, ok bool) {
return getStorageGetSizeAttributeTypeOk(o.Size)
}
// HasSize returns a boolean if a field has been set.
func (o *Storage) HasSize() bool {
_, ok := o.GetSizeOk()
return ok
}
// SetSize gets a reference to the given int64 and assigns it to the Size field.
func (o *Storage) SetSize(v StorageGetSizeRetType) {
setStorageGetSizeAttributeType(&o.Size, v)
}
func (o Storage) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getStorageGetPerformanceClassAttributeTypeOk(o.PerformanceClass); ok {
toSerialize["PerformanceClass"] = val
}
if val, ok := getStorageGetSizeAttributeTypeOk(o.Size); ok {
toSerialize["Size"] = val
}
return toSerialize, nil
}
type NullableStorage struct {
value *Storage
isSet bool
}
func (v NullableStorage) Get() *Storage {
return v.value
}
func (v *NullableStorage) Set(val *Storage) {
v.value = val
v.isSet = true
}
func (v NullableStorage) IsSet() bool {
return v.isSet
}
func (v *NullableStorage) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableStorage(val *Storage) *NullableStorage {
return &NullableStorage{value: val, isSet: true}
}
func (v NullableStorage) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableStorage) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}