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

252 lines
9.7 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"
)
// checks if the UpdateSharePayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UpdateSharePayload{}
/*
types and functions for exportPolicyName
*/
// isNullableString
type UpdateSharePayloadGetExportPolicyNameAttributeType = *NullableString
func getUpdateSharePayloadGetExportPolicyNameAttributeTypeOk(arg UpdateSharePayloadGetExportPolicyNameAttributeType) (ret UpdateSharePayloadGetExportPolicyNameRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg.Get(), true
}
func setUpdateSharePayloadGetExportPolicyNameAttributeType(arg *UpdateSharePayloadGetExportPolicyNameAttributeType, val UpdateSharePayloadGetExportPolicyNameRetType) {
if IsNil(*arg) {
*arg = NewNullableString(val)
} else {
(*arg).Set(val)
}
}
type UpdateSharePayloadGetExportPolicyNameArgType = *string
type UpdateSharePayloadGetExportPolicyNameRetType = *string
/*
types and functions for labels
*/
// isContainer
type UpdateSharePayloadGetLabelsAttributeType = *map[string]string
type UpdateSharePayloadGetLabelsArgType = map[string]string
type UpdateSharePayloadGetLabelsRetType = map[string]string
func getUpdateSharePayloadGetLabelsAttributeTypeOk(arg UpdateSharePayloadGetLabelsAttributeType) (ret UpdateSharePayloadGetLabelsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setUpdateSharePayloadGetLabelsAttributeType(arg *UpdateSharePayloadGetLabelsAttributeType, val UpdateSharePayloadGetLabelsRetType) {
*arg = &val
}
/*
types and functions for spaceHardLimitGigabytes
*/
// isInteger
type UpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType = *int64
type UpdateSharePayloadGetSpaceHardLimitGigabytesArgType = *int64
type UpdateSharePayloadGetSpaceHardLimitGigabytesRetType = *int64
func getUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(arg UpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType) (ret UpdateSharePayloadGetSpaceHardLimitGigabytesRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg, true
}
func setUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType(arg *UpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType, val UpdateSharePayloadGetSpaceHardLimitGigabytesRetType) {
*arg = val
}
// UpdateSharePayload struct for UpdateSharePayload
type UpdateSharePayload struct {
// Name of the Share Export Policy to use in the Share. The behavior depends on the value: - If not set (null): Keep the existing export policy (if any) - If set to empty string (\"\"): Remove the existing export policy - If set to a policy name: Update to use the specified policy, creating a new association if none exists
ExportPolicyName UpdateSharePayloadGetExportPolicyNameAttributeType `json:"exportPolicyName,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 UpdateSharePayloadGetLabelsAttributeType `json:"labels,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 UpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType `json:"spaceHardLimitGigabytes,omitempty"`
}
// NewUpdateSharePayload instantiates a new UpdateSharePayload 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 NewUpdateSharePayload() *UpdateSharePayload {
this := UpdateSharePayload{}
return &this
}
// NewUpdateSharePayloadWithDefaults instantiates a new UpdateSharePayload 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 NewUpdateSharePayloadWithDefaults() *UpdateSharePayload {
this := UpdateSharePayload{}
return &this
}
// GetExportPolicyName returns the ExportPolicyName field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateSharePayload) GetExportPolicyName() (res UpdateSharePayloadGetExportPolicyNameRetType) {
res, _ = o.GetExportPolicyNameOk()
return
}
// GetExportPolicyNameOk returns a tuple with the ExportPolicyName 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 *UpdateSharePayload) GetExportPolicyNameOk() (ret UpdateSharePayloadGetExportPolicyNameRetType, ok bool) {
return getUpdateSharePayloadGetExportPolicyNameAttributeTypeOk(o.ExportPolicyName)
}
// HasExportPolicyName returns a boolean if a field has been set.
func (o *UpdateSharePayload) HasExportPolicyName() bool {
_, ok := o.GetExportPolicyNameOk()
return ok
}
// SetExportPolicyName gets a reference to the given string and assigns it to the ExportPolicyName field.
func (o *UpdateSharePayload) SetExportPolicyName(v UpdateSharePayloadGetExportPolicyNameRetType) {
setUpdateSharePayloadGetExportPolicyNameAttributeType(&o.ExportPolicyName, v)
}
// SetExportPolicyNameNil sets the value for ExportPolicyName to be an explicit nil
func (o *UpdateSharePayload) SetExportPolicyNameNil() {
o.ExportPolicyName = nil
}
// UnsetExportPolicyName ensures that no value is present for ExportPolicyName, not even an explicit nil
func (o *UpdateSharePayload) UnsetExportPolicyName() {
o.ExportPolicyName = nil
}
// GetLabels returns the Labels field value if set, zero value otherwise.
func (o *UpdateSharePayload) GetLabels() (res UpdateSharePayloadGetLabelsRetType) {
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 *UpdateSharePayload) GetLabelsOk() (ret UpdateSharePayloadGetLabelsRetType, ok bool) {
return getUpdateSharePayloadGetLabelsAttributeTypeOk(o.Labels)
}
// HasLabels returns a boolean if a field has been set.
func (o *UpdateSharePayload) 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 *UpdateSharePayload) SetLabels(v UpdateSharePayloadGetLabelsRetType) {
setUpdateSharePayloadGetLabelsAttributeType(&o.Labels, v)
}
// GetSpaceHardLimitGigabytes returns the SpaceHardLimitGigabytes field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *UpdateSharePayload) GetSpaceHardLimitGigabytes() (res UpdateSharePayloadGetSpaceHardLimitGigabytesRetType) {
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.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *UpdateSharePayload) GetSpaceHardLimitGigabytesOk() (ret UpdateSharePayloadGetSpaceHardLimitGigabytesRetType, ok bool) {
return getUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes)
}
// HasSpaceHardLimitGigabytes returns a boolean if a field has been set.
func (o *UpdateSharePayload) HasSpaceHardLimitGigabytes() bool {
_, ok := o.GetSpaceHardLimitGigabytesOk()
return ok
}
// SetSpaceHardLimitGigabytes gets a reference to the given int64 and assigns it to the SpaceHardLimitGigabytes field.
func (o *UpdateSharePayload) SetSpaceHardLimitGigabytes(v UpdateSharePayloadGetSpaceHardLimitGigabytesRetType) {
setUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeType(&o.SpaceHardLimitGigabytes, v)
}
// SetSpaceHardLimitGigabytesNil sets the value for SpaceHardLimitGigabytes to be an explicit nil
func (o *UpdateSharePayload) SetSpaceHardLimitGigabytesNil() {
o.SpaceHardLimitGigabytes = nil
}
// UnsetSpaceHardLimitGigabytes ensures that no value is present for SpaceHardLimitGigabytes, not even an explicit nil
func (o *UpdateSharePayload) UnsetSpaceHardLimitGigabytes() {
o.SpaceHardLimitGigabytes = nil
}
func (o UpdateSharePayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getUpdateSharePayloadGetExportPolicyNameAttributeTypeOk(o.ExportPolicyName); ok {
toSerialize["ExportPolicyName"] = val
}
if val, ok := getUpdateSharePayloadGetLabelsAttributeTypeOk(o.Labels); ok {
toSerialize["Labels"] = val
}
if val, ok := getUpdateSharePayloadGetSpaceHardLimitGigabytesAttributeTypeOk(o.SpaceHardLimitGigabytes); ok {
toSerialize["SpaceHardLimitGigabytes"] = val
}
return toSerialize, nil
}
type NullableUpdateSharePayload struct {
value *UpdateSharePayload
isSet bool
}
func (v NullableUpdateSharePayload) Get() *UpdateSharePayload {
return v.value
}
func (v *NullableUpdateSharePayload) Set(val *UpdateSharePayload) {
v.value = val
v.isSet = true
}
func (v NullableUpdateSharePayload) IsSet() bool {
return v.isSet
}
func (v *NullableUpdateSharePayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableUpdateSharePayload(val *UpdateSharePayload) *NullableUpdateSharePayload {
return &NullableUpdateSharePayload{value: val, isSet: true}
}
func (v NullableUpdateSharePayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableUpdateSharePayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}