467 lines
14 KiB
Go
467 lines
14 KiB
Go
/*
|
|
STACKIT IaaS API
|
|
|
|
This API allows you to create and modify IaaS resources.
|
|
|
|
API version: 2beta1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package iaasbeta
|
|
|
|
import (
|
|
"encoding/json"
|
|
"time"
|
|
)
|
|
|
|
// checks if the Snapshot type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &Snapshot{}
|
|
|
|
/*
|
|
types and functions for createdAt
|
|
*/
|
|
|
|
// isDateTime
|
|
type SnapshotGetCreatedAtAttributeType = *time.Time
|
|
type SnapshotGetCreatedAtArgType = time.Time
|
|
type SnapshotGetCreatedAtRetType = time.Time
|
|
|
|
func getSnapshotGetCreatedAtAttributeTypeOk(arg SnapshotGetCreatedAtAttributeType) (ret SnapshotGetCreatedAtRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setSnapshotGetCreatedAtAttributeType(arg *SnapshotGetCreatedAtAttributeType, val SnapshotGetCreatedAtRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for id
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type SnapshotGetIdAttributeType = *string
|
|
|
|
func getSnapshotGetIdAttributeTypeOk(arg SnapshotGetIdAttributeType) (ret SnapshotGetIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setSnapshotGetIdAttributeType(arg *SnapshotGetIdAttributeType, val SnapshotGetIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type SnapshotGetIdArgType = string
|
|
type SnapshotGetIdRetType = string
|
|
|
|
/*
|
|
types and functions for labels
|
|
*/
|
|
|
|
// isFreeform
|
|
type SnapshotGetLabelsAttributeType = *map[string]interface{}
|
|
type SnapshotGetLabelsArgType = map[string]interface{}
|
|
type SnapshotGetLabelsRetType = map[string]interface{}
|
|
|
|
func getSnapshotGetLabelsAttributeTypeOk(arg SnapshotGetLabelsAttributeType) (ret SnapshotGetLabelsRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setSnapshotGetLabelsAttributeType(arg *SnapshotGetLabelsAttributeType, val SnapshotGetLabelsRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type SnapshotGetNameAttributeType = *string
|
|
|
|
func getSnapshotGetNameAttributeTypeOk(arg SnapshotGetNameAttributeType) (ret SnapshotGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setSnapshotGetNameAttributeType(arg *SnapshotGetNameAttributeType, val SnapshotGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type SnapshotGetNameArgType = string
|
|
type SnapshotGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for size
|
|
*/
|
|
|
|
// isLong
|
|
type SnapshotGetSizeAttributeType = *int64
|
|
type SnapshotGetSizeArgType = int64
|
|
type SnapshotGetSizeRetType = int64
|
|
|
|
func getSnapshotGetSizeAttributeTypeOk(arg SnapshotGetSizeAttributeType) (ret SnapshotGetSizeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setSnapshotGetSizeAttributeType(arg *SnapshotGetSizeAttributeType, val SnapshotGetSizeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for status
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type SnapshotGetStatusAttributeType = *string
|
|
|
|
func getSnapshotGetStatusAttributeTypeOk(arg SnapshotGetStatusAttributeType) (ret SnapshotGetStatusRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setSnapshotGetStatusAttributeType(arg *SnapshotGetStatusAttributeType, val SnapshotGetStatusRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type SnapshotGetStatusArgType = string
|
|
type SnapshotGetStatusRetType = string
|
|
|
|
/*
|
|
types and functions for updatedAt
|
|
*/
|
|
|
|
// isDateTime
|
|
type SnapshotGetUpdatedAtAttributeType = *time.Time
|
|
type SnapshotGetUpdatedAtArgType = time.Time
|
|
type SnapshotGetUpdatedAtRetType = time.Time
|
|
|
|
func getSnapshotGetUpdatedAtAttributeTypeOk(arg SnapshotGetUpdatedAtAttributeType) (ret SnapshotGetUpdatedAtRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setSnapshotGetUpdatedAtAttributeType(arg *SnapshotGetUpdatedAtAttributeType, val SnapshotGetUpdatedAtRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for volumeId
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type SnapshotGetVolumeIdAttributeType = *string
|
|
|
|
func getSnapshotGetVolumeIdAttributeTypeOk(arg SnapshotGetVolumeIdAttributeType) (ret SnapshotGetVolumeIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setSnapshotGetVolumeIdAttributeType(arg *SnapshotGetVolumeIdAttributeType, val SnapshotGetVolumeIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type SnapshotGetVolumeIdArgType = string
|
|
type SnapshotGetVolumeIdRetType = string
|
|
|
|
// Snapshot Object that represents a snapshot.
|
|
type Snapshot struct {
|
|
// Date-time when resource was created.
|
|
CreatedAt SnapshotGetCreatedAtAttributeType `json:"createdAt,omitempty"`
|
|
// Universally Unique Identifier (UUID).
|
|
Id SnapshotGetIdAttributeType `json:"id,omitempty"`
|
|
// Object that represents the labels of an object. Regex for keys: `^(?=.{1,63}$)([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]$`. Regex for values: `^(?=.{0,63}$)(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])*$`. Providing a `null` value for a key will remove that key.
|
|
Labels SnapshotGetLabelsAttributeType `json:"labels,omitempty"`
|
|
// The name for a General Object. Matches Names and also UUIDs.
|
|
Name SnapshotGetNameAttributeType `json:"name,omitempty"`
|
|
// Size in Gigabyte.
|
|
Size SnapshotGetSizeAttributeType `json:"size,omitempty"`
|
|
// The status of a snapshot object. Possible values: `AVAILABLE`, `BACKING-UP`, `CREATING`, `DELETED`, `DELETING`, `ERROR`, `RESTORING`, `UNMANAGING`, `UPDATING`.
|
|
Status SnapshotGetStatusAttributeType `json:"status,omitempty"`
|
|
// Date-time when resource was last updated.
|
|
UpdatedAt SnapshotGetUpdatedAtAttributeType `json:"updatedAt,omitempty"`
|
|
// Universally Unique Identifier (UUID).
|
|
// REQUIRED
|
|
VolumeId SnapshotGetVolumeIdAttributeType `json:"volumeId" required:"true"`
|
|
}
|
|
|
|
type _Snapshot Snapshot
|
|
|
|
// NewSnapshot instantiates a new Snapshot 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 NewSnapshot(volumeId SnapshotGetVolumeIdArgType) *Snapshot {
|
|
this := Snapshot{}
|
|
setSnapshotGetVolumeIdAttributeType(&this.VolumeId, volumeId)
|
|
return &this
|
|
}
|
|
|
|
// NewSnapshotWithDefaults instantiates a new Snapshot 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 NewSnapshotWithDefaults() *Snapshot {
|
|
this := Snapshot{}
|
|
return &this
|
|
}
|
|
|
|
// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise.
|
|
func (o *Snapshot) GetCreatedAt() (res SnapshotGetCreatedAtRetType) {
|
|
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 *Snapshot) GetCreatedAtOk() (ret SnapshotGetCreatedAtRetType, ok bool) {
|
|
return getSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt)
|
|
}
|
|
|
|
// HasCreatedAt returns a boolean if a field has been set.
|
|
func (o *Snapshot) 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 *Snapshot) SetCreatedAt(v SnapshotGetCreatedAtRetType) {
|
|
setSnapshotGetCreatedAtAttributeType(&o.CreatedAt, v)
|
|
}
|
|
|
|
// GetId returns the Id field value if set, zero value otherwise.
|
|
func (o *Snapshot) GetId() (res SnapshotGetIdRetType) {
|
|
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 *Snapshot) GetIdOk() (ret SnapshotGetIdRetType, ok bool) {
|
|
return getSnapshotGetIdAttributeTypeOk(o.Id)
|
|
}
|
|
|
|
// HasId returns a boolean if a field has been set.
|
|
func (o *Snapshot) HasId() bool {
|
|
_, ok := o.GetIdOk()
|
|
return ok
|
|
}
|
|
|
|
// SetId gets a reference to the given string and assigns it to the Id field.
|
|
func (o *Snapshot) SetId(v SnapshotGetIdRetType) {
|
|
setSnapshotGetIdAttributeType(&o.Id, v)
|
|
}
|
|
|
|
// GetLabels returns the Labels field value if set, zero value otherwise.
|
|
func (o *Snapshot) GetLabels() (res SnapshotGetLabelsRetType) {
|
|
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 *Snapshot) GetLabelsOk() (ret SnapshotGetLabelsRetType, ok bool) {
|
|
return getSnapshotGetLabelsAttributeTypeOk(o.Labels)
|
|
}
|
|
|
|
// HasLabels returns a boolean if a field has been set.
|
|
func (o *Snapshot) HasLabels() bool {
|
|
_, ok := o.GetLabelsOk()
|
|
return ok
|
|
}
|
|
|
|
// SetLabels gets a reference to the given map[string]interface{} and assigns it to the Labels field.
|
|
func (o *Snapshot) SetLabels(v SnapshotGetLabelsRetType) {
|
|
setSnapshotGetLabelsAttributeType(&o.Labels, v)
|
|
}
|
|
|
|
// GetName returns the Name field value if set, zero value otherwise.
|
|
func (o *Snapshot) GetName() (res SnapshotGetNameRetType) {
|
|
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 *Snapshot) GetNameOk() (ret SnapshotGetNameRetType, ok bool) {
|
|
return getSnapshotGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// HasName returns a boolean if a field has been set.
|
|
func (o *Snapshot) HasName() bool {
|
|
_, ok := o.GetNameOk()
|
|
return ok
|
|
}
|
|
|
|
// SetName gets a reference to the given string and assigns it to the Name field.
|
|
func (o *Snapshot) SetName(v SnapshotGetNameRetType) {
|
|
setSnapshotGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetSize returns the Size field value if set, zero value otherwise.
|
|
func (o *Snapshot) GetSize() (res SnapshotGetSizeRetType) {
|
|
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 *Snapshot) GetSizeOk() (ret SnapshotGetSizeRetType, ok bool) {
|
|
return getSnapshotGetSizeAttributeTypeOk(o.Size)
|
|
}
|
|
|
|
// HasSize returns a boolean if a field has been set.
|
|
func (o *Snapshot) HasSize() bool {
|
|
_, ok := o.GetSizeOk()
|
|
return ok
|
|
}
|
|
|
|
// SetSize gets a reference to the given int64 and assigns it to the Size field.
|
|
func (o *Snapshot) SetSize(v SnapshotGetSizeRetType) {
|
|
setSnapshotGetSizeAttributeType(&o.Size, v)
|
|
}
|
|
|
|
// GetStatus returns the Status field value if set, zero value otherwise.
|
|
func (o *Snapshot) GetStatus() (res SnapshotGetStatusRetType) {
|
|
res, _ = o.GetStatusOk()
|
|
return
|
|
}
|
|
|
|
// GetStatusOk returns a tuple with the Status field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Snapshot) GetStatusOk() (ret SnapshotGetStatusRetType, ok bool) {
|
|
return getSnapshotGetStatusAttributeTypeOk(o.Status)
|
|
}
|
|
|
|
// HasStatus returns a boolean if a field has been set.
|
|
func (o *Snapshot) HasStatus() bool {
|
|
_, ok := o.GetStatusOk()
|
|
return ok
|
|
}
|
|
|
|
// SetStatus gets a reference to the given string and assigns it to the Status field.
|
|
func (o *Snapshot) SetStatus(v SnapshotGetStatusRetType) {
|
|
setSnapshotGetStatusAttributeType(&o.Status, v)
|
|
}
|
|
|
|
// GetUpdatedAt returns the UpdatedAt field value if set, zero value otherwise.
|
|
func (o *Snapshot) GetUpdatedAt() (res SnapshotGetUpdatedAtRetType) {
|
|
res, _ = o.GetUpdatedAtOk()
|
|
return
|
|
}
|
|
|
|
// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Snapshot) GetUpdatedAtOk() (ret SnapshotGetUpdatedAtRetType, ok bool) {
|
|
return getSnapshotGetUpdatedAtAttributeTypeOk(o.UpdatedAt)
|
|
}
|
|
|
|
// HasUpdatedAt returns a boolean if a field has been set.
|
|
func (o *Snapshot) HasUpdatedAt() bool {
|
|
_, ok := o.GetUpdatedAtOk()
|
|
return ok
|
|
}
|
|
|
|
// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field.
|
|
func (o *Snapshot) SetUpdatedAt(v SnapshotGetUpdatedAtRetType) {
|
|
setSnapshotGetUpdatedAtAttributeType(&o.UpdatedAt, v)
|
|
}
|
|
|
|
// GetVolumeId returns the VolumeId field value
|
|
func (o *Snapshot) GetVolumeId() (ret SnapshotGetVolumeIdRetType) {
|
|
ret, _ = o.GetVolumeIdOk()
|
|
return ret
|
|
}
|
|
|
|
// GetVolumeIdOk returns a tuple with the VolumeId field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *Snapshot) GetVolumeIdOk() (ret SnapshotGetVolumeIdRetType, ok bool) {
|
|
return getSnapshotGetVolumeIdAttributeTypeOk(o.VolumeId)
|
|
}
|
|
|
|
// SetVolumeId sets field value
|
|
func (o *Snapshot) SetVolumeId(v SnapshotGetVolumeIdRetType) {
|
|
setSnapshotGetVolumeIdAttributeType(&o.VolumeId, v)
|
|
}
|
|
|
|
func (o Snapshot) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getSnapshotGetCreatedAtAttributeTypeOk(o.CreatedAt); ok {
|
|
toSerialize["CreatedAt"] = val
|
|
}
|
|
if val, ok := getSnapshotGetIdAttributeTypeOk(o.Id); ok {
|
|
toSerialize["Id"] = val
|
|
}
|
|
if val, ok := getSnapshotGetLabelsAttributeTypeOk(o.Labels); ok {
|
|
toSerialize["Labels"] = val
|
|
}
|
|
if val, ok := getSnapshotGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getSnapshotGetSizeAttributeTypeOk(o.Size); ok {
|
|
toSerialize["Size"] = val
|
|
}
|
|
if val, ok := getSnapshotGetStatusAttributeTypeOk(o.Status); ok {
|
|
toSerialize["Status"] = val
|
|
}
|
|
if val, ok := getSnapshotGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok {
|
|
toSerialize["UpdatedAt"] = val
|
|
}
|
|
if val, ok := getSnapshotGetVolumeIdAttributeTypeOk(o.VolumeId); ok {
|
|
toSerialize["VolumeId"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableSnapshot struct {
|
|
value *Snapshot
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableSnapshot) Get() *Snapshot {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableSnapshot) Set(val *Snapshot) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableSnapshot) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableSnapshot) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableSnapshot(val *Snapshot) *NullableSnapshot {
|
|
return &NullableSnapshot{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableSnapshot) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableSnapshot) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|