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

193 lines
6.9 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 CreateResourcePoolSnapshotPayload type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CreateResourcePoolSnapshotPayload{}
/*
types and functions for comment
*/
// isNullableString
type CreateResourcePoolSnapshotPayloadGetCommentAttributeType = *NullableString
func getCreateResourcePoolSnapshotPayloadGetCommentAttributeTypeOk(arg CreateResourcePoolSnapshotPayloadGetCommentAttributeType) (ret CreateResourcePoolSnapshotPayloadGetCommentRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg.Get(), true
}
func setCreateResourcePoolSnapshotPayloadGetCommentAttributeType(arg *CreateResourcePoolSnapshotPayloadGetCommentAttributeType, val CreateResourcePoolSnapshotPayloadGetCommentRetType) {
if IsNil(*arg) {
*arg = NewNullableString(val)
} else {
(*arg).Set(val)
}
}
type CreateResourcePoolSnapshotPayloadGetCommentArgType = *string
type CreateResourcePoolSnapshotPayloadGetCommentRetType = *string
/*
types and functions for name
*/
// isNotNullableString
type CreateResourcePoolSnapshotPayloadGetNameAttributeType = *string
func getCreateResourcePoolSnapshotPayloadGetNameAttributeTypeOk(arg CreateResourcePoolSnapshotPayloadGetNameAttributeType) (ret CreateResourcePoolSnapshotPayloadGetNameRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setCreateResourcePoolSnapshotPayloadGetNameAttributeType(arg *CreateResourcePoolSnapshotPayloadGetNameAttributeType, val CreateResourcePoolSnapshotPayloadGetNameRetType) {
*arg = &val
}
type CreateResourcePoolSnapshotPayloadGetNameArgType = string
type CreateResourcePoolSnapshotPayloadGetNameRetType = string
// CreateResourcePoolSnapshotPayload struct for CreateResourcePoolSnapshotPayload
type CreateResourcePoolSnapshotPayload struct {
// (optional) A comment to add more information about a snapshot
Comment CreateResourcePoolSnapshotPayloadGetCommentAttributeType `json:"comment,omitempty"`
// Name of the Resource Pool Snapshot
Name CreateResourcePoolSnapshotPayloadGetNameAttributeType `json:"name,omitempty"`
}
// NewCreateResourcePoolSnapshotPayload instantiates a new CreateResourcePoolSnapshotPayload 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 NewCreateResourcePoolSnapshotPayload() *CreateResourcePoolSnapshotPayload {
this := CreateResourcePoolSnapshotPayload{}
return &this
}
// NewCreateResourcePoolSnapshotPayloadWithDefaults instantiates a new CreateResourcePoolSnapshotPayload 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 NewCreateResourcePoolSnapshotPayloadWithDefaults() *CreateResourcePoolSnapshotPayload {
this := CreateResourcePoolSnapshotPayload{}
return &this
}
// GetComment returns the Comment field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *CreateResourcePoolSnapshotPayload) GetComment() (res CreateResourcePoolSnapshotPayloadGetCommentRetType) {
res, _ = o.GetCommentOk()
return
}
// GetCommentOk returns a tuple with the Comment 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 *CreateResourcePoolSnapshotPayload) GetCommentOk() (ret CreateResourcePoolSnapshotPayloadGetCommentRetType, ok bool) {
return getCreateResourcePoolSnapshotPayloadGetCommentAttributeTypeOk(o.Comment)
}
// HasComment returns a boolean if a field has been set.
func (o *CreateResourcePoolSnapshotPayload) HasComment() bool {
_, ok := o.GetCommentOk()
return ok
}
// SetComment gets a reference to the given string and assigns it to the Comment field.
func (o *CreateResourcePoolSnapshotPayload) SetComment(v CreateResourcePoolSnapshotPayloadGetCommentRetType) {
setCreateResourcePoolSnapshotPayloadGetCommentAttributeType(&o.Comment, v)
}
// SetCommentNil sets the value for Comment to be an explicit nil
func (o *CreateResourcePoolSnapshotPayload) SetCommentNil() {
o.Comment = nil
}
// UnsetComment ensures that no value is present for Comment, not even an explicit nil
func (o *CreateResourcePoolSnapshotPayload) UnsetComment() {
o.Comment = nil
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *CreateResourcePoolSnapshotPayload) GetName() (res CreateResourcePoolSnapshotPayloadGetNameRetType) {
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 *CreateResourcePoolSnapshotPayload) GetNameOk() (ret CreateResourcePoolSnapshotPayloadGetNameRetType, ok bool) {
return getCreateResourcePoolSnapshotPayloadGetNameAttributeTypeOk(o.Name)
}
// HasName returns a boolean if a field has been set.
func (o *CreateResourcePoolSnapshotPayload) HasName() bool {
_, ok := o.GetNameOk()
return ok
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *CreateResourcePoolSnapshotPayload) SetName(v CreateResourcePoolSnapshotPayloadGetNameRetType) {
setCreateResourcePoolSnapshotPayloadGetNameAttributeType(&o.Name, v)
}
func (o CreateResourcePoolSnapshotPayload) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getCreateResourcePoolSnapshotPayloadGetCommentAttributeTypeOk(o.Comment); ok {
toSerialize["Comment"] = val
}
if val, ok := getCreateResourcePoolSnapshotPayloadGetNameAttributeTypeOk(o.Name); ok {
toSerialize["Name"] = val
}
return toSerialize, nil
}
type NullableCreateResourcePoolSnapshotPayload struct {
value *CreateResourcePoolSnapshotPayload
isSet bool
}
func (v NullableCreateResourcePoolSnapshotPayload) Get() *CreateResourcePoolSnapshotPayload {
return v.value
}
func (v *NullableCreateResourcePoolSnapshotPayload) Set(val *CreateResourcePoolSnapshotPayload) {
v.value = val
v.isSet = true
}
func (v NullableCreateResourcePoolSnapshotPayload) IsSet() bool {
return v.isSet
}
func (v *NullableCreateResourcePoolSnapshotPayload) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCreateResourcePoolSnapshotPayload(val *CreateResourcePoolSnapshotPayload) *NullableCreateResourcePoolSnapshotPayload {
return &NullableCreateResourcePoolSnapshotPayload{value: val, isSet: true}
}
func (v NullableCreateResourcePoolSnapshotPayload) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCreateResourcePoolSnapshotPayload) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}