diff --git a/services/serverbackup/CHANGELOG.md b/services/serverbackup/CHANGELOG.md index 7ff3db735..0576cf6f5 100644 --- a/services/serverbackup/CHANGELOG.md +++ b/services/serverbackup/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.2.0 (2024-10-14) + +- **Feature:** Add support for nullable models + ## v0.1.0 (2024-05-23) - Manage your STACKIT Server Backups: `Backup`, `BackupSchedule`, `VolumeBackup` diff --git a/services/serverbackup/model_backup.go b/services/serverbackup/model_backup.go index b1688eb87..9aac42749 100644 --- a/services/serverbackup/model_backup.go +++ b/services/serverbackup/model_backup.go @@ -10,6 +10,13 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + // Backup struct for Backup type Backup struct { // REQUIRED @@ -27,3 +34,298 @@ type Backup struct { Status *string `json:"status"` VolumeBackups *[]BackupVolumeBackupsInner `json:"volumeBackups,omitempty"` } + +type _Backup Backup + +// NewBackup instantiates a new Backup 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 NewBackup(createdAt *string, expireAt *string, id *string, name *string, status *string) *Backup { + this := Backup{} + this.CreatedAt = createdAt + this.ExpireAt = expireAt + this.Id = id + this.Name = name + this.Status = status + return &this +} + +// NewBackupWithDefaults instantiates a new Backup 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 NewBackupWithDefaults() *Backup { + this := Backup{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Backup) GetCreatedAt() *string { + if o == nil { + var ret *string + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Backup) GetCreatedAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Backup) SetCreatedAt(v *string) { + o.CreatedAt = v +} + +// GetExpireAt returns the ExpireAt field value +func (o *Backup) GetExpireAt() *string { + if o == nil { + var ret *string + return ret + } + + return o.ExpireAt +} + +// GetExpireAtOk returns a tuple with the ExpireAt field value +// and a boolean to check if the value has been set. +func (o *Backup) GetExpireAtOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.ExpireAt, true +} + +// SetExpireAt sets field value +func (o *Backup) SetExpireAt(v *string) { + o.ExpireAt = v +} + +// GetId returns the Id field value +func (o *Backup) GetId() *string { + if o == nil { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Backup) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *Backup) SetId(v *string) { + o.Id = v +} + +// GetLastRestoredAt returns the LastRestoredAt field value if set, zero value otherwise. +func (o *Backup) GetLastRestoredAt() *string { + if o == nil || IsNil(o.LastRestoredAt) { + var ret *string + return ret + } + return o.LastRestoredAt +} + +// GetLastRestoredAtOk returns a tuple with the LastRestoredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetLastRestoredAtOk() (*string, bool) { + if o == nil || IsNil(o.LastRestoredAt) { + return nil, false + } + return o.LastRestoredAt, true +} + +// HasLastRestoredAt returns a boolean if a field has been set. +func (o *Backup) HasLastRestoredAt() bool { + if o != nil && !IsNil(o.LastRestoredAt) { + return true + } + + return false +} + +// SetLastRestoredAt gets a reference to the given string and assigns it to the LastRestoredAt field. +func (o *Backup) SetLastRestoredAt(v *string) { + o.LastRestoredAt = v +} + +// GetName returns the Name field value +func (o *Backup) GetName() *string { + if o == nil { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Backup) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *Backup) SetName(v *string) { + o.Name = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *Backup) GetSize() *int64 { + if o == nil || IsNil(o.Size) { + var ret *int64 + return ret + } + return o.Size +} + +// 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 *Backup) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *Backup) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *Backup) SetSize(v *int64) { + o.Size = v +} + +// GetStatus returns the Status field value +func (o *Backup) GetStatus() *string { + if o == nil { + var ret *string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Backup) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Status, true +} + +// SetStatus sets field value +func (o *Backup) SetStatus(v *string) { + o.Status = v +} + +// GetVolumeBackups returns the VolumeBackups field value if set, zero value otherwise. +func (o *Backup) GetVolumeBackups() *[]BackupVolumeBackupsInner { + if o == nil || IsNil(o.VolumeBackups) { + var ret *[]BackupVolumeBackupsInner + return ret + } + return o.VolumeBackups +} + +// GetVolumeBackupsOk returns a tuple with the VolumeBackups field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Backup) GetVolumeBackupsOk() (*[]BackupVolumeBackupsInner, bool) { + if o == nil || IsNil(o.VolumeBackups) { + return nil, false + } + return o.VolumeBackups, true +} + +// HasVolumeBackups returns a boolean if a field has been set. +func (o *Backup) HasVolumeBackups() bool { + if o != nil && !IsNil(o.VolumeBackups) { + return true + } + + return false +} + +// SetVolumeBackups gets a reference to the given []BackupVolumeBackupsInner and assigns it to the VolumeBackups field. +func (o *Backup) SetVolumeBackups(v *[]BackupVolumeBackupsInner) { + o.VolumeBackups = v +} + +func (o Backup) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["createdAt"] = o.CreatedAt + toSerialize["expireAt"] = o.ExpireAt + toSerialize["id"] = o.Id + if !IsNil(o.LastRestoredAt) { + toSerialize["lastRestoredAt"] = o.LastRestoredAt + } + toSerialize["name"] = o.Name + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + toSerialize["status"] = o.Status + if !IsNil(o.VolumeBackups) { + toSerialize["volumeBackups"] = o.VolumeBackups + } + return toSerialize, nil +} + +type NullableBackup struct { + value *Backup + isSet bool +} + +func (v NullableBackup) Get() *Backup { + return v.value +} + +func (v *NullableBackup) Set(val *Backup) { + v.value = val + v.isSet = true +} + +func (v NullableBackup) IsSet() bool { + return v.isSet +} + +func (v *NullableBackup) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackup(val *Backup) *NullableBackup { + return &NullableBackup{value: val, isSet: true} +} + +func (v NullableBackup) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackup) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_backup_job.go b/services/serverbackup/model_backup_job.go index 2eeb6d1ea..e23e4ae1c 100644 --- a/services/serverbackup/model_backup_job.go +++ b/services/serverbackup/model_backup_job.go @@ -10,8 +10,101 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the BackupJob type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupJob{} + // BackupJob struct for BackupJob type BackupJob struct { // REQUIRED Id *string `json:"id"` } + +type _BackupJob BackupJob + +// NewBackupJob instantiates a new BackupJob 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 NewBackupJob(id *string) *BackupJob { + this := BackupJob{} + this.Id = id + return &this +} + +// NewBackupJobWithDefaults instantiates a new BackupJob 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 NewBackupJobWithDefaults() *BackupJob { + this := BackupJob{} + return &this +} + +// GetId returns the Id field value +func (o *BackupJob) GetId() *string { + if o == nil { + var ret *string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BackupJob) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *BackupJob) SetId(v *string) { + o.Id = v +} + +func (o BackupJob) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +type NullableBackupJob struct { + value *BackupJob + isSet bool +} + +func (v NullableBackupJob) Get() *BackupJob { + return v.value +} + +func (v *NullableBackupJob) Set(val *BackupJob) { + v.value = val + v.isSet = true +} + +func (v NullableBackupJob) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupJob) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupJob(val *BackupJob) *NullableBackupJob { + return &NullableBackupJob{value: val, isSet: true} +} + +func (v NullableBackupJob) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupJob) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_backup_properties.go b/services/serverbackup/model_backup_properties.go index 94c6740f9..fd8378924 100644 --- a/services/serverbackup/model_backup_properties.go +++ b/services/serverbackup/model_backup_properties.go @@ -10,6 +10,13 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the BackupProperties type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupProperties{} + // BackupProperties struct for BackupProperties type BackupProperties struct { // Max 255 characters @@ -21,3 +28,150 @@ type BackupProperties struct { RetentionPeriod *int64 `json:"retentionPeriod"` VolumeIds *[]string `json:"volumeIds,omitempty"` } + +type _BackupProperties BackupProperties + +// NewBackupProperties instantiates a new BackupProperties 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 NewBackupProperties(name *string, retentionPeriod *int64) *BackupProperties { + this := BackupProperties{} + this.Name = name + this.RetentionPeriod = retentionPeriod + return &this +} + +// NewBackupPropertiesWithDefaults instantiates a new BackupProperties 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 NewBackupPropertiesWithDefaults() *BackupProperties { + this := BackupProperties{} + return &this +} + +// GetName returns the Name field value +func (o *BackupProperties) GetName() *string { + if o == nil { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *BackupProperties) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *BackupProperties) SetName(v *string) { + o.Name = v +} + +// GetRetentionPeriod returns the RetentionPeriod field value +func (o *BackupProperties) GetRetentionPeriod() *int64 { + if o == nil { + var ret *int64 + return ret + } + + return o.RetentionPeriod +} + +// GetRetentionPeriodOk returns a tuple with the RetentionPeriod field value +// and a boolean to check if the value has been set. +func (o *BackupProperties) GetRetentionPeriodOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.RetentionPeriod, true +} + +// SetRetentionPeriod sets field value +func (o *BackupProperties) SetRetentionPeriod(v *int64) { + o.RetentionPeriod = v +} + +// GetVolumeIds returns the VolumeIds field value if set, zero value otherwise. +func (o *BackupProperties) GetVolumeIds() *[]string { + if o == nil || IsNil(o.VolumeIds) { + var ret *[]string + return ret + } + return o.VolumeIds +} + +// GetVolumeIdsOk returns a tuple with the VolumeIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupProperties) GetVolumeIdsOk() (*[]string, bool) { + if o == nil || IsNil(o.VolumeIds) { + return nil, false + } + return o.VolumeIds, true +} + +// HasVolumeIds returns a boolean if a field has been set. +func (o *BackupProperties) HasVolumeIds() bool { + if o != nil && !IsNil(o.VolumeIds) { + return true + } + + return false +} + +// SetVolumeIds gets a reference to the given []string and assigns it to the VolumeIds field. +func (o *BackupProperties) SetVolumeIds(v *[]string) { + o.VolumeIds = v +} + +func (o BackupProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["retentionPeriod"] = o.RetentionPeriod + if !IsNil(o.VolumeIds) { + toSerialize["volumeIds"] = o.VolumeIds + } + return toSerialize, nil +} + +type NullableBackupProperties struct { + value *BackupProperties + isSet bool +} + +func (v NullableBackupProperties) Get() *BackupProperties { + return v.value +} + +func (v *NullableBackupProperties) Set(val *BackupProperties) { + v.value = val + v.isSet = true +} + +func (v NullableBackupProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupProperties(val *BackupProperties) *NullableBackupProperties { + return &NullableBackupProperties{value: val, isSet: true} +} + +func (v NullableBackupProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_backup_schedule.go b/services/serverbackup/model_backup_schedule.go index d7f6170da..21f67c8fc 100644 --- a/services/serverbackup/model_backup_schedule.go +++ b/services/serverbackup/model_backup_schedule.go @@ -10,6 +10,13 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the BackupSchedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupSchedule{} + // BackupSchedule struct for BackupSchedule type BackupSchedule struct { BackupProperties *BackupProperties `json:"backupProperties,omitempty"` @@ -23,3 +30,202 @@ type BackupSchedule struct { // REQUIRED Rrule *string `json:"rrule"` } + +type _BackupSchedule BackupSchedule + +// NewBackupSchedule instantiates a new BackupSchedule 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 NewBackupSchedule(enabled *bool, id *int64, name *string, rrule *string) *BackupSchedule { + this := BackupSchedule{} + this.Enabled = enabled + this.Id = id + this.Name = name + this.Rrule = rrule + return &this +} + +// NewBackupScheduleWithDefaults instantiates a new BackupSchedule 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 NewBackupScheduleWithDefaults() *BackupSchedule { + this := BackupSchedule{} + return &this +} + +// GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +func (o *BackupSchedule) GetBackupProperties() *BackupProperties { + if o == nil || IsNil(o.BackupProperties) { + var ret *BackupProperties + return ret + } + return o.BackupProperties +} + +// GetBackupPropertiesOk returns a tuple with the BackupProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupSchedule) GetBackupPropertiesOk() (*BackupProperties, bool) { + if o == nil || IsNil(o.BackupProperties) { + return nil, false + } + return o.BackupProperties, true +} + +// HasBackupProperties returns a boolean if a field has been set. +func (o *BackupSchedule) HasBackupProperties() bool { + if o != nil && !IsNil(o.BackupProperties) { + return true + } + + return false +} + +// SetBackupProperties gets a reference to the given BackupProperties and assigns it to the BackupProperties field. +func (o *BackupSchedule) SetBackupProperties(v *BackupProperties) { + o.BackupProperties = v +} + +// GetEnabled returns the Enabled field value +func (o *BackupSchedule) GetEnabled() *bool { + if o == nil { + var ret *bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *BackupSchedule) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.Enabled, true +} + +// SetEnabled sets field value +func (o *BackupSchedule) SetEnabled(v *bool) { + o.Enabled = v +} + +// GetId returns the Id field value +func (o *BackupSchedule) GetId() *int64 { + if o == nil { + var ret *int64 + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *BackupSchedule) GetIdOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.Id, true +} + +// SetId sets field value +func (o *BackupSchedule) SetId(v *int64) { + o.Id = v +} + +// GetName returns the Name field value +func (o *BackupSchedule) GetName() *string { + if o == nil { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *BackupSchedule) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *BackupSchedule) SetName(v *string) { + o.Name = v +} + +// GetRrule returns the Rrule field value +func (o *BackupSchedule) GetRrule() *string { + if o == nil { + var ret *string + return ret + } + + return o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value +// and a boolean to check if the value has been set. +func (o *BackupSchedule) GetRruleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rrule, true +} + +// SetRrule sets field value +func (o *BackupSchedule) SetRrule(v *string) { + o.Rrule = v +} + +func (o BackupSchedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupProperties) { + toSerialize["backupProperties"] = o.BackupProperties + } + toSerialize["enabled"] = o.Enabled + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["rrule"] = o.Rrule + return toSerialize, nil +} + +type NullableBackupSchedule struct { + value *BackupSchedule + isSet bool +} + +func (v NullableBackupSchedule) Get() *BackupSchedule { + return v.value +} + +func (v *NullableBackupSchedule) Set(val *BackupSchedule) { + v.value = val + v.isSet = true +} + +func (v NullableBackupSchedule) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupSchedule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupSchedule(val *BackupSchedule) *NullableBackupSchedule { + return &NullableBackupSchedule{value: val, isSet: true} +} + +func (v NullableBackupSchedule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_backup_volume_backups_inner.go b/services/serverbackup/model_backup_volume_backups_inner.go index 5506691e7..8d58b63f3 100644 --- a/services/serverbackup/model_backup_volume_backups_inner.go +++ b/services/serverbackup/model_backup_volume_backups_inner.go @@ -10,6 +10,13 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the BackupVolumeBackupsInner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupVolumeBackupsInner{} + // BackupVolumeBackupsInner struct for BackupVolumeBackupsInner type BackupVolumeBackupsInner struct { Id *string `json:"id,omitempty"` @@ -20,3 +27,271 @@ type BackupVolumeBackupsInner struct { Status *string `json:"status,omitempty"` VolumeId *string `json:"volumeId,omitempty"` } + +// NewBackupVolumeBackupsInner instantiates a new BackupVolumeBackupsInner 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 NewBackupVolumeBackupsInner() *BackupVolumeBackupsInner { + this := BackupVolumeBackupsInner{} + return &this +} + +// NewBackupVolumeBackupsInnerWithDefaults instantiates a new BackupVolumeBackupsInner 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 NewBackupVolumeBackupsInnerWithDefaults() *BackupVolumeBackupsInner { + this := BackupVolumeBackupsInner{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BackupVolumeBackupsInner) GetId() *string { + if o == nil || IsNil(o.Id) { + var ret *string + return ret + } + return o.Id +} + +// 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 *BackupVolumeBackupsInner) GetIdOk() (*string, bool) { + if o == nil || IsNil(o.Id) { + return nil, false + } + return o.Id, true +} + +// HasId returns a boolean if a field has been set. +func (o *BackupVolumeBackupsInner) HasId() bool { + if o != nil && !IsNil(o.Id) { + return true + } + + return false +} + +// SetId gets a reference to the given string and assigns it to the Id field. +func (o *BackupVolumeBackupsInner) SetId(v *string) { + o.Id = v +} + +// GetLastRestoredAt returns the LastRestoredAt field value if set, zero value otherwise. +func (o *BackupVolumeBackupsInner) GetLastRestoredAt() *string { + if o == nil || IsNil(o.LastRestoredAt) { + var ret *string + return ret + } + return o.LastRestoredAt +} + +// GetLastRestoredAtOk returns a tuple with the LastRestoredAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupVolumeBackupsInner) GetLastRestoredAtOk() (*string, bool) { + if o == nil || IsNil(o.LastRestoredAt) { + return nil, false + } + return o.LastRestoredAt, true +} + +// HasLastRestoredAt returns a boolean if a field has been set. +func (o *BackupVolumeBackupsInner) HasLastRestoredAt() bool { + if o != nil && !IsNil(o.LastRestoredAt) { + return true + } + + return false +} + +// SetLastRestoredAt gets a reference to the given string and assigns it to the LastRestoredAt field. +func (o *BackupVolumeBackupsInner) SetLastRestoredAt(v *string) { + o.LastRestoredAt = v +} + +// GetLastRestoredVolumeId returns the LastRestoredVolumeId field value if set, zero value otherwise. +func (o *BackupVolumeBackupsInner) GetLastRestoredVolumeId() *string { + if o == nil || IsNil(o.LastRestoredVolumeId) { + var ret *string + return ret + } + return o.LastRestoredVolumeId +} + +// GetLastRestoredVolumeIdOk returns a tuple with the LastRestoredVolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupVolumeBackupsInner) GetLastRestoredVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.LastRestoredVolumeId) { + return nil, false + } + return o.LastRestoredVolumeId, true +} + +// HasLastRestoredVolumeId returns a boolean if a field has been set. +func (o *BackupVolumeBackupsInner) HasLastRestoredVolumeId() bool { + if o != nil && !IsNil(o.LastRestoredVolumeId) { + return true + } + + return false +} + +// SetLastRestoredVolumeId gets a reference to the given string and assigns it to the LastRestoredVolumeId field. +func (o *BackupVolumeBackupsInner) SetLastRestoredVolumeId(v *string) { + o.LastRestoredVolumeId = v +} + +// GetSize returns the Size field value if set, zero value otherwise. +func (o *BackupVolumeBackupsInner) GetSize() *int64 { + if o == nil || IsNil(o.Size) { + var ret *int64 + return ret + } + return o.Size +} + +// 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 *BackupVolumeBackupsInner) GetSizeOk() (*int64, bool) { + if o == nil || IsNil(o.Size) { + return nil, false + } + return o.Size, true +} + +// HasSize returns a boolean if a field has been set. +func (o *BackupVolumeBackupsInner) HasSize() bool { + if o != nil && !IsNil(o.Size) { + return true + } + + return false +} + +// SetSize gets a reference to the given int64 and assigns it to the Size field. +func (o *BackupVolumeBackupsInner) SetSize(v *int64) { + o.Size = v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *BackupVolumeBackupsInner) GetStatus() *string { + if o == nil || IsNil(o.Status) { + var ret *string + return ret + } + return o.Status +} + +// 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 *BackupVolumeBackupsInner) GetStatusOk() (*string, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *BackupVolumeBackupsInner) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given string and assigns it to the Status field. +func (o *BackupVolumeBackupsInner) SetStatus(v *string) { + o.Status = v +} + +// GetVolumeId returns the VolumeId field value if set, zero value otherwise. +func (o *BackupVolumeBackupsInner) GetVolumeId() *string { + if o == nil || IsNil(o.VolumeId) { + var ret *string + return ret + } + return o.VolumeId +} + +// GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupVolumeBackupsInner) GetVolumeIdOk() (*string, bool) { + if o == nil || IsNil(o.VolumeId) { + return nil, false + } + return o.VolumeId, true +} + +// HasVolumeId returns a boolean if a field has been set. +func (o *BackupVolumeBackupsInner) HasVolumeId() bool { + if o != nil && !IsNil(o.VolumeId) { + return true + } + + return false +} + +// SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +func (o *BackupVolumeBackupsInner) SetVolumeId(v *string) { + o.VolumeId = v +} + +func (o BackupVolumeBackupsInner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.LastRestoredAt) { + toSerialize["lastRestoredAt"] = o.LastRestoredAt + } + if !IsNil(o.LastRestoredVolumeId) { + toSerialize["lastRestoredVolumeId"] = o.LastRestoredVolumeId + } + if !IsNil(o.Size) { + toSerialize["size"] = o.Size + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.VolumeId) { + toSerialize["volumeId"] = o.VolumeId + } + return toSerialize, nil +} + +type NullableBackupVolumeBackupsInner struct { + value *BackupVolumeBackupsInner + isSet bool +} + +func (v NullableBackupVolumeBackupsInner) Get() *BackupVolumeBackupsInner { + return v.value +} + +func (v *NullableBackupVolumeBackupsInner) Set(val *BackupVolumeBackupsInner) { + v.value = val + v.isSet = true +} + +func (v NullableBackupVolumeBackupsInner) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupVolumeBackupsInner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupVolumeBackupsInner(val *BackupVolumeBackupsInner) *NullableBackupVolumeBackupsInner { + return &NullableBackupVolumeBackupsInner{value: val, isSet: true} +} + +func (v NullableBackupVolumeBackupsInner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupVolumeBackupsInner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_create_backup_payload.go b/services/serverbackup/model_create_backup_payload.go index 2155b1250..af19cbae5 100644 --- a/services/serverbackup/model_create_backup_payload.go +++ b/services/serverbackup/model_create_backup_payload.go @@ -10,6 +10,13 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the CreateBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupPayload{} + // CreateBackupPayload struct for CreateBackupPayload type CreateBackupPayload struct { // Max 255 characters @@ -21,3 +28,150 @@ type CreateBackupPayload struct { RetentionPeriod *int64 `json:"retentionPeriod"` VolumeIds *[]string `json:"volumeIds,omitempty"` } + +type _CreateBackupPayload CreateBackupPayload + +// NewCreateBackupPayload instantiates a new CreateBackupPayload 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 NewCreateBackupPayload(name *string, retentionPeriod *int64) *CreateBackupPayload { + this := CreateBackupPayload{} + this.Name = name + this.RetentionPeriod = retentionPeriod + return &this +} + +// NewCreateBackupPayloadWithDefaults instantiates a new CreateBackupPayload 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 NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { + this := CreateBackupPayload{} + return &this +} + +// GetName returns the Name field value +func (o *CreateBackupPayload) GetName() *string { + if o == nil { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CreateBackupPayload) SetName(v *string) { + o.Name = v +} + +// GetRetentionPeriod returns the RetentionPeriod field value +func (o *CreateBackupPayload) GetRetentionPeriod() *int64 { + if o == nil { + var ret *int64 + return ret + } + + return o.RetentionPeriod +} + +// GetRetentionPeriodOk returns a tuple with the RetentionPeriod field value +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetRetentionPeriodOk() (*int64, bool) { + if o == nil { + return nil, false + } + return o.RetentionPeriod, true +} + +// SetRetentionPeriod sets field value +func (o *CreateBackupPayload) SetRetentionPeriod(v *int64) { + o.RetentionPeriod = v +} + +// GetVolumeIds returns the VolumeIds field value if set, zero value otherwise. +func (o *CreateBackupPayload) GetVolumeIds() *[]string { + if o == nil || IsNil(o.VolumeIds) { + var ret *[]string + return ret + } + return o.VolumeIds +} + +// GetVolumeIdsOk returns a tuple with the VolumeIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupPayload) GetVolumeIdsOk() (*[]string, bool) { + if o == nil || IsNil(o.VolumeIds) { + return nil, false + } + return o.VolumeIds, true +} + +// HasVolumeIds returns a boolean if a field has been set. +func (o *CreateBackupPayload) HasVolumeIds() bool { + if o != nil && !IsNil(o.VolumeIds) { + return true + } + + return false +} + +// SetVolumeIds gets a reference to the given []string and assigns it to the VolumeIds field. +func (o *CreateBackupPayload) SetVolumeIds(v *[]string) { + o.VolumeIds = v +} + +func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["name"] = o.Name + toSerialize["retentionPeriod"] = o.RetentionPeriod + if !IsNil(o.VolumeIds) { + toSerialize["volumeIds"] = o.VolumeIds + } + return toSerialize, nil +} + +type NullableCreateBackupPayload struct { + value *CreateBackupPayload + isSet bool +} + +func (v NullableCreateBackupPayload) Get() *CreateBackupPayload { + return v.value +} + +func (v *NullableCreateBackupPayload) Set(val *CreateBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupPayload(val *CreateBackupPayload) *NullableCreateBackupPayload { + return &NullableCreateBackupPayload{value: val, isSet: true} +} + +func (v NullableCreateBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_create_backup_schedule_payload.go b/services/serverbackup/model_create_backup_schedule_payload.go index aa9036ece..b3ba8c140 100644 --- a/services/serverbackup/model_create_backup_schedule_payload.go +++ b/services/serverbackup/model_create_backup_schedule_payload.go @@ -10,6 +10,13 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the CreateBackupSchedulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateBackupSchedulePayload{} + // CreateBackupSchedulePayload struct for CreateBackupSchedulePayload type CreateBackupSchedulePayload struct { BackupProperties *BackupProperties `json:"backupProperties,omitempty"` @@ -21,3 +28,176 @@ type CreateBackupSchedulePayload struct { // REQUIRED Rrule *string `json:"rrule"` } + +type _CreateBackupSchedulePayload CreateBackupSchedulePayload + +// NewCreateBackupSchedulePayload instantiates a new CreateBackupSchedulePayload 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 NewCreateBackupSchedulePayload(enabled *bool, name *string, rrule *string) *CreateBackupSchedulePayload { + this := CreateBackupSchedulePayload{} + this.Enabled = enabled + this.Name = name + this.Rrule = rrule + return &this +} + +// NewCreateBackupSchedulePayloadWithDefaults instantiates a new CreateBackupSchedulePayload 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 NewCreateBackupSchedulePayloadWithDefaults() *CreateBackupSchedulePayload { + this := CreateBackupSchedulePayload{} + return &this +} + +// GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +func (o *CreateBackupSchedulePayload) GetBackupProperties() *BackupProperties { + if o == nil || IsNil(o.BackupProperties) { + var ret *BackupProperties + return ret + } + return o.BackupProperties +} + +// GetBackupPropertiesOk returns a tuple with the BackupProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateBackupSchedulePayload) GetBackupPropertiesOk() (*BackupProperties, bool) { + if o == nil || IsNil(o.BackupProperties) { + return nil, false + } + return o.BackupProperties, true +} + +// HasBackupProperties returns a boolean if a field has been set. +func (o *CreateBackupSchedulePayload) HasBackupProperties() bool { + if o != nil && !IsNil(o.BackupProperties) { + return true + } + + return false +} + +// SetBackupProperties gets a reference to the given BackupProperties and assigns it to the BackupProperties field. +func (o *CreateBackupSchedulePayload) SetBackupProperties(v *BackupProperties) { + o.BackupProperties = v +} + +// GetEnabled returns the Enabled field value +func (o *CreateBackupSchedulePayload) GetEnabled() *bool { + if o == nil { + var ret *bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *CreateBackupSchedulePayload) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.Enabled, true +} + +// SetEnabled sets field value +func (o *CreateBackupSchedulePayload) SetEnabled(v *bool) { + o.Enabled = v +} + +// GetName returns the Name field value +func (o *CreateBackupSchedulePayload) GetName() *string { + if o == nil { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateBackupSchedulePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *CreateBackupSchedulePayload) SetName(v *string) { + o.Name = v +} + +// GetRrule returns the Rrule field value +func (o *CreateBackupSchedulePayload) GetRrule() *string { + if o == nil { + var ret *string + return ret + } + + return o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value +// and a boolean to check if the value has been set. +func (o *CreateBackupSchedulePayload) GetRruleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rrule, true +} + +// SetRrule sets field value +func (o *CreateBackupSchedulePayload) SetRrule(v *string) { + o.Rrule = v +} + +func (o CreateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupProperties) { + toSerialize["backupProperties"] = o.BackupProperties + } + toSerialize["enabled"] = o.Enabled + toSerialize["name"] = o.Name + toSerialize["rrule"] = o.Rrule + return toSerialize, nil +} + +type NullableCreateBackupSchedulePayload struct { + value *CreateBackupSchedulePayload + isSet bool +} + +func (v NullableCreateBackupSchedulePayload) Get() *CreateBackupSchedulePayload { + return v.value +} + +func (v *NullableCreateBackupSchedulePayload) Set(val *CreateBackupSchedulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateBackupSchedulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateBackupSchedulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateBackupSchedulePayload(val *CreateBackupSchedulePayload) *NullableCreateBackupSchedulePayload { + return &NullableCreateBackupSchedulePayload{value: val, isSet: true} +} + +func (v NullableCreateBackupSchedulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateBackupSchedulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_enable_service_payload.go b/services/serverbackup/model_enable_service_payload.go index 706020ca9..37440cf7f 100644 --- a/services/serverbackup/model_enable_service_payload.go +++ b/services/serverbackup/model_enable_service_payload.go @@ -10,7 +10,107 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the EnableServicePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnableServicePayload{} + // EnableServicePayload struct for EnableServicePayload type EnableServicePayload struct { BackupPolicyId *string `json:"backupPolicyId,omitempty"` } + +// NewEnableServicePayload instantiates a new EnableServicePayload 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 NewEnableServicePayload() *EnableServicePayload { + this := EnableServicePayload{} + return &this +} + +// NewEnableServicePayloadWithDefaults instantiates a new EnableServicePayload 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 NewEnableServicePayloadWithDefaults() *EnableServicePayload { + this := EnableServicePayload{} + return &this +} + +// GetBackupPolicyId returns the BackupPolicyId field value if set, zero value otherwise. +func (o *EnableServicePayload) GetBackupPolicyId() *string { + if o == nil || IsNil(o.BackupPolicyId) { + var ret *string + return ret + } + return o.BackupPolicyId +} + +// GetBackupPolicyIdOk returns a tuple with the BackupPolicyId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *EnableServicePayload) GetBackupPolicyIdOk() (*string, bool) { + if o == nil || IsNil(o.BackupPolicyId) { + return nil, false + } + return o.BackupPolicyId, true +} + +// HasBackupPolicyId returns a boolean if a field has been set. +func (o *EnableServicePayload) HasBackupPolicyId() bool { + if o != nil && !IsNil(o.BackupPolicyId) { + return true + } + + return false +} + +// SetBackupPolicyId gets a reference to the given string and assigns it to the BackupPolicyId field. +func (o *EnableServicePayload) SetBackupPolicyId(v *string) { + o.BackupPolicyId = v +} + +func (o EnableServicePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupPolicyId) { + toSerialize["backupPolicyId"] = o.BackupPolicyId + } + return toSerialize, nil +} + +type NullableEnableServicePayload struct { + value *EnableServicePayload + isSet bool +} + +func (v NullableEnableServicePayload) Get() *EnableServicePayload { + return v.value +} + +func (v *NullableEnableServicePayload) Set(val *EnableServicePayload) { + v.value = val + v.isSet = true +} + +func (v NullableEnableServicePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableEnableServicePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnableServicePayload(val *EnableServicePayload) *NullableEnableServicePayload { + return &NullableEnableServicePayload{value: val, isSet: true} +} + +func (v NullableEnableServicePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnableServicePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_error_response.go b/services/serverbackup/model_error_response.go index 4caf7b8d5..46308fe38 100644 --- a/services/serverbackup/model_error_response.go +++ b/services/serverbackup/model_error_response.go @@ -10,6 +10,13 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the ErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ErrorResponse{} + // ErrorResponse struct for ErrorResponse type ErrorResponse struct { // Details about the error @@ -22,3 +29,141 @@ type ErrorResponse struct { // REQUIRED Timestamp *string `json:"timestamp"` } + +type _ErrorResponse ErrorResponse + +// NewErrorResponse instantiates a new ErrorResponse 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 NewErrorResponse(message *string, status *string, timestamp *string) *ErrorResponse { + this := ErrorResponse{} + this.Message = message + this.Status = status + this.Timestamp = timestamp + return &this +} + +// NewErrorResponseWithDefaults instantiates a new ErrorResponse 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 NewErrorResponseWithDefaults() *ErrorResponse { + this := ErrorResponse{} + return &this +} + +// GetMessage returns the Message field value +func (o *ErrorResponse) GetMessage() *string { + if o == nil { + var ret *string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Message, true +} + +// SetMessage sets field value +func (o *ErrorResponse) SetMessage(v *string) { + o.Message = v +} + +// GetStatus returns the Status field value +func (o *ErrorResponse) GetStatus() *string { + if o == nil { + var ret *string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Status, true +} + +// SetStatus sets field value +func (o *ErrorResponse) SetStatus(v *string) { + o.Status = v +} + +// GetTimestamp returns the Timestamp field value +func (o *ErrorResponse) GetTimestamp() *string { + if o == nil { + var ret *string + return ret + } + + return o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value +// and a boolean to check if the value has been set. +func (o *ErrorResponse) GetTimestampOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Timestamp, true +} + +// SetTimestamp sets field value +func (o *ErrorResponse) SetTimestamp(v *string) { + o.Timestamp = v +} + +func (o ErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["status"] = o.Status + toSerialize["timestamp"] = o.Timestamp + return toSerialize, nil +} + +type NullableErrorResponse struct { + value *ErrorResponse + isSet bool +} + +func (v NullableErrorResponse) Get() *ErrorResponse { + return v.value +} + +func (v *NullableErrorResponse) Set(val *ErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { + return &NullableErrorResponse{value: val, isSet: true} +} + +func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_list_backup_schedules_200_response.go b/services/serverbackup/model_list_backup_schedules_200_response.go index e85f12ffc..c0a9e07fc 100644 --- a/services/serverbackup/model_list_backup_schedules_200_response.go +++ b/services/serverbackup/model_list_backup_schedules_200_response.go @@ -10,7 +10,107 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the ListBackupSchedules200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackupSchedules200Response{} + // ListBackupSchedules200Response struct for ListBackupSchedules200Response type ListBackupSchedules200Response struct { Items *[]BackupSchedule `json:"items,omitempty"` } + +// NewListBackupSchedules200Response instantiates a new ListBackupSchedules200Response 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 NewListBackupSchedules200Response() *ListBackupSchedules200Response { + this := ListBackupSchedules200Response{} + return &this +} + +// NewListBackupSchedules200ResponseWithDefaults instantiates a new ListBackupSchedules200Response 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 NewListBackupSchedules200ResponseWithDefaults() *ListBackupSchedules200Response { + this := ListBackupSchedules200Response{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListBackupSchedules200Response) GetItems() *[]BackupSchedule { + if o == nil || IsNil(o.Items) { + var ret *[]BackupSchedule + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListBackupSchedules200Response) GetItemsOk() (*[]BackupSchedule, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListBackupSchedules200Response) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []BackupSchedule and assigns it to the Items field. +func (o *ListBackupSchedules200Response) SetItems(v *[]BackupSchedule) { + o.Items = v +} + +func (o ListBackupSchedules200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableListBackupSchedules200Response struct { + value *ListBackupSchedules200Response + isSet bool +} + +func (v NullableListBackupSchedules200Response) Get() *ListBackupSchedules200Response { + return v.value +} + +func (v *NullableListBackupSchedules200Response) Set(val *ListBackupSchedules200Response) { + v.value = val + v.isSet = true +} + +func (v NullableListBackupSchedules200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackupSchedules200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackupSchedules200Response(val *ListBackupSchedules200Response) *NullableListBackupSchedules200Response { + return &NullableListBackupSchedules200Response{value: val, isSet: true} +} + +func (v NullableListBackupSchedules200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackupSchedules200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_list_backups_200_response.go b/services/serverbackup/model_list_backups_200_response.go index 300192d9a..5b9feb7b8 100644 --- a/services/serverbackup/model_list_backups_200_response.go +++ b/services/serverbackup/model_list_backups_200_response.go @@ -10,7 +10,107 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the ListBackups200Response type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListBackups200Response{} + // ListBackups200Response struct for ListBackups200Response type ListBackups200Response struct { Items *[]Backup `json:"items,omitempty"` } + +// NewListBackups200Response instantiates a new ListBackups200Response 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 NewListBackups200Response() *ListBackups200Response { + this := ListBackups200Response{} + return &this +} + +// NewListBackups200ResponseWithDefaults instantiates a new ListBackups200Response 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 NewListBackups200ResponseWithDefaults() *ListBackups200Response { + this := ListBackups200Response{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *ListBackups200Response) GetItems() *[]Backup { + if o == nil || IsNil(o.Items) { + var ret *[]Backup + return ret + } + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListBackups200Response) GetItemsOk() (*[]Backup, bool) { + if o == nil || IsNil(o.Items) { + return nil, false + } + return o.Items, true +} + +// HasItems returns a boolean if a field has been set. +func (o *ListBackups200Response) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []Backup and assigns it to the Items field. +func (o *ListBackups200Response) SetItems(v *[]Backup) { + o.Items = v +} + +func (o ListBackups200Response) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableListBackups200Response struct { + value *ListBackups200Response + isSet bool +} + +func (v NullableListBackups200Response) Get() *ListBackups200Response { + return v.value +} + +func (v *NullableListBackups200Response) Set(val *ListBackups200Response) { + v.value = val + v.isSet = true +} + +func (v NullableListBackups200Response) IsSet() bool { + return v.isSet +} + +func (v *NullableListBackups200Response) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListBackups200Response(val *ListBackups200Response) *NullableListBackups200Response { + return &NullableListBackups200Response{value: val, isSet: true} +} + +func (v NullableListBackups200Response) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListBackups200Response) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_restore_backup_payload.go b/services/serverbackup/model_restore_backup_payload.go index e9b7a919f..9a1acda49 100644 --- a/services/serverbackup/model_restore_backup_payload.go +++ b/services/serverbackup/model_restore_backup_payload.go @@ -10,9 +10,137 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the RestoreBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreBackupPayload{} + // RestoreBackupPayload struct for RestoreBackupPayload type RestoreBackupPayload struct { // REQUIRED StartServerAfterRestore *bool `json:"startServerAfterRestore"` VolumeIds *[]string `json:"volumeIds,omitempty"` } + +type _RestoreBackupPayload RestoreBackupPayload + +// NewRestoreBackupPayload instantiates a new RestoreBackupPayload 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 NewRestoreBackupPayload(startServerAfterRestore *bool) *RestoreBackupPayload { + this := RestoreBackupPayload{} + this.StartServerAfterRestore = startServerAfterRestore + return &this +} + +// NewRestoreBackupPayloadWithDefaults instantiates a new RestoreBackupPayload 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 NewRestoreBackupPayloadWithDefaults() *RestoreBackupPayload { + this := RestoreBackupPayload{} + return &this +} + +// GetStartServerAfterRestore returns the StartServerAfterRestore field value +func (o *RestoreBackupPayload) GetStartServerAfterRestore() *bool { + if o == nil { + var ret *bool + return ret + } + + return o.StartServerAfterRestore +} + +// GetStartServerAfterRestoreOk returns a tuple with the StartServerAfterRestore field value +// and a boolean to check if the value has been set. +func (o *RestoreBackupPayload) GetStartServerAfterRestoreOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.StartServerAfterRestore, true +} + +// SetStartServerAfterRestore sets field value +func (o *RestoreBackupPayload) SetStartServerAfterRestore(v *bool) { + o.StartServerAfterRestore = v +} + +// GetVolumeIds returns the VolumeIds field value if set, zero value otherwise. +func (o *RestoreBackupPayload) GetVolumeIds() *[]string { + if o == nil || IsNil(o.VolumeIds) { + var ret *[]string + return ret + } + return o.VolumeIds +} + +// GetVolumeIdsOk returns a tuple with the VolumeIds field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *RestoreBackupPayload) GetVolumeIdsOk() (*[]string, bool) { + if o == nil || IsNil(o.VolumeIds) { + return nil, false + } + return o.VolumeIds, true +} + +// HasVolumeIds returns a boolean if a field has been set. +func (o *RestoreBackupPayload) HasVolumeIds() bool { + if o != nil && !IsNil(o.VolumeIds) { + return true + } + + return false +} + +// SetVolumeIds gets a reference to the given []string and assigns it to the VolumeIds field. +func (o *RestoreBackupPayload) SetVolumeIds(v *[]string) { + o.VolumeIds = v +} + +func (o RestoreBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["startServerAfterRestore"] = o.StartServerAfterRestore + if !IsNil(o.VolumeIds) { + toSerialize["volumeIds"] = o.VolumeIds + } + return toSerialize, nil +} + +type NullableRestoreBackupPayload struct { + value *RestoreBackupPayload + isSet bool +} + +func (v NullableRestoreBackupPayload) Get() *RestoreBackupPayload { + return v.value +} + +func (v *NullableRestoreBackupPayload) Set(val *RestoreBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreBackupPayload(val *RestoreBackupPayload) *NullableRestoreBackupPayload { + return &NullableRestoreBackupPayload{value: val, isSet: true} +} + +func (v NullableRestoreBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_restore_volume_backup_payload.go b/services/serverbackup/model_restore_volume_backup_payload.go index e48e95bb0..7b1f47a62 100644 --- a/services/serverbackup/model_restore_volume_backup_payload.go +++ b/services/serverbackup/model_restore_volume_backup_payload.go @@ -10,8 +10,101 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the RestoreVolumeBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreVolumeBackupPayload{} + // RestoreVolumeBackupPayload struct for RestoreVolumeBackupPayload type RestoreVolumeBackupPayload struct { // REQUIRED RestoreVolumeId *string `json:"restoreVolumeId"` } + +type _RestoreVolumeBackupPayload RestoreVolumeBackupPayload + +// NewRestoreVolumeBackupPayload instantiates a new RestoreVolumeBackupPayload 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 NewRestoreVolumeBackupPayload(restoreVolumeId *string) *RestoreVolumeBackupPayload { + this := RestoreVolumeBackupPayload{} + this.RestoreVolumeId = restoreVolumeId + return &this +} + +// NewRestoreVolumeBackupPayloadWithDefaults instantiates a new RestoreVolumeBackupPayload 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 NewRestoreVolumeBackupPayloadWithDefaults() *RestoreVolumeBackupPayload { + this := RestoreVolumeBackupPayload{} + return &this +} + +// GetRestoreVolumeId returns the RestoreVolumeId field value +func (o *RestoreVolumeBackupPayload) GetRestoreVolumeId() *string { + if o == nil { + var ret *string + return ret + } + + return o.RestoreVolumeId +} + +// GetRestoreVolumeIdOk returns a tuple with the RestoreVolumeId field value +// and a boolean to check if the value has been set. +func (o *RestoreVolumeBackupPayload) GetRestoreVolumeIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.RestoreVolumeId, true +} + +// SetRestoreVolumeId sets field value +func (o *RestoreVolumeBackupPayload) SetRestoreVolumeId(v *string) { + o.RestoreVolumeId = v +} + +func (o RestoreVolumeBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["restoreVolumeId"] = o.RestoreVolumeId + return toSerialize, nil +} + +type NullableRestoreVolumeBackupPayload struct { + value *RestoreVolumeBackupPayload + isSet bool +} + +func (v NullableRestoreVolumeBackupPayload) Get() *RestoreVolumeBackupPayload { + return v.value +} + +func (v *NullableRestoreVolumeBackupPayload) Set(val *RestoreVolumeBackupPayload) { + v.value = val + v.isSet = true +} + +func (v NullableRestoreVolumeBackupPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableRestoreVolumeBackupPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRestoreVolumeBackupPayload(val *RestoreVolumeBackupPayload) *NullableRestoreVolumeBackupPayload { + return &NullableRestoreVolumeBackupPayload{value: val, isSet: true} +} + +func (v NullableRestoreVolumeBackupPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRestoreVolumeBackupPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/model_update_backup_schedule_payload.go b/services/serverbackup/model_update_backup_schedule_payload.go index 623c9470f..751d20334 100644 --- a/services/serverbackup/model_update_backup_schedule_payload.go +++ b/services/serverbackup/model_update_backup_schedule_payload.go @@ -10,6 +10,13 @@ API version: 1.0 package serverbackup +import ( + "encoding/json" +) + +// checks if the UpdateBackupSchedulePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UpdateBackupSchedulePayload{} + // UpdateBackupSchedulePayload struct for UpdateBackupSchedulePayload type UpdateBackupSchedulePayload struct { BackupProperties *BackupProperties `json:"backupProperties,omitempty"` @@ -21,3 +28,176 @@ type UpdateBackupSchedulePayload struct { // REQUIRED Rrule *string `json:"rrule"` } + +type _UpdateBackupSchedulePayload UpdateBackupSchedulePayload + +// NewUpdateBackupSchedulePayload instantiates a new UpdateBackupSchedulePayload 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 NewUpdateBackupSchedulePayload(enabled *bool, name *string, rrule *string) *UpdateBackupSchedulePayload { + this := UpdateBackupSchedulePayload{} + this.Enabled = enabled + this.Name = name + this.Rrule = rrule + return &this +} + +// NewUpdateBackupSchedulePayloadWithDefaults instantiates a new UpdateBackupSchedulePayload 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 NewUpdateBackupSchedulePayloadWithDefaults() *UpdateBackupSchedulePayload { + this := UpdateBackupSchedulePayload{} + return &this +} + +// GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +func (o *UpdateBackupSchedulePayload) GetBackupProperties() *BackupProperties { + if o == nil || IsNil(o.BackupProperties) { + var ret *BackupProperties + return ret + } + return o.BackupProperties +} + +// GetBackupPropertiesOk returns a tuple with the BackupProperties field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateBackupSchedulePayload) GetBackupPropertiesOk() (*BackupProperties, bool) { + if o == nil || IsNil(o.BackupProperties) { + return nil, false + } + return o.BackupProperties, true +} + +// HasBackupProperties returns a boolean if a field has been set. +func (o *UpdateBackupSchedulePayload) HasBackupProperties() bool { + if o != nil && !IsNil(o.BackupProperties) { + return true + } + + return false +} + +// SetBackupProperties gets a reference to the given BackupProperties and assigns it to the BackupProperties field. +func (o *UpdateBackupSchedulePayload) SetBackupProperties(v *BackupProperties) { + o.BackupProperties = v +} + +// GetEnabled returns the Enabled field value +func (o *UpdateBackupSchedulePayload) GetEnabled() *bool { + if o == nil { + var ret *bool + return ret + } + + return o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupSchedulePayload) GetEnabledOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.Enabled, true +} + +// SetEnabled sets field value +func (o *UpdateBackupSchedulePayload) SetEnabled(v *bool) { + o.Enabled = v +} + +// GetName returns the Name field value +func (o *UpdateBackupSchedulePayload) GetName() *string { + if o == nil { + var ret *string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupSchedulePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Name, true +} + +// SetName sets field value +func (o *UpdateBackupSchedulePayload) SetName(v *string) { + o.Name = v +} + +// GetRrule returns the Rrule field value +func (o *UpdateBackupSchedulePayload) GetRrule() *string { + if o == nil { + var ret *string + return ret + } + + return o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value +// and a boolean to check if the value has been set. +func (o *UpdateBackupSchedulePayload) GetRruleOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.Rrule, true +} + +// SetRrule sets field value +func (o *UpdateBackupSchedulePayload) SetRrule(v *string) { + o.Rrule = v +} + +func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupProperties) { + toSerialize["backupProperties"] = o.BackupProperties + } + toSerialize["enabled"] = o.Enabled + toSerialize["name"] = o.Name + toSerialize["rrule"] = o.Rrule + return toSerialize, nil +} + +type NullableUpdateBackupSchedulePayload struct { + value *UpdateBackupSchedulePayload + isSet bool +} + +func (v NullableUpdateBackupSchedulePayload) Get() *UpdateBackupSchedulePayload { + return v.value +} + +func (v *NullableUpdateBackupSchedulePayload) Set(val *UpdateBackupSchedulePayload) { + v.value = val + v.isSet = true +} + +func (v NullableUpdateBackupSchedulePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableUpdateBackupSchedulePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUpdateBackupSchedulePayload(val *UpdateBackupSchedulePayload) *NullableUpdateBackupSchedulePayload { + return &NullableUpdateBackupSchedulePayload{value: val, isSet: true} +} + +func (v NullableUpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUpdateBackupSchedulePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +}