* fix: remove license header from files * fix: updated docs and sample --------- Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud>
436 lines
17 KiB
Go
436 lines
17 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 UpdateInstanceRequestPayload type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &UpdateInstanceRequestPayload{}
|
|
|
|
/*
|
|
types and functions for backupSchedule
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type UpdateInstanceRequestPayloadGetBackupScheduleAttributeType = *string
|
|
|
|
func getUpdateInstanceRequestPayloadGetBackupScheduleAttributeTypeOk(arg UpdateInstanceRequestPayloadGetBackupScheduleAttributeType) (ret UpdateInstanceRequestPayloadGetBackupScheduleRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setUpdateInstanceRequestPayloadGetBackupScheduleAttributeType(arg *UpdateInstanceRequestPayloadGetBackupScheduleAttributeType, val UpdateInstanceRequestPayloadGetBackupScheduleRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type UpdateInstanceRequestPayloadGetBackupScheduleArgType = string
|
|
type UpdateInstanceRequestPayloadGetBackupScheduleRetType = string
|
|
|
|
/*
|
|
types and functions for flavorId
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type UpdateInstanceRequestPayloadGetFlavorIdAttributeType = *string
|
|
|
|
func getUpdateInstanceRequestPayloadGetFlavorIdAttributeTypeOk(arg UpdateInstanceRequestPayloadGetFlavorIdAttributeType) (ret UpdateInstanceRequestPayloadGetFlavorIdRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setUpdateInstanceRequestPayloadGetFlavorIdAttributeType(arg *UpdateInstanceRequestPayloadGetFlavorIdAttributeType, val UpdateInstanceRequestPayloadGetFlavorIdRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type UpdateInstanceRequestPayloadGetFlavorIdArgType = string
|
|
type UpdateInstanceRequestPayloadGetFlavorIdRetType = string
|
|
|
|
/*
|
|
types and functions for name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type UpdateInstanceRequestPayloadGetNameAttributeType = *string
|
|
|
|
func getUpdateInstanceRequestPayloadGetNameAttributeTypeOk(arg UpdateInstanceRequestPayloadGetNameAttributeType) (ret UpdateInstanceRequestPayloadGetNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setUpdateInstanceRequestPayloadGetNameAttributeType(arg *UpdateInstanceRequestPayloadGetNameAttributeType, val UpdateInstanceRequestPayloadGetNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type UpdateInstanceRequestPayloadGetNameArgType = string
|
|
type UpdateInstanceRequestPayloadGetNameRetType = string
|
|
|
|
/*
|
|
types and functions for network
|
|
*/
|
|
|
|
// isModel
|
|
type UpdateInstanceRequestPayloadGetNetworkAttributeType = *InstanceNetwork
|
|
type UpdateInstanceRequestPayloadGetNetworkArgType = InstanceNetwork
|
|
type UpdateInstanceRequestPayloadGetNetworkRetType = InstanceNetwork
|
|
|
|
func getUpdateInstanceRequestPayloadGetNetworkAttributeTypeOk(arg UpdateInstanceRequestPayloadGetNetworkAttributeType) (ret UpdateInstanceRequestPayloadGetNetworkRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setUpdateInstanceRequestPayloadGetNetworkAttributeType(arg *UpdateInstanceRequestPayloadGetNetworkAttributeType, val UpdateInstanceRequestPayloadGetNetworkRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for replicas
|
|
*/
|
|
|
|
// isEnumRef
|
|
type UpdateInstanceRequestPayloadGetReplicasAttributeType = *Replicas
|
|
type UpdateInstanceRequestPayloadGetReplicasArgType = Replicas
|
|
type UpdateInstanceRequestPayloadGetReplicasRetType = Replicas
|
|
|
|
func getUpdateInstanceRequestPayloadGetReplicasAttributeTypeOk(arg UpdateInstanceRequestPayloadGetReplicasAttributeType) (ret UpdateInstanceRequestPayloadGetReplicasRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setUpdateInstanceRequestPayloadGetReplicasAttributeType(arg *UpdateInstanceRequestPayloadGetReplicasAttributeType, val UpdateInstanceRequestPayloadGetReplicasRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for retentionDays
|
|
*/
|
|
|
|
// isInteger
|
|
type UpdateInstanceRequestPayloadGetRetentionDaysAttributeType = *int64
|
|
type UpdateInstanceRequestPayloadGetRetentionDaysArgType = int64
|
|
type UpdateInstanceRequestPayloadGetRetentionDaysRetType = int64
|
|
|
|
func getUpdateInstanceRequestPayloadGetRetentionDaysAttributeTypeOk(arg UpdateInstanceRequestPayloadGetRetentionDaysAttributeType) (ret UpdateInstanceRequestPayloadGetRetentionDaysRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setUpdateInstanceRequestPayloadGetRetentionDaysAttributeType(arg *UpdateInstanceRequestPayloadGetRetentionDaysAttributeType, val UpdateInstanceRequestPayloadGetRetentionDaysRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for storage
|
|
*/
|
|
|
|
// isModel
|
|
type UpdateInstanceRequestPayloadGetStorageAttributeType = *StorageUpdate
|
|
type UpdateInstanceRequestPayloadGetStorageArgType = StorageUpdate
|
|
type UpdateInstanceRequestPayloadGetStorageRetType = StorageUpdate
|
|
|
|
func getUpdateInstanceRequestPayloadGetStorageAttributeTypeOk(arg UpdateInstanceRequestPayloadGetStorageAttributeType) (ret UpdateInstanceRequestPayloadGetStorageRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setUpdateInstanceRequestPayloadGetStorageAttributeType(arg *UpdateInstanceRequestPayloadGetStorageAttributeType, val UpdateInstanceRequestPayloadGetStorageRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for version
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type UpdateInstanceRequestPayloadGetVersionAttributeType = *string
|
|
|
|
func getUpdateInstanceRequestPayloadGetVersionAttributeTypeOk(arg UpdateInstanceRequestPayloadGetVersionAttributeType) (ret UpdateInstanceRequestPayloadGetVersionRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setUpdateInstanceRequestPayloadGetVersionAttributeType(arg *UpdateInstanceRequestPayloadGetVersionAttributeType, val UpdateInstanceRequestPayloadGetVersionRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type UpdateInstanceRequestPayloadGetVersionArgType = string
|
|
type UpdateInstanceRequestPayloadGetVersionRetType = string
|
|
|
|
// UpdateInstanceRequestPayload struct for UpdateInstanceRequestPayload
|
|
type UpdateInstanceRequestPayload struct {
|
|
// The schedule for on what time and how often the database backup will be created. The schedule is written as a cron schedule.
|
|
// REQUIRED
|
|
BackupSchedule UpdateInstanceRequestPayloadGetBackupScheduleAttributeType `json:"backupSchedule" required:"true"`
|
|
// The id of the instance flavor.
|
|
// REQUIRED
|
|
FlavorId UpdateInstanceRequestPayloadGetFlavorIdAttributeType `json:"flavorId" required:"true"`
|
|
// The name of the instance.
|
|
// REQUIRED
|
|
Name UpdateInstanceRequestPayloadGetNameAttributeType `json:"name" required:"true"`
|
|
// REQUIRED
|
|
Network UpdateInstanceRequestPayloadGetNetworkAttributeType `json:"network" required:"true"`
|
|
// REQUIRED
|
|
Replicas UpdateInstanceRequestPayloadGetReplicasAttributeType `json:"replicas" required:"true"`
|
|
// How long backups are retained. The value can only be between 32 and 365 days.
|
|
// Can be cast to int32 without loss of precision.
|
|
// REQUIRED
|
|
RetentionDays UpdateInstanceRequestPayloadGetRetentionDaysAttributeType `json:"retentionDays" required:"true"`
|
|
// REQUIRED
|
|
Storage UpdateInstanceRequestPayloadGetStorageAttributeType `json:"storage" required:"true"`
|
|
// The Postgres version used for the instance. See [Versions Endpoint](/documentation/postgres-flex-service/version/v3alpha1#tag/Version) for supported version parameters.
|
|
// REQUIRED
|
|
Version UpdateInstanceRequestPayloadGetVersionAttributeType `json:"version" required:"true"`
|
|
}
|
|
|
|
type _UpdateInstanceRequestPayload UpdateInstanceRequestPayload
|
|
|
|
// NewUpdateInstanceRequestPayload instantiates a new UpdateInstanceRequestPayload 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 NewUpdateInstanceRequestPayload(backupSchedule UpdateInstanceRequestPayloadGetBackupScheduleArgType, flavorId UpdateInstanceRequestPayloadGetFlavorIdArgType, name UpdateInstanceRequestPayloadGetNameArgType, network UpdateInstanceRequestPayloadGetNetworkArgType, replicas UpdateInstanceRequestPayloadGetReplicasArgType, retentionDays UpdateInstanceRequestPayloadGetRetentionDaysArgType, storage UpdateInstanceRequestPayloadGetStorageArgType, version UpdateInstanceRequestPayloadGetVersionArgType) *UpdateInstanceRequestPayload {
|
|
this := UpdateInstanceRequestPayload{}
|
|
setUpdateInstanceRequestPayloadGetBackupScheduleAttributeType(&this.BackupSchedule, backupSchedule)
|
|
setUpdateInstanceRequestPayloadGetFlavorIdAttributeType(&this.FlavorId, flavorId)
|
|
setUpdateInstanceRequestPayloadGetNameAttributeType(&this.Name, name)
|
|
setUpdateInstanceRequestPayloadGetNetworkAttributeType(&this.Network, network)
|
|
setUpdateInstanceRequestPayloadGetReplicasAttributeType(&this.Replicas, replicas)
|
|
setUpdateInstanceRequestPayloadGetRetentionDaysAttributeType(&this.RetentionDays, retentionDays)
|
|
setUpdateInstanceRequestPayloadGetStorageAttributeType(&this.Storage, storage)
|
|
setUpdateInstanceRequestPayloadGetVersionAttributeType(&this.Version, version)
|
|
return &this
|
|
}
|
|
|
|
// NewUpdateInstanceRequestPayloadWithDefaults instantiates a new UpdateInstanceRequestPayload 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 NewUpdateInstanceRequestPayloadWithDefaults() *UpdateInstanceRequestPayload {
|
|
this := UpdateInstanceRequestPayload{}
|
|
return &this
|
|
}
|
|
|
|
// GetBackupSchedule returns the BackupSchedule field value
|
|
func (o *UpdateInstanceRequestPayload) GetBackupSchedule() (ret UpdateInstanceRequestPayloadGetBackupScheduleRetType) {
|
|
ret, _ = o.GetBackupScheduleOk()
|
|
return ret
|
|
}
|
|
|
|
// GetBackupScheduleOk returns a tuple with the BackupSchedule field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UpdateInstanceRequestPayload) GetBackupScheduleOk() (ret UpdateInstanceRequestPayloadGetBackupScheduleRetType, ok bool) {
|
|
return getUpdateInstanceRequestPayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule)
|
|
}
|
|
|
|
// SetBackupSchedule sets field value
|
|
func (o *UpdateInstanceRequestPayload) SetBackupSchedule(v UpdateInstanceRequestPayloadGetBackupScheduleRetType) {
|
|
setUpdateInstanceRequestPayloadGetBackupScheduleAttributeType(&o.BackupSchedule, v)
|
|
}
|
|
|
|
// GetFlavorId returns the FlavorId field value
|
|
func (o *UpdateInstanceRequestPayload) GetFlavorId() (ret UpdateInstanceRequestPayloadGetFlavorIdRetType) {
|
|
ret, _ = o.GetFlavorIdOk()
|
|
return ret
|
|
}
|
|
|
|
// GetFlavorIdOk returns a tuple with the FlavorId field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UpdateInstanceRequestPayload) GetFlavorIdOk() (ret UpdateInstanceRequestPayloadGetFlavorIdRetType, ok bool) {
|
|
return getUpdateInstanceRequestPayloadGetFlavorIdAttributeTypeOk(o.FlavorId)
|
|
}
|
|
|
|
// SetFlavorId sets field value
|
|
func (o *UpdateInstanceRequestPayload) SetFlavorId(v UpdateInstanceRequestPayloadGetFlavorIdRetType) {
|
|
setUpdateInstanceRequestPayloadGetFlavorIdAttributeType(&o.FlavorId, v)
|
|
}
|
|
|
|
// GetName returns the Name field value
|
|
func (o *UpdateInstanceRequestPayload) GetName() (ret UpdateInstanceRequestPayloadGetNameRetType) {
|
|
ret, _ = o.GetNameOk()
|
|
return ret
|
|
}
|
|
|
|
// GetNameOk returns a tuple with the Name field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UpdateInstanceRequestPayload) GetNameOk() (ret UpdateInstanceRequestPayloadGetNameRetType, ok bool) {
|
|
return getUpdateInstanceRequestPayloadGetNameAttributeTypeOk(o.Name)
|
|
}
|
|
|
|
// SetName sets field value
|
|
func (o *UpdateInstanceRequestPayload) SetName(v UpdateInstanceRequestPayloadGetNameRetType) {
|
|
setUpdateInstanceRequestPayloadGetNameAttributeType(&o.Name, v)
|
|
}
|
|
|
|
// GetNetwork returns the Network field value
|
|
func (o *UpdateInstanceRequestPayload) GetNetwork() (ret UpdateInstanceRequestPayloadGetNetworkRetType) {
|
|
ret, _ = o.GetNetworkOk()
|
|
return ret
|
|
}
|
|
|
|
// GetNetworkOk returns a tuple with the Network field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UpdateInstanceRequestPayload) GetNetworkOk() (ret UpdateInstanceRequestPayloadGetNetworkRetType, ok bool) {
|
|
return getUpdateInstanceRequestPayloadGetNetworkAttributeTypeOk(o.Network)
|
|
}
|
|
|
|
// SetNetwork sets field value
|
|
func (o *UpdateInstanceRequestPayload) SetNetwork(v UpdateInstanceRequestPayloadGetNetworkRetType) {
|
|
setUpdateInstanceRequestPayloadGetNetworkAttributeType(&o.Network, v)
|
|
}
|
|
|
|
// GetReplicas returns the Replicas field value
|
|
func (o *UpdateInstanceRequestPayload) GetReplicas() (ret UpdateInstanceRequestPayloadGetReplicasRetType) {
|
|
ret, _ = o.GetReplicasOk()
|
|
return ret
|
|
}
|
|
|
|
// GetReplicasOk returns a tuple with the Replicas field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UpdateInstanceRequestPayload) GetReplicasOk() (ret UpdateInstanceRequestPayloadGetReplicasRetType, ok bool) {
|
|
return getUpdateInstanceRequestPayloadGetReplicasAttributeTypeOk(o.Replicas)
|
|
}
|
|
|
|
// SetReplicas sets field value
|
|
func (o *UpdateInstanceRequestPayload) SetReplicas(v UpdateInstanceRequestPayloadGetReplicasRetType) {
|
|
setUpdateInstanceRequestPayloadGetReplicasAttributeType(&o.Replicas, v)
|
|
}
|
|
|
|
// GetRetentionDays returns the RetentionDays field value
|
|
func (o *UpdateInstanceRequestPayload) GetRetentionDays() (ret UpdateInstanceRequestPayloadGetRetentionDaysRetType) {
|
|
ret, _ = o.GetRetentionDaysOk()
|
|
return ret
|
|
}
|
|
|
|
// GetRetentionDaysOk returns a tuple with the RetentionDays field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UpdateInstanceRequestPayload) GetRetentionDaysOk() (ret UpdateInstanceRequestPayloadGetRetentionDaysRetType, ok bool) {
|
|
return getUpdateInstanceRequestPayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays)
|
|
}
|
|
|
|
// SetRetentionDays sets field value
|
|
func (o *UpdateInstanceRequestPayload) SetRetentionDays(v UpdateInstanceRequestPayloadGetRetentionDaysRetType) {
|
|
setUpdateInstanceRequestPayloadGetRetentionDaysAttributeType(&o.RetentionDays, v)
|
|
}
|
|
|
|
// GetStorage returns the Storage field value
|
|
func (o *UpdateInstanceRequestPayload) GetStorage() (ret UpdateInstanceRequestPayloadGetStorageRetType) {
|
|
ret, _ = o.GetStorageOk()
|
|
return ret
|
|
}
|
|
|
|
// GetStorageOk returns a tuple with the Storage field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UpdateInstanceRequestPayload) GetStorageOk() (ret UpdateInstanceRequestPayloadGetStorageRetType, ok bool) {
|
|
return getUpdateInstanceRequestPayloadGetStorageAttributeTypeOk(o.Storage)
|
|
}
|
|
|
|
// SetStorage sets field value
|
|
func (o *UpdateInstanceRequestPayload) SetStorage(v UpdateInstanceRequestPayloadGetStorageRetType) {
|
|
setUpdateInstanceRequestPayloadGetStorageAttributeType(&o.Storage, v)
|
|
}
|
|
|
|
// GetVersion returns the Version field value
|
|
func (o *UpdateInstanceRequestPayload) GetVersion() (ret UpdateInstanceRequestPayloadGetVersionRetType) {
|
|
ret, _ = o.GetVersionOk()
|
|
return ret
|
|
}
|
|
|
|
// GetVersionOk returns a tuple with the Version field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *UpdateInstanceRequestPayload) GetVersionOk() (ret UpdateInstanceRequestPayloadGetVersionRetType, ok bool) {
|
|
return getUpdateInstanceRequestPayloadGetVersionAttributeTypeOk(o.Version)
|
|
}
|
|
|
|
// SetVersion sets field value
|
|
func (o *UpdateInstanceRequestPayload) SetVersion(v UpdateInstanceRequestPayloadGetVersionRetType) {
|
|
setUpdateInstanceRequestPayloadGetVersionAttributeType(&o.Version, v)
|
|
}
|
|
|
|
func (o UpdateInstanceRequestPayload) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getUpdateInstanceRequestPayloadGetBackupScheduleAttributeTypeOk(o.BackupSchedule); ok {
|
|
toSerialize["BackupSchedule"] = val
|
|
}
|
|
if val, ok := getUpdateInstanceRequestPayloadGetFlavorIdAttributeTypeOk(o.FlavorId); ok {
|
|
toSerialize["FlavorId"] = val
|
|
}
|
|
if val, ok := getUpdateInstanceRequestPayloadGetNameAttributeTypeOk(o.Name); ok {
|
|
toSerialize["Name"] = val
|
|
}
|
|
if val, ok := getUpdateInstanceRequestPayloadGetNetworkAttributeTypeOk(o.Network); ok {
|
|
toSerialize["Network"] = val
|
|
}
|
|
if val, ok := getUpdateInstanceRequestPayloadGetReplicasAttributeTypeOk(o.Replicas); ok {
|
|
toSerialize["Replicas"] = val
|
|
}
|
|
if val, ok := getUpdateInstanceRequestPayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok {
|
|
toSerialize["RetentionDays"] = val
|
|
}
|
|
if val, ok := getUpdateInstanceRequestPayloadGetStorageAttributeTypeOk(o.Storage); ok {
|
|
toSerialize["Storage"] = val
|
|
}
|
|
if val, ok := getUpdateInstanceRequestPayloadGetVersionAttributeTypeOk(o.Version); ok {
|
|
toSerialize["Version"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableUpdateInstanceRequestPayload struct {
|
|
value *UpdateInstanceRequestPayload
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableUpdateInstanceRequestPayload) Get() *UpdateInstanceRequestPayload {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableUpdateInstanceRequestPayload) Set(val *UpdateInstanceRequestPayload) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableUpdateInstanceRequestPayload) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableUpdateInstanceRequestPayload) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableUpdateInstanceRequestPayload(val *UpdateInstanceRequestPayload) *NullableUpdateInstanceRequestPayload {
|
|
return &NullableUpdateInstanceRequestPayload{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableUpdateInstanceRequestPayload) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableUpdateInstanceRequestPayload) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|