terraform-provider-stackitp.../pkg/sfsbeta/model_share.go
2026-01-21 09:07:29 +01:00

479 lines
14 KiB
Go

/*
STACKIT File Storage (SFS)
API used to create and manage NFS Shares.
API version: 1beta.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package sfsbeta
import (
"encoding/json"
"time"
)
// checks if the Share type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Share{}
/*
types and functions for createdAt
*/
// isDateTime
type ShareGetCreatedAtAttributeType = *time.Time
type ShareGetCreatedAtArgType = time.Time
type ShareGetCreatedAtRetType = time.Time
func getShareGetCreatedAtAttributeTypeOk(arg ShareGetCreatedAtAttributeType) (ret ShareGetCreatedAtRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setShareGetCreatedAtAttributeType(arg *ShareGetCreatedAtAttributeType, val ShareGetCreatedAtRetType) {
*arg = &val
}
/*
types and functions for exportPolicy
*/
// isModel
type ShareGetExportPolicyAttributeType = *NullableShareExportPolicy
type ShareGetExportPolicyArgType = *NullableShareExportPolicy
type ShareGetExportPolicyRetType = *NullableShareExportPolicy
func getShareGetExportPolicyAttributeTypeOk(arg ShareGetExportPolicyAttributeType) (ret ShareGetExportPolicyRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg, true
}
func setShareGetExportPolicyAttributeType(arg *ShareGetExportPolicyAttributeType, val ShareGetExportPolicyRetType) {
*arg = val
}
/*
types and functions for id
*/
// isNotNullableString
type ShareGetIdAttributeType = *string
func getShareGetIdAttributeTypeOk(arg ShareGetIdAttributeType) (ret ShareGetIdRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setShareGetIdAttributeType(arg *ShareGetIdAttributeType, val ShareGetIdRetType) {
*arg = &val
}
type ShareGetIdArgType = string
type ShareGetIdRetType = string
/*
types and functions for labels
*/
// isContainer
type ShareGetLabelsAttributeType = *map[string]string
type ShareGetLabelsArgType = map[string]string
type ShareGetLabelsRetType = map[string]string
func getShareGetLabelsAttributeTypeOk(arg ShareGetLabelsAttributeType) (ret ShareGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setShareGetLabelsAttributeType(arg *ShareGetLabelsAttributeType, val ShareGetLabelsRetType) {
*arg = &val
}
/*
types and functions for mountPath
*/
// isNotNullableString
type ShareGetMountPathAttributeType = *string
func getShareGetMountPathAttributeTypeOk(arg ShareGetMountPathAttributeType) (ret ShareGetMountPathRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setShareGetMountPathAttributeType(arg *ShareGetMountPathAttributeType, val ShareGetMountPathRetType) {
*arg = &val
}
type ShareGetMountPathArgType = string
type ShareGetMountPathRetType = string
/*
types and functions for name
*/
// isNotNullableString
type ShareGetNameAttributeType = *string
func getShareGetNameAttributeTypeOk(arg ShareGetNameAttributeType) (ret ShareGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setShareGetNameAttributeType(arg *ShareGetNameAttributeType, val ShareGetNameRetType) {
*arg = &val
}
type ShareGetNameArgType = string
type ShareGetNameRetType = string
/*
types and functions for spaceHardLimitGigabytes
*/
// isInteger
type ShareGetSpaceHardLimitGigabytesAttributeType = *int64
type ShareGetSpaceHardLimitGigabytesArgType = int64
type ShareGetSpaceHardLimitGigabytesRetType = int64
func getShareGetSpaceHardLimitGigabytesAttributeTypeOk(arg ShareGetSpaceHardLimitGigabytesAttributeType) (ret ShareGetSpaceHardLimitGigabytesRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setShareGetSpaceHardLimitGigabytesAttributeType(arg *ShareGetSpaceHardLimitGigabytesAttributeType, val ShareGetSpaceHardLimitGigabytesRetType) {
*arg = &val
}
/*
types and functions for state
*/
// isNotNullableString
type ShareGetStateAttributeType = *string
func getShareGetStateAttributeTypeOk(arg ShareGetStateAttributeType) (ret ShareGetStateRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setShareGetStateAttributeType(arg *ShareGetStateAttributeType, val ShareGetStateRetType) {
*arg = &val
}
type ShareGetStateArgType = string
type ShareGetStateRetType = string
// Share struct for Share
type Share struct {
CreatedAt ShareGetCreatedAtAttributeType `json:"createdAt,omitempty"`
ExportPolicy ShareGetExportPolicyAttributeType `json:"exportPolicy,omitempty"`
// ID of the Share
Id ShareGetIdAttributeType `json:"id,omitempty"`
// An optional object that represents the labels associated with the share keys are validated using the following regex '^[\\\\p{Ll}][\\\\p{Ll}\\\\p{N}_-]*$' and cannot be empty values are validated using the following regex '^[\\\\p{Ll}\\\\p{N}_-]*$'
Labels ShareGetLabelsAttributeType `json:"labels,omitempty"`
// Mount path of the Share, used to mount the Share
MountPath ShareGetMountPathAttributeType `json:"mountPath,omitempty"`
// Name of the Share
Name ShareGetNameAttributeType `json:"name,omitempty"`
// Space hard limit for the Share. If zero, the Share will have access to the full space of the Resource Pool it lives in. (unit: gibibytes)
// Can be cast to int32 without loss of precision.
SpaceHardLimitGigabytes ShareGetSpaceHardLimitGigabytesAttributeType `json:"spaceHardLimitGigabytes,omitempty"`
// State of the Resource Pool Snapshot (possible values: [\"pending\", \"creating\", \"created\", \"error\", \"deleting\"])
State ShareGetStateAttributeType `json:"state,omitempty"`
}
// NewShare instantiates a new Share 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 NewShare() *Share {
this := Share{}
return &this
}
// NewShareWithDefaults instantiates a new Share 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 NewShareWithDefaults() *Share {
this := Share{}
return &this
}
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
func (o *Share) GetCreatedAt() (res ShareGetCreatedAtRetType) {
res, _ = o.GetCreatedAtOk()
return
}
// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Share) GetCreatedAtOk() (ret ShareGetCreatedAtRetType, ok bool) {
return getShareGetCreatedAtAttributeTypeOk(o.CreatedAt)
}
// HasCreatedAt returns a boolean if a field has been set.
func (o *Share) HasCreatedAt() bool {
_, ok := o.GetCreatedAtOk()
return ok
}
// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field.
func (o *Share) SetCreatedAt(v ShareGetCreatedAtRetType) {
setShareGetCreatedAtAttributeType(&o.CreatedAt, v)
}
// GetExportPolicy returns the ExportPolicy field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *Share) GetExportPolicy() (res ShareGetExportPolicyRetType) {
res, _ = o.GetExportPolicyOk()
return
}
// GetExportPolicyOk returns a tuple with the ExportPolicy 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 *Share) GetExportPolicyOk() (ret ShareGetExportPolicyRetType, ok bool) {
return getShareGetExportPolicyAttributeTypeOk(o.ExportPolicy)
}
// HasExportPolicy returns a boolean if a field has been set.
func (o *Share) HasExportPolicy() bool {
_, ok := o.GetExportPolicyOk()
return ok
}
// SetExportPolicy gets a reference to the given ShareExportPolicy and assigns it to the ExportPolicy field.
func (o *Share) SetExportPolicy(v ShareGetExportPolicyRetType) {
setShareGetExportPolicyAttributeType(&o.ExportPolicy, v)
}
// SetExportPolicyNil sets the value for ExportPolicy to be an explicit nil
func (o *Share) SetExportPolicyNil() {
o.ExportPolicy = nil
}
// UnsetExportPolicy ensures that no value is present for ExportPolicy, not even an explicit nil
func (o *Share) UnsetExportPolicy() {
o.ExportPolicy = nil
}
// GetId returns the Id field value if set, zero value otherwise.
func (o *Share) GetId() (res ShareGetIdRetType) {
res, _ = o.GetIdOk()
return
}
// 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 *Share) GetIdOk() (ret ShareGetIdRetType, ok bool) {
return getShareGetIdAttributeTypeOk(o.Id)
}
// HasId returns a boolean if a field has been set.
func (o *Share) HasId() bool {
_, ok := o.GetIdOk()
return ok
}
// SetId gets a reference to the given string and assigns it to the Id field.
func (o *Share) SetId(v ShareGetIdRetType) {
setShareGetIdAttributeType(&o.Id, v)
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *Share) GetLabels() (res ShareGetLabelsRetType) {
res, _ = o.GetLabelsOk()
return
}
// GetLabelsOk returns a tuple with the Labels field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Share) GetLabelsOk() (ret ShareGetLabelsRetType, ok bool) {
return getShareGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *Share) HasLabels() bool {
_, ok := o.GetLabelsOk()
return ok
}
// SetLabels gets a reference to the given map[string]string and assigns it to the Labels field.
func (o *Share) SetLabels(v ShareGetLabelsRetType) {
setShareGetLabelsAttributeType(&o.Labels, v)
}
// GetMountPath returns the MountPath field value if set, zero value otherwise.
func (o *Share) GetMountPath() (res ShareGetMountPathRetType) {
res, _ = o.GetMountPathOk()
return
}
// GetMountPathOk returns a tuple with the MountPath field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Share) GetMountPathOk() (ret ShareGetMountPathRetType, ok bool) {
return getShareGetMountPathAttributeTypeOk(o.MountPath)
}
// HasMountPath returns a boolean if a field has been set.
func (o *Share) HasMountPath() bool {
_, ok := o.GetMountPathOk()
return ok
}
// SetMountPath gets a reference to the given string and assigns it to the MountPath field.
func (o *Share) SetMountPath(v ShareGetMountPathRetType) {
setShareGetMountPathAttributeType(&o.MountPath, v)
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *Share) GetName() (res ShareGetNameRetType) {
res, _ = o.GetNameOk()
return
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Share) GetNameOk() (ret ShareGetNameRetType, ok bool) {
return getShareGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *Share) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *Share) SetName(v ShareGetNameRetType) {
setShareGetNameAttributeType(&o.Name, v)
}
// GetSpaceHardLimitGigabytes returns the SpaceHardLimitGigabytes field value if set, zero value otherwise.
func (o *Share) GetSpaceHardLimitGigabytes() (res ShareGetSpaceHardLimitGigabytesRetType) {
res, _ = o.GetSpaceHardLimitGigabytesOk()
return
}
// GetSpaceHardLimitGigabytesOk returns a tuple with the SpaceHardLimitGigabytes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Share) GetSpaceHardLimitGigabytesOk() (ret ShareGetSpaceHardLimitGigabytesRetType, ok bool) {
return getShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes)
}
// HasSpaceHardLimitGigabytes returns a boolean if a field has been set.
func (o *Share) HasSpaceHardLimitGigabytes() bool {
_, ok := o.GetSpaceHardLimitGigabytesOk()
return ok
}
// SetSpaceHardLimitGigabytes gets a reference to the given int64 and assigns it to the SpaceHardLimitGigabytes field.
func (o *Share) SetSpaceHardLimitGigabytes(v ShareGetSpaceHardLimitGigabytesRetType) {
setShareGetSpaceHardLimitGigabytesAttributeType(&o.SpaceHardLimitGigabytes, v)
}
// GetState returns the State field value if set, zero value otherwise.
func (o *Share) GetState() (res ShareGetStateRetType) {
res, _ = o.GetStateOk()
return
}
// GetStateOk returns a tuple with the State field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Share) GetStateOk() (ret ShareGetStateRetType, ok bool) {
return getShareGetStateAttributeTypeOk(o.State)
}
// HasState returns a boolean if a field has been set.
func (o *Share) HasState() bool {
_, ok := o.GetStateOk()
return ok
}
// SetState gets a reference to the given string and assigns it to the State field.
func (o *Share) SetState(v ShareGetStateRetType) {
setShareGetStateAttributeType(&o.State, v)
}
func (o Share) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getShareGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
toSerialize["CreatedAt"] = val
}
if val, ok := getShareGetExportPolicyAttributeTypeOk(o.ExportPolicy); ok {
toSerialize["ExportPolicy"] = val
}
if val, ok := getShareGetIdAttributeTypeOk(o.Id); ok {
toSerialize["Id"] = val
}
if val, ok := getShareGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getShareGetMountPathAttributeTypeOk(o.MountPath); ok {
toSerialize["MountPath"] = val
}
if val, ok := getShareGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
if val, ok := getShareGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes); ok {
toSerialize["SpaceHardLimitGigabytes"] = val
}
if val, ok := getShareGetStateAttributeTypeOk(o.State); ok {
toSerialize["State"] = val
}
return toSerialize, nil
}
type NullableShare struct {
value *Share
isSet bool
}
func (v NullableShare) Get() *Share {
return v.value
}
func (v *NullableShare) Set(val *Share) {
v.value = val
v.isSet = true
}
func (v NullableShare) IsSet() bool {
return v.isSet
}
func (v *NullableShare) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableShare(val *Share) *NullableShare {
return &NullableShare{value: val, isSet: true}
}
func (v NullableShare) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableShare) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}