From 22bd4b19cd0d08319aba6f41809f04cac4f9fd03 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Thu, 5 Mar 2026 10:53:48 +0000 Subject: [PATCH] Generate serverbackup --- services/serverbackup/api_default.go | 165 +- services/serverbackup/client.go | 7 + services/serverbackup/configuration.go | 2 + services/serverbackup/go.mod | 2 +- services/serverbackup/go.sum | 4 +- services/serverbackup/model_backup.go | 128 +- services/serverbackup/model_backup_job.go | 23 + services/serverbackup/model_backup_policy.go | 86 + .../model_backup_policy_backup_properties.go | 34 + .../serverbackup/model_backup_properties.go | 44 + .../serverbackup/model_backup_schedule.go | 63 + .../model_backup_volume_backups_inner.go | 114 +- .../model_create_backup_payload.go | 44 + .../model_create_backup_schedule_payload.go | 53 + .../model_enable_service_resource_payload.go | 23 + services/serverbackup/model_error_response.go | 32 + .../model_get_backup_policies_response.go | 24 + .../model_get_backup_schedules_response.go | 24 + .../model_get_backup_service_response.go | 24 + .../model_get_backups_list_response.go | 24 + .../model_restore_backup_payload.go | 35 + .../model_restore_volume_backup_payload.go | 23 + .../model_update_backup_schedule_payload.go | 53 + services/serverbackup/oas_commit | 2 +- services/serverbackup/utils.go | 81 + services/serverbackup/v1api/api_default.go | 2394 ++++++++++++++++ .../serverbackup/v1api/api_default_mock.go | 404 +++ services/serverbackup/v1api/client.go | 659 +++++ services/serverbackup/v1api/configuration.go | 41 + services/serverbackup/v1api/model_backup.go | 377 +++ .../serverbackup/v1api/model_backup_job.go | 157 ++ .../serverbackup/v1api/model_backup_policy.go | 342 +++ .../model_backup_policy_backup_properties.go | 161 ++ .../v1api/model_backup_properties.go | 223 ++ .../v1api/model_backup_schedule.go | 278 ++ .../model_backup_volume_backups_inner.go | 305 +++ .../v1api/model_create_backup_payload.go | 223 ++ .../model_create_backup_schedule_payload.go | 251 ++ .../v1api/model_enable_service_payload.go | 125 + .../model_enable_service_resource_payload.go | 125 + .../model_get_backup_policies_response.go | 125 + .../model_get_backup_schedules_response.go | 125 + .../model_get_backup_service_response.go | 125 + .../v1api/model_get_backups_list_response.go | 125 + .../v1api/model_restore_backup_payload.go | 193 ++ .../model_restore_volume_backup_payload.go | 157 ++ .../model_update_backup_schedule_payload.go | 251 ++ services/serverbackup/v1api/response.go | 48 + services/serverbackup/v1api/utils.go | 362 +++ services/serverbackup/v2api/api_default.go | 2407 +++++++++++++++++ .../serverbackup/v2api/api_default_mock.go | 377 +++ services/serverbackup/v2api/client.go | 659 +++++ services/serverbackup/v2api/configuration.go | 38 + services/serverbackup/v2api/model_backup.go | 377 +++ .../serverbackup/v2api/model_backup_job.go | 157 ++ .../serverbackup/v2api/model_backup_policy.go | 342 +++ .../model_backup_policy_backup_properties.go | 161 ++ .../v2api/model_backup_properties.go | 223 ++ .../v2api/model_backup_schedule.go | 278 ++ .../model_backup_volume_backups_inner.go | 305 +++ .../v2api/model_create_backup_payload.go | 223 ++ .../model_create_backup_schedule_payload.go | 251 ++ .../model_enable_service_resource_payload.go | 125 + .../v2api/model_error_response.go | 187 ++ .../model_get_backup_policies_response.go | 125 + .../model_get_backup_schedules_response.go | 125 + .../model_get_backup_service_response.go | 125 + .../v2api/model_get_backups_list_response.go | 125 + .../v2api/model_restore_backup_payload.go | 193 ++ .../model_restore_volume_backup_payload.go | 157 ++ .../model_update_backup_schedule_payload.go | 251 ++ services/serverbackup/v2api/response.go | 48 + services/serverbackup/v2api/utils.go | 362 +++ 73 files changed, 16290 insertions(+), 21 deletions(-) create mode 100644 services/serverbackup/v1api/api_default.go create mode 100644 services/serverbackup/v1api/api_default_mock.go create mode 100644 services/serverbackup/v1api/client.go create mode 100644 services/serverbackup/v1api/configuration.go create mode 100644 services/serverbackup/v1api/model_backup.go create mode 100644 services/serverbackup/v1api/model_backup_job.go create mode 100644 services/serverbackup/v1api/model_backup_policy.go create mode 100644 services/serverbackup/v1api/model_backup_policy_backup_properties.go create mode 100644 services/serverbackup/v1api/model_backup_properties.go create mode 100644 services/serverbackup/v1api/model_backup_schedule.go create mode 100644 services/serverbackup/v1api/model_backup_volume_backups_inner.go create mode 100644 services/serverbackup/v1api/model_create_backup_payload.go create mode 100644 services/serverbackup/v1api/model_create_backup_schedule_payload.go create mode 100644 services/serverbackup/v1api/model_enable_service_payload.go create mode 100644 services/serverbackup/v1api/model_enable_service_resource_payload.go create mode 100644 services/serverbackup/v1api/model_get_backup_policies_response.go create mode 100644 services/serverbackup/v1api/model_get_backup_schedules_response.go create mode 100644 services/serverbackup/v1api/model_get_backup_service_response.go create mode 100644 services/serverbackup/v1api/model_get_backups_list_response.go create mode 100644 services/serverbackup/v1api/model_restore_backup_payload.go create mode 100644 services/serverbackup/v1api/model_restore_volume_backup_payload.go create mode 100644 services/serverbackup/v1api/model_update_backup_schedule_payload.go create mode 100644 services/serverbackup/v1api/response.go create mode 100644 services/serverbackup/v1api/utils.go create mode 100644 services/serverbackup/v2api/api_default.go create mode 100644 services/serverbackup/v2api/api_default_mock.go create mode 100644 services/serverbackup/v2api/client.go create mode 100644 services/serverbackup/v2api/configuration.go create mode 100644 services/serverbackup/v2api/model_backup.go create mode 100644 services/serverbackup/v2api/model_backup_job.go create mode 100644 services/serverbackup/v2api/model_backup_policy.go create mode 100644 services/serverbackup/v2api/model_backup_policy_backup_properties.go create mode 100644 services/serverbackup/v2api/model_backup_properties.go create mode 100644 services/serverbackup/v2api/model_backup_schedule.go create mode 100644 services/serverbackup/v2api/model_backup_volume_backups_inner.go create mode 100644 services/serverbackup/v2api/model_create_backup_payload.go create mode 100644 services/serverbackup/v2api/model_create_backup_schedule_payload.go create mode 100644 services/serverbackup/v2api/model_enable_service_resource_payload.go create mode 100644 services/serverbackup/v2api/model_error_response.go create mode 100644 services/serverbackup/v2api/model_get_backup_policies_response.go create mode 100644 services/serverbackup/v2api/model_get_backup_schedules_response.go create mode 100644 services/serverbackup/v2api/model_get_backup_service_response.go create mode 100644 services/serverbackup/v2api/model_get_backups_list_response.go create mode 100644 services/serverbackup/v2api/model_restore_backup_payload.go create mode 100644 services/serverbackup/v2api/model_restore_volume_backup_payload.go create mode 100644 services/serverbackup/v2api/model_update_backup_schedule_payload.go create mode 100644 services/serverbackup/v2api/response.go create mode 100644 services/serverbackup/v2api/utils.go diff --git a/services/serverbackup/api_default.go b/services/serverbackup/api_default.go index 1d2a4d327..24e0f7831 100644 --- a/services/serverbackup/api_default.go +++ b/services/serverbackup/api_default.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -23,6 +24,7 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApi interface { /* CreateBackup create backup @@ -32,6 +34,8 @@ type DefaultApi interface { @param serverId server id @param region region @return ApiCreateBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateBackup(ctx context.Context, projectId string, serverId string, region string) ApiCreateBackupRequest /* @@ -43,6 +47,7 @@ type DefaultApi interface { @param region region @return BackupJob + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateBackupExecute(ctx context.Context, projectId string, serverId string, region string) (*BackupJob, error) /* @@ -53,6 +58,8 @@ type DefaultApi interface { @param serverId server id @param region region @return ApiCreateBackupScheduleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateBackupSchedule(ctx context.Context, projectId string, serverId string, region string) ApiCreateBackupScheduleRequest /* @@ -64,6 +71,7 @@ type DefaultApi interface { @param region region @return BackupSchedule + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateBackupScheduleExecute(ctx context.Context, projectId string, serverId string, region string) (*BackupSchedule, error) /* @@ -75,11 +83,14 @@ type DefaultApi interface { @param region region @param backupId id of the backup @return ApiDeleteBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiDeleteBackupRequest /* DeleteBackupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string) error /* @@ -91,11 +102,14 @@ type DefaultApi interface { @param region region @param backupScheduleId backup schedule id @return ApiDeleteBackupScheduleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiDeleteBackupScheduleRequest /* DeleteBackupScheduleExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteBackupScheduleExecute(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) error /* @@ -108,11 +122,14 @@ type DefaultApi interface { @param backupId id of the backup @param volumeBackupId id of the volume backup @return ApiDeleteVolumeBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteVolumeBackup(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) ApiDeleteVolumeBackupRequest /* DeleteVolumeBackupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteVolumeBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) error /* @@ -123,11 +140,14 @@ type DefaultApi interface { @param serverId server id @param region region @return ApiDisableServiceResourceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DisableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiDisableServiceResourceRequest /* DisableServiceResourceExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DisableServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) error /* @@ -138,11 +158,14 @@ type DefaultApi interface { @param serverId server id @param region region @return ApiEnableServiceResourceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ EnableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiEnableServiceResourceRequest /* EnableServiceResourceExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ EnableServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) error /* @@ -154,6 +177,8 @@ type DefaultApi interface { @param region region @param backupId id of the backup @return ApiGetBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiGetBackupRequest /* @@ -166,6 +191,7 @@ type DefaultApi interface { @param backupId id of the backup @return Backup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string) (*Backup, error) /* @@ -177,6 +203,8 @@ type DefaultApi interface { @param region region @param backupScheduleId backup schedule id @return ApiGetBackupScheduleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiGetBackupScheduleRequest /* @@ -189,6 +217,7 @@ type DefaultApi interface { @param backupScheduleId backup schedule id @return BackupSchedule + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetBackupScheduleExecute(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) (*BackupSchedule, error) /* @@ -199,6 +228,8 @@ type DefaultApi interface { @param serverId server id @param region region @return ApiGetServiceResourceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiGetServiceResourceRequest /* @@ -210,6 +241,7 @@ type DefaultApi interface { @param region region @return GetBackupServiceResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) (*GetBackupServiceResponse, error) /* @@ -218,6 +250,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @return ApiListBackupPoliciesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListBackupPolicies(ctx context.Context, projectId string) ApiListBackupPoliciesRequest /* @@ -227,6 +261,7 @@ type DefaultApi interface { @param projectId project id @return GetBackupPoliciesResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListBackupPoliciesExecute(ctx context.Context, projectId string) (*GetBackupPoliciesResponse, error) /* @@ -237,6 +272,8 @@ type DefaultApi interface { @param serverId server id @param region region @return ApiListBackupSchedulesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListBackupSchedules(ctx context.Context, projectId string, serverId string, region string) ApiListBackupSchedulesRequest /* @@ -248,6 +285,7 @@ type DefaultApi interface { @param region region @return GetBackupSchedulesResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListBackupSchedulesExecute(ctx context.Context, projectId string, serverId string, region string) (*GetBackupSchedulesResponse, error) /* @@ -258,6 +296,8 @@ type DefaultApi interface { @param serverId server id @param region region @return ApiListBackupsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListBackups(ctx context.Context, projectId string, serverId string, region string) ApiListBackupsRequest /* @@ -269,6 +309,7 @@ type DefaultApi interface { @param region region @return GetBackupsListResponse + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListBackupsExecute(ctx context.Context, projectId string, serverId string, region string) (*GetBackupsListResponse, error) /* @@ -280,11 +321,14 @@ type DefaultApi interface { @param region region @param backupId id of the backup @return ApiRestoreBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RestoreBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiRestoreBackupRequest /* RestoreBackupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RestoreBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string) error /* @@ -297,11 +341,14 @@ type DefaultApi interface { @param backupId id of the backup @param volumeBackupId id of the volume backup @return ApiRestoreVolumeBackupRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RestoreVolumeBackup(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) ApiRestoreVolumeBackupRequest /* RestoreVolumeBackupExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ RestoreVolumeBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) error /* @@ -313,6 +360,8 @@ type DefaultApi interface { @param region region @param backupScheduleId backup schedule id @return ApiUpdateBackupScheduleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiUpdateBackupScheduleRequest /* @@ -325,87 +374,130 @@ type DefaultApi interface { @param backupScheduleId backup schedule id @return BackupSchedule + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ UpdateBackupScheduleExecute(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) (*BackupSchedule, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateBackupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*BackupJob, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateBackupScheduleRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateBackupSchedulePayload(createBackupSchedulePayload CreateBackupSchedulePayload) ApiCreateBackupScheduleRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*BackupSchedule, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteBackupRequest interface { // force delete the backup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Force(force bool) ApiDeleteBackupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteBackupScheduleRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteVolumeBackupRequest interface { // Force delete the volume backup + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Force(force bool) ApiDeleteVolumeBackupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDisableServiceResourceRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiEnableServiceResourceRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead EnableServiceResourcePayload(enableServiceResourcePayload EnableServiceResourcePayload) ApiEnableServiceResourceRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetBackupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Backup, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetBackupScheduleRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*BackupSchedule, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetServiceResourceRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetBackupServiceResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListBackupPoliciesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetBackupPoliciesResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListBackupSchedulesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetBackupSchedulesResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListBackupsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*GetBackupsListResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRestoreBackupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead RestoreBackupPayload(restoreBackupPayload RestoreBackupPayload) ApiRestoreBackupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiRestoreVolumeBackupRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead RestoreVolumeBackupPayload(restoreVolumeBackupPayload RestoreVolumeBackupPayload) ApiRestoreVolumeBackupRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateBackupScheduleRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*BackupSchedule, error) } // DefaultApiService DefaultApi service +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApiService service +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -415,11 +507,13 @@ type CreateBackupRequest struct { createBackupPayload *CreateBackupPayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { r.createBackupPayload = &createBackupPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateBackupRequest) Execute() (*BackupJob, error) { var ( localVarHTTPMethod = http.MethodPost @@ -526,6 +620,7 @@ func (r CreateBackupRequest) Execute() (*BackupJob, error) { /* CreateBackup: create backup +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -543,6 +638,7 @@ func (a *APIClient) CreateBackup(ctx context.Context, projectId string, serverId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, serverId string, region string) (*BackupJob, error) { r := CreateBackupRequest{ apiService: a.defaultApi, @@ -554,6 +650,7 @@ func (a *APIClient) CreateBackupExecute(ctx context.Context, projectId string, s return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupScheduleRequest struct { ctx context.Context apiService *DefaultApiService @@ -563,11 +660,13 @@ type CreateBackupScheduleRequest struct { createBackupSchedulePayload *CreateBackupSchedulePayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateBackupScheduleRequest) CreateBackupSchedulePayload(createBackupSchedulePayload CreateBackupSchedulePayload) ApiCreateBackupScheduleRequest { r.createBackupSchedulePayload = &createBackupSchedulePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r CreateBackupScheduleRequest) Execute() (*BackupSchedule, error) { var ( localVarHTTPMethod = http.MethodPost @@ -674,6 +773,7 @@ func (r CreateBackupScheduleRequest) Execute() (*BackupSchedule, error) { /* CreateBackupSchedule: create backup schedule +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -691,6 +791,7 @@ func (a *APIClient) CreateBackupSchedule(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) CreateBackupScheduleExecute(ctx context.Context, projectId string, serverId string, region string) (*BackupSchedule, error) { r := CreateBackupScheduleRequest{ apiService: a.defaultApi, @@ -702,6 +803,7 @@ func (a *APIClient) CreateBackupScheduleExecute(ctx context.Context, projectId s return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -713,12 +815,13 @@ type DeleteBackupRequest struct { } // force delete the backup - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { r.force = &force return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteBackupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -816,6 +919,7 @@ func (r DeleteBackupRequest) Execute() error { /* DeleteBackup: delete backup +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -835,6 +939,7 @@ func (a *APIClient) DeleteBackup(ctx context.Context, projectId string, serverId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string) error { r := DeleteBackupRequest{ apiService: a.defaultApi, @@ -847,6 +952,7 @@ func (a *APIClient) DeleteBackupExecute(ctx context.Context, projectId string, s return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteBackupScheduleRequest struct { ctx context.Context apiService *DefaultApiService @@ -856,6 +962,7 @@ type DeleteBackupScheduleRequest struct { backupScheduleId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteBackupScheduleRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -950,6 +1057,7 @@ func (r DeleteBackupScheduleRequest) Execute() error { /* DeleteBackupSchedule: delete backup schedule +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -969,6 +1077,7 @@ func (a *APIClient) DeleteBackupSchedule(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteBackupScheduleExecute(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) error { r := DeleteBackupScheduleRequest{ apiService: a.defaultApi, @@ -981,6 +1090,7 @@ func (a *APIClient) DeleteBackupScheduleExecute(ctx context.Context, projectId s return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DeleteVolumeBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -993,12 +1103,13 @@ type DeleteVolumeBackupRequest struct { } // Force delete the volume backup - +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteVolumeBackupRequest) Force(force bool) ApiDeleteVolumeBackupRequest { r.force = &force return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DeleteVolumeBackupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -1097,6 +1208,7 @@ func (r DeleteVolumeBackupRequest) Execute() error { /* DeleteVolumeBackup: delete volume backup +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -1118,6 +1230,7 @@ func (a *APIClient) DeleteVolumeBackup(ctx context.Context, projectId string, se } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DeleteVolumeBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) error { r := DeleteVolumeBackupRequest{ apiService: a.defaultApi, @@ -1131,6 +1244,7 @@ func (a *APIClient) DeleteVolumeBackupExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DisableServiceResourceRequest struct { ctx context.Context apiService *DefaultApiService @@ -1139,6 +1253,7 @@ type DisableServiceResourceRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r DisableServiceResourceRequest) Execute() error { var ( localVarHTTPMethod = http.MethodDelete @@ -1232,6 +1347,7 @@ func (r DisableServiceResourceRequest) Execute() error { /* DisableServiceResource: disable backup service +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -1249,6 +1365,7 @@ func (a *APIClient) DisableServiceResource(ctx context.Context, projectId string } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) DisableServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) error { r := DisableServiceResourceRequest{ apiService: a.defaultApi, @@ -1260,6 +1377,7 @@ func (a *APIClient) DisableServiceResourceExecute(ctx context.Context, projectId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type EnableServiceResourceRequest struct { ctx context.Context apiService *DefaultApiService @@ -1269,11 +1387,13 @@ type EnableServiceResourceRequest struct { enableServiceResourcePayload *EnableServiceResourcePayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r EnableServiceResourceRequest) EnableServiceResourcePayload(enableServiceResourcePayload EnableServiceResourcePayload) ApiEnableServiceResourceRequest { r.enableServiceResourcePayload = &enableServiceResourcePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r EnableServiceResourceRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -1369,6 +1489,7 @@ func (r EnableServiceResourceRequest) Execute() error { /* EnableServiceResource: enable backup service +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -1386,6 +1507,7 @@ func (a *APIClient) EnableServiceResource(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) EnableServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) error { r := EnableServiceResourceRequest{ apiService: a.defaultApi, @@ -1397,6 +1519,7 @@ func (a *APIClient) EnableServiceResourceExecute(ctx context.Context, projectId return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -1406,6 +1529,7 @@ type GetBackupRequest struct { backupId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetBackupRequest) Execute() (*Backup, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1511,6 +1635,7 @@ func (r GetBackupRequest) Execute() (*Backup, error) { /* GetBackup: get backup +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -1530,6 +1655,7 @@ func (a *APIClient) GetBackup(ctx context.Context, projectId string, serverId st } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string) (*Backup, error) { r := GetBackupRequest{ apiService: a.defaultApi, @@ -1542,6 +1668,7 @@ func (a *APIClient) GetBackupExecute(ctx context.Context, projectId string, serv return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupScheduleRequest struct { ctx context.Context apiService *DefaultApiService @@ -1551,6 +1678,7 @@ type GetBackupScheduleRequest struct { backupScheduleId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetBackupScheduleRequest) Execute() (*BackupSchedule, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1656,6 +1784,7 @@ func (r GetBackupScheduleRequest) Execute() (*BackupSchedule, error) { /* GetBackupSchedule: get single backup schedule details +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -1675,6 +1804,7 @@ func (a *APIClient) GetBackupSchedule(ctx context.Context, projectId string, ser } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetBackupScheduleExecute(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) (*BackupSchedule, error) { r := GetBackupScheduleRequest{ apiService: a.defaultApi, @@ -1687,6 +1817,7 @@ func (a *APIClient) GetBackupScheduleExecute(ctx context.Context, projectId stri return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetServiceResourceRequest struct { ctx context.Context apiService *DefaultApiService @@ -1695,6 +1826,7 @@ type GetServiceResourceRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r GetServiceResourceRequest) Execute() (*GetBackupServiceResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1799,6 +1931,7 @@ func (r GetServiceResourceRequest) Execute() (*GetBackupServiceResponse, error) /* GetServiceResource: get backup service details +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -1816,6 +1949,7 @@ func (a *APIClient) GetServiceResource(ctx context.Context, projectId string, se } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) GetServiceResourceExecute(ctx context.Context, projectId string, serverId string, region string) (*GetBackupServiceResponse, error) { r := GetServiceResourceRequest{ apiService: a.defaultApi, @@ -1827,12 +1961,14 @@ func (a *APIClient) GetServiceResourceExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupPoliciesRequest struct { ctx context.Context apiService *DefaultApiService projectId string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListBackupPoliciesRequest) Execute() (*GetBackupPoliciesResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -1935,6 +2071,7 @@ func (r ListBackupPoliciesRequest) Execute() (*GetBackupPoliciesResponse, error) /* ListBackupPolicies: get list of backup policies +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -1948,6 +2085,7 @@ func (a *APIClient) ListBackupPolicies(ctx context.Context, projectId string) Ap } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListBackupPoliciesExecute(ctx context.Context, projectId string) (*GetBackupPoliciesResponse, error) { r := ListBackupPoliciesRequest{ apiService: a.defaultApi, @@ -1957,6 +2095,7 @@ func (a *APIClient) ListBackupPoliciesExecute(ctx context.Context, projectId str return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupSchedulesRequest struct { ctx context.Context apiService *DefaultApiService @@ -1965,6 +2104,7 @@ type ListBackupSchedulesRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListBackupSchedulesRequest) Execute() (*GetBackupSchedulesResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2069,6 +2209,7 @@ func (r ListBackupSchedulesRequest) Execute() (*GetBackupSchedulesResponse, erro /* ListBackupSchedules: get list of backup schedules +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -2086,6 +2227,7 @@ func (a *APIClient) ListBackupSchedules(ctx context.Context, projectId string, s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListBackupSchedulesExecute(ctx context.Context, projectId string, serverId string, region string) (*GetBackupSchedulesResponse, error) { r := ListBackupSchedulesRequest{ apiService: a.defaultApi, @@ -2097,6 +2239,7 @@ func (a *APIClient) ListBackupSchedulesExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListBackupsRequest struct { ctx context.Context apiService *DefaultApiService @@ -2105,6 +2248,7 @@ type ListBackupsRequest struct { region string } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r ListBackupsRequest) Execute() (*GetBackupsListResponse, error) { var ( localVarHTTPMethod = http.MethodGet @@ -2209,6 +2353,7 @@ func (r ListBackupsRequest) Execute() (*GetBackupsListResponse, error) { /* ListBackups: get list of backups +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -2226,6 +2371,7 @@ func (a *APIClient) ListBackups(ctx context.Context, projectId string, serverId } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, serverId string, region string) (*GetBackupsListResponse, error) { r := ListBackupsRequest{ apiService: a.defaultApi, @@ -2237,6 +2383,7 @@ func (a *APIClient) ListBackupsExecute(ctx context.Context, projectId string, se return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -2247,11 +2394,13 @@ type RestoreBackupRequest struct { restoreBackupPayload *RestoreBackupPayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RestoreBackupRequest) RestoreBackupPayload(restoreBackupPayload RestoreBackupPayload) ApiRestoreBackupRequest { r.restoreBackupPayload = &restoreBackupPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RestoreBackupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -2348,6 +2497,7 @@ func (r RestoreBackupRequest) Execute() error { /* RestoreBackup: trigger restore of the requested backup +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -2367,6 +2517,7 @@ func (a *APIClient) RestoreBackup(ctx context.Context, projectId string, serverI } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RestoreBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string) error { r := RestoreBackupRequest{ apiService: a.defaultApi, @@ -2379,6 +2530,7 @@ func (a *APIClient) RestoreBackupExecute(ctx context.Context, projectId string, return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreVolumeBackupRequest struct { ctx context.Context apiService *DefaultApiService @@ -2390,11 +2542,13 @@ type RestoreVolumeBackupRequest struct { restoreVolumeBackupPayload *RestoreVolumeBackupPayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RestoreVolumeBackupRequest) RestoreVolumeBackupPayload(restoreVolumeBackupPayload RestoreVolumeBackupPayload) ApiRestoreVolumeBackupRequest { r.restoreVolumeBackupPayload = &restoreVolumeBackupPayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r RestoreVolumeBackupRequest) Execute() error { var ( localVarHTTPMethod = http.MethodPost @@ -2492,6 +2646,7 @@ func (r RestoreVolumeBackupRequest) Execute() error { /* RestoreVolumeBackup: trigger restore of the requested volume backup +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -2513,6 +2668,7 @@ func (a *APIClient) RestoreVolumeBackup(ctx context.Context, projectId string, s } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) RestoreVolumeBackupExecute(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) error { r := RestoreVolumeBackupRequest{ apiService: a.defaultApi, @@ -2526,6 +2682,7 @@ func (a *APIClient) RestoreVolumeBackupExecute(ctx context.Context, projectId st return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupScheduleRequest struct { ctx context.Context apiService *DefaultApiService @@ -2536,11 +2693,13 @@ type UpdateBackupScheduleRequest struct { updateBackupSchedulePayload *UpdateBackupSchedulePayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateBackupScheduleRequest) UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest { r.updateBackupSchedulePayload = &updateBackupSchedulePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r UpdateBackupScheduleRequest) Execute() (*BackupSchedule, error) { var ( localVarHTTPMethod = http.MethodPut @@ -2648,6 +2807,7 @@ func (r UpdateBackupScheduleRequest) Execute() (*BackupSchedule, error) { /* UpdateBackupSchedule: update backup schedule +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId project id @@ -2667,6 +2827,7 @@ func (a *APIClient) UpdateBackupSchedule(ctx context.Context, projectId string, } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) UpdateBackupScheduleExecute(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) (*BackupSchedule, error) { r := UpdateBackupScheduleRequest{ apiService: a.defaultApi, diff --git a/services/serverbackup/client.go b/services/serverbackup/client.go index f6a4fd914..db2afda93 100644 --- a/services/serverbackup/client.go +++ b/services/serverbackup/client.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -44,18 +45,21 @@ var ( // APIClient manages communication with the STACKIT Server Backup Management API API v2.0 // In most cases there should be only one, shared, APIClient. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type APIClient struct { cfg *config.Configuration common service // Reuse a single struct instead of allocating one for each service on the heap. defaultApi *DefaultApiService } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type service struct { client DefaultApi } // NewAPIClient creates a new API client. // Optionally receives configuration options +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { cfg := NewConfiguration() @@ -144,6 +148,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func ParameterValueToString(obj interface{}, key string) string { if reflect.TypeOf(obj).Kind() != reflect.Ptr { return fmt.Sprintf("%v", obj) @@ -282,6 +287,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (c *APIClient) GetConfig() *config.Configuration { return c.cfg } @@ -592,6 +598,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time diff --git a/services/serverbackup/configuration.go b/services/serverbackup/configuration.go index e1649c6ff..bc1d46fe7 100644 --- a/services/serverbackup/configuration.go +++ b/services/serverbackup/configuration.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -15,6 +16,7 @@ import ( ) // NewConfiguration returns a new Configuration object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfiguration() *config.Configuration { cfg := &config.Configuration{ DefaultHeader: make(map[string]string), diff --git a/services/serverbackup/go.mod b/services/serverbackup/go.mod index 77de264b9..a3c5e3848 100644 --- a/services/serverbackup/go.mod +++ b/services/serverbackup/go.mod @@ -2,7 +2,7 @@ module github.com/stackitcloud/stackit-sdk-go/services/serverbackup go 1.21 -require github.com/stackitcloud/stackit-sdk-go/core v0.21.1 +require github.com/stackitcloud/stackit-sdk-go/core v0.22.0 require ( github.com/golang-jwt/jwt/v5 v5.3.1 // indirect diff --git a/services/serverbackup/go.sum b/services/serverbackup/go.sum index ca103c909..195011dd5 100644 --- a/services/serverbackup/go.sum +++ b/services/serverbackup/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= diff --git a/services/serverbackup/model_backup.go b/services/serverbackup/model_backup.go index 5198f9857..ebea28bb9 100644 --- a/services/serverbackup/model_backup.go +++ b/services/serverbackup/model_backup.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &Backup{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetCreatedAtAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetCreatedAtAttributeTypeOk(arg BackupGetCreatedAtAttributeType) (ret BackupGetCreatedAtRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getBackupGetCreatedAtAttributeTypeOk(arg BackupGetCreatedAtAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetCreatedAtAttributeType(arg *BackupGetCreatedAtAttributeType, val BackupGetCreatedAtRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetCreatedAtArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetCreatedAtRetType = string /* @@ -44,8 +51,10 @@ type BackupGetCreatedAtRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetExpireAtAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetExpireAtAttributeTypeOk(arg BackupGetExpireAtAttributeType) (ret BackupGetExpireAtRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +62,15 @@ func getBackupGetExpireAtAttributeTypeOk(arg BackupGetExpireAtAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetExpireAtAttributeType(arg *BackupGetExpireAtAttributeType, val BackupGetExpireAtRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetExpireAtArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetExpireAtRetType = string /* @@ -65,8 +78,10 @@ type BackupGetExpireAtRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +89,15 @@ func getBackupGetIdAttributeTypeOk(arg BackupGetIdAttributeType) (ret BackupGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetIdAttributeType(arg *BackupGetIdAttributeType, val BackupGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetIdRetType = string /* @@ -86,8 +105,10 @@ type BackupGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLastRestoredAtAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetLastRestoredAtAttributeTypeOk(arg BackupGetLastRestoredAtAttributeType) (ret BackupGetLastRestoredAtRetType, ok bool) { if arg == nil { return ret, false @@ -95,11 +116,15 @@ func getBackupGetLastRestoredAtAttributeTypeOk(arg BackupGetLastRestoredAtAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetLastRestoredAtAttributeType(arg *BackupGetLastRestoredAtAttributeType, val BackupGetLastRestoredAtRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLastRestoredAtArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetLastRestoredAtRetType = string /* @@ -107,8 +132,10 @@ type BackupGetLastRestoredAtRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret BackupGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -116,11 +143,15 @@ func getBackupGetNameAttributeTypeOk(arg BackupGetNameAttributeType) (ret Backup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetNameAttributeType(arg *BackupGetNameAttributeType, val BackupGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetNameRetType = string /* @@ -128,10 +159,16 @@ type BackupGetNameRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret BackupGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -139,6 +176,7 @@ func getBackupGetSizeAttributeTypeOk(arg BackupGetSizeAttributeType) (ret Backup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetSizeAttributeType(arg *BackupGetSizeAttributeType, val BackupGetSizeRetType) { *arg = &val } @@ -151,21 +189,31 @@ func setBackupGetSizeAttributeType(arg *BackupGetSizeAttributeType, val BackupGe // BackupStatus the model 'Backup' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupStatus string // List of Status const ( - BACKUPSTATUS_IN_PROGRESS BackupStatus = "in-progress" - BACKUPSTATUS_INCONSISTENT BackupStatus = "inconsistent" - BACKUPSTATUS_AVAILABLE BackupStatus = "available" - BACKUPSTATUS_ERROR BackupStatus = "error" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSTATUS_IN_PROGRESS BackupStatus = "in-progress" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSTATUS_INCONSISTENT BackupStatus = "inconsistent" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSTATUS_AVAILABLE BackupStatus = "available" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSTATUS_ERROR BackupStatus = "error" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead BACKUPSTATUS_ERROR_RESTORING BackupStatus = "error-restoring" - BACKUPSTATUS_ERROR_CREATING BackupStatus = "error-creating" - BACKUPSTATUS_ERROR_DELETING BackupStatus = "error-deleting" - BACKUPSTATUS_UNRECOGNIZED BackupStatus = "unrecognized" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSTATUS_ERROR_CREATING BackupStatus = "error-creating" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSTATUS_ERROR_DELETING BackupStatus = "error-deleting" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPSTATUS_UNRECOGNIZED BackupStatus = "unrecognized" ) // All allowed values of Backup enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedBackupStatusEnumValues = []BackupStatus{ "in-progress", "inconsistent", @@ -177,6 +225,7 @@ var AllowedBackupStatusEnumValues = []BackupStatus{ "unrecognized", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *BackupStatus) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers @@ -204,6 +253,7 @@ func (v *BackupStatus) UnmarshalJSON(src []byte) error { // NewBackupStatusFromValue returns a pointer to a valid BackupStatus // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupStatusFromValue(v BackupStatus) (*BackupStatus, error) { ev := BackupStatus(v) if ev.IsValid() { @@ -214,6 +264,7 @@ func NewBackupStatusFromValue(v BackupStatus) (*BackupStatus, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v BackupStatus) IsValid() bool { for _, existing := range AllowedBackupStatusEnumValues { if existing == v { @@ -224,50 +275,65 @@ func (v BackupStatus) IsValid() bool { } // Ptr returns reference to StatusStatus value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v BackupStatus) Ptr() *BackupStatus { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupStatus struct { value *BackupStatus isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupStatus) Get() *BackupStatus { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupStatus) Set(val *BackupStatus) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupStatus) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupStatus) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupStatus(val *BackupStatus) *NullableBackupStatus { return &NullableBackupStatus{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupStatus) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupStatus) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetStatusAttributeType = *BackupStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetStatusArgType = BackupStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetStatusRetType = BackupStatus +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetStatusAttributeTypeOk(arg BackupGetStatusAttributeType) (ret BackupGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -275,6 +341,7 @@ func getBackupGetStatusAttributeTypeOk(arg BackupGetStatusAttributeType) (ret Ba return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetStatusAttributeType(arg *BackupGetStatusAttributeType, val BackupGetStatusRetType) { *arg = &val } @@ -284,10 +351,16 @@ func setBackupGetStatusAttributeType(arg *BackupGetStatusAttributeType, val Back */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetVolumeBackupsAttributeType = *[]BackupVolumeBackupsInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetVolumeBackupsArgType = []BackupVolumeBackupsInner + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupGetVolumeBackupsRetType = []BackupVolumeBackupsInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupGetVolumeBackupsAttributeTypeOk(arg BackupGetVolumeBackupsAttributeType) (ret BackupGetVolumeBackupsRetType, ok bool) { if arg == nil { return ret, false @@ -295,11 +368,13 @@ func getBackupGetVolumeBackupsAttributeTypeOk(arg BackupGetVolumeBackupsAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupGetVolumeBackupsAttributeType(arg *BackupGetVolumeBackupsAttributeType, val BackupGetVolumeBackupsRetType) { *arg = &val } // Backup struct for Backup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Backup struct { // REQUIRED CreatedAt BackupGetCreatedAtAttributeType `json:"createdAt" required:"true"` @@ -317,12 +392,14 @@ type Backup struct { VolumeBackups BackupGetVolumeBackupsAttributeType `json:"volumeBackups,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackup(createdAt BackupGetCreatedAtArgType, expireAt BackupGetExpireAtArgType, id BackupGetIdArgType, name BackupGetNameArgType, status BackupGetStatusArgType) *Backup { this := Backup{} setBackupGetCreatedAtAttributeType(&this.CreatedAt, createdAt) @@ -336,12 +413,14 @@ func NewBackup(createdAt BackupGetCreatedAtArgType, expireAt BackupGetExpireAtAr // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupWithDefaults() *Backup { this := Backup{} return &this } // GetCreatedAt returns the CreatedAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetCreatedAt() (ret BackupGetCreatedAtRetType) { ret, _ = o.GetCreatedAtOk() return ret @@ -349,16 +428,19 @@ func (o *Backup) GetCreatedAt() (ret BackupGetCreatedAtRetType) { // GetCreatedAtOk returns a tuple with the CreatedAt field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetCreatedAtOk() (ret BackupGetCreatedAtRetType, ok bool) { return getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt) } // SetCreatedAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetCreatedAt(v BackupGetCreatedAtRetType) { setBackupGetCreatedAtAttributeType(&o.CreatedAt, v) } // GetExpireAt returns the ExpireAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetExpireAt() (ret BackupGetExpireAtRetType) { ret, _ = o.GetExpireAtOk() return ret @@ -366,16 +448,19 @@ func (o *Backup) GetExpireAt() (ret BackupGetExpireAtRetType) { // GetExpireAtOk returns a tuple with the ExpireAt field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetExpireAtOk() (ret BackupGetExpireAtRetType, ok bool) { return getBackupGetExpireAtAttributeTypeOk(o.ExpireAt) } // SetExpireAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetExpireAt(v BackupGetExpireAtRetType) { setBackupGetExpireAtAttributeType(&o.ExpireAt, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetId() (ret BackupGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -383,16 +468,19 @@ func (o *Backup) GetId() (ret BackupGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetIdOk() (ret BackupGetIdRetType, ok bool) { return getBackupGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetId(v BackupGetIdRetType) { setBackupGetIdAttributeType(&o.Id, v) } // GetLastRestoredAt returns the LastRestoredAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetLastRestoredAt() (res BackupGetLastRestoredAtRetType) { res, _ = o.GetLastRestoredAtOk() return @@ -400,22 +488,26 @@ func (o *Backup) GetLastRestoredAt() (res BackupGetLastRestoredAtRetType) { // GetLastRestoredAtOk returns a tuple with the LastRestoredAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetLastRestoredAtOk() (ret BackupGetLastRestoredAtRetType, ok bool) { return getBackupGetLastRestoredAtAttributeTypeOk(o.LastRestoredAt) } // HasLastRestoredAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasLastRestoredAt() bool { _, ok := o.GetLastRestoredAtOk() return ok } // SetLastRestoredAt gets a reference to the given string and assigns it to the LastRestoredAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetLastRestoredAt(v BackupGetLastRestoredAtRetType) { setBackupGetLastRestoredAtAttributeType(&o.LastRestoredAt, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetName() (ret BackupGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -423,16 +515,19 @@ func (o *Backup) GetName() (ret BackupGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetNameOk() (ret BackupGetNameRetType, ok bool) { return getBackupGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetName(v BackupGetNameRetType) { setBackupGetNameAttributeType(&o.Name, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetSize() (res BackupGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -440,22 +535,26 @@ func (o *Backup) GetSize() (res BackupGetSizeRetType) { // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetSizeOk() (ret BackupGetSizeRetType, ok bool) { return getBackupGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetSize(v BackupGetSizeRetType) { setBackupGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetStatus() (ret BackupGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -463,16 +562,19 @@ func (o *Backup) GetStatus() (ret BackupGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetStatusOk() (ret BackupGetStatusRetType, ok bool) { return getBackupGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetStatus(v BackupGetStatusRetType) { setBackupGetStatusAttributeType(&o.Status, v) } // GetVolumeBackups returns the VolumeBackups field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetVolumeBackups() (res BackupGetVolumeBackupsRetType) { res, _ = o.GetVolumeBackupsOk() return @@ -480,21 +582,25 @@ func (o *Backup) GetVolumeBackups() (res BackupGetVolumeBackupsRetType) { // GetVolumeBackupsOk returns a tuple with the VolumeBackups field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) GetVolumeBackupsOk() (ret BackupGetVolumeBackupsRetType, ok bool) { return getBackupGetVolumeBackupsAttributeTypeOk(o.VolumeBackups) } // HasVolumeBackups returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) HasVolumeBackups() bool { _, ok := o.GetVolumeBackupsOk() return ok } // SetVolumeBackups gets a reference to the given []BackupVolumeBackupsInner and assigns it to the VolumeBackups field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Backup) SetVolumeBackups(v BackupGetVolumeBackupsRetType) { setBackupGetVolumeBackupsAttributeType(&o.VolumeBackups, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Backup) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { @@ -524,37 +630,45 @@ func (o Backup) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackup struct { value *Backup isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackup) Get() *Backup { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackup) Set(val *Backup) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackup) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackup) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackup(val *Backup) *NullableBackup { return &NullableBackup{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackup) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 32c221d13..f6a44d3f3 100644 --- a/services/serverbackup/model_backup_job.go +++ b/services/serverbackup/model_backup_job.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BackupJob{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupJobGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupJobGetIdAttributeTypeOk(arg BackupJobGetIdAttributeType) (ret BackupJobGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,25 +34,32 @@ func getBackupJobGetIdAttributeTypeOk(arg BackupJobGetIdAttributeType) (ret Back return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupJobGetIdAttributeType(arg *BackupJobGetIdAttributeType, val BackupJobGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupJobGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupJobGetIdRetType = string // BackupJob struct for BackupJob +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupJob struct { // REQUIRED Id BackupJobGetIdAttributeType `json:"id" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupJob(id BackupJobGetIdArgType) *BackupJob { this := BackupJob{} setBackupJobGetIdAttributeType(&this.Id, id) @@ -59,12 +69,14 @@ func NewBackupJob(id BackupJobGetIdArgType) *BackupJob { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupJobWithDefaults() *BackupJob { this := BackupJob{} return &this } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupJob) GetId() (ret BackupJobGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -72,15 +84,18 @@ func (o *BackupJob) GetId() (ret BackupJobGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupJob) GetIdOk() (ret BackupJobGetIdRetType, ok bool) { return getBackupJobGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupJob) SetId(v BackupJobGetIdRetType) { setBackupJobGetIdAttributeType(&o.Id, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupJob) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupJobGetIdAttributeTypeOk(o.Id); ok { @@ -89,37 +104,45 @@ func (o BackupJob) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupJob struct { value *BackupJob isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupJob) Get() *BackupJob { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupJob) Set(val *BackupJob) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupJob) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupJob) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupJob(val *BackupJob) *NullableBackupJob { return &NullableBackupJob{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupJob) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupJob) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serverbackup/model_backup_policy.go b/services/serverbackup/model_backup_policy.go index 5c4fba57e..be88f59b8 100644 --- a/services/serverbackup/model_backup_policy.go +++ b/services/serverbackup/model_backup_policy.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &BackupPolicy{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetBackupPropertiesAttributeType = *BackupPolicyBackupProperties + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetBackupPropertiesArgType = BackupPolicyBackupProperties + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetBackupPropertiesRetType = BackupPolicyBackupProperties +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicyGetBackupPropertiesAttributeTypeOk(arg BackupPolicyGetBackupPropertiesAttributeType) (ret BackupPolicyGetBackupPropertiesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getBackupPolicyGetBackupPropertiesAttributeTypeOk(arg BackupPolicyGetBackup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicyGetBackupPropertiesAttributeType(arg *BackupPolicyGetBackupPropertiesAttributeType, val BackupPolicyGetBackupPropertiesRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setBackupPolicyGetBackupPropertiesAttributeType(arg *BackupPolicyGetBackupP */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicygetDefaultAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicygetDefaultArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicygetDefaultRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicygetDefaultAttributeTypeOk(arg BackupPolicygetDefaultAttributeType) (ret BackupPolicygetDefaultRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getBackupPolicygetDefaultAttributeTypeOk(arg BackupPolicygetDefaultAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicygetDefaultAttributeType(arg *BackupPolicygetDefaultAttributeType, val BackupPolicygetDefaultRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setBackupPolicygetDefaultAttributeType(arg *BackupPolicygetDefaultAttribute */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicyGetDescriptionAttributeTypeOk(arg BackupPolicyGetDescriptionAttributeType) (ret BackupPolicyGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getBackupPolicyGetDescriptionAttributeTypeOk(arg BackupPolicyGetDescription return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicyGetDescriptionAttributeType(arg *BackupPolicyGetDescriptionAttributeType, val BackupPolicyGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetDescriptionRetType = string /* @@ -83,10 +104,16 @@ type BackupPolicyGetDescriptionRetType = string */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicygetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicygetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicygetEnabledRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicygetEnabledAttributeTypeOk(arg BackupPolicygetEnabledAttributeType) (ret BackupPolicygetEnabledRetType, ok bool) { if arg == nil { return ret, false @@ -94,6 +121,7 @@ func getBackupPolicygetEnabledAttributeTypeOk(arg BackupPolicygetEnabledAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicygetEnabledAttributeType(arg *BackupPolicygetEnabledAttributeType, val BackupPolicygetEnabledRetType) { *arg = &val } @@ -103,8 +131,10 @@ func setBackupPolicygetEnabledAttributeType(arg *BackupPolicygetEnabledAttribute */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicyGetIdAttributeTypeOk(arg BackupPolicyGetIdAttributeType) (ret BackupPolicyGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -112,11 +142,15 @@ func getBackupPolicyGetIdAttributeTypeOk(arg BackupPolicyGetIdAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicyGetIdAttributeType(arg *BackupPolicyGetIdAttributeType, val BackupPolicyGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetIdRetType = string /* @@ -124,8 +158,10 @@ type BackupPolicyGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicyGetNameAttributeTypeOk(arg BackupPolicyGetNameAttributeType) (ret BackupPolicyGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -133,11 +169,15 @@ func getBackupPolicyGetNameAttributeTypeOk(arg BackupPolicyGetNameAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicyGetNameAttributeType(arg *BackupPolicyGetNameAttributeType, val BackupPolicyGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetNameRetType = string /* @@ -145,8 +185,10 @@ type BackupPolicyGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetRruleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicyGetRruleAttributeTypeOk(arg BackupPolicyGetRruleAttributeType) (ret BackupPolicyGetRruleRetType, ok bool) { if arg == nil { return ret, false @@ -154,14 +196,19 @@ func getBackupPolicyGetRruleAttributeTypeOk(arg BackupPolicyGetRruleAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicyGetRruleAttributeType(arg *BackupPolicyGetRruleAttributeType, val BackupPolicyGetRruleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetRruleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyGetRruleRetType = string // BackupPolicy struct for BackupPolicy +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicy struct { BackupProperties BackupPolicyGetBackupPropertiesAttributeType `json:"backupProperties,omitempty"` Default BackupPolicygetDefaultAttributeType `json:"default,omitempty"` @@ -177,6 +224,7 @@ type BackupPolicy struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupPolicy() *BackupPolicy { this := BackupPolicy{} return &this @@ -185,12 +233,14 @@ func NewBackupPolicy() *BackupPolicy { // NewBackupPolicyWithDefaults instantiates a new BackupPolicy 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupPolicyWithDefaults() *BackupPolicy { this := BackupPolicy{} return &this } // GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetBackupProperties() (res BackupPolicyGetBackupPropertiesRetType) { res, _ = o.GetBackupPropertiesOk() return @@ -198,22 +248,26 @@ func (o *BackupPolicy) GetBackupProperties() (res BackupPolicyGetBackupPropertie // GetBackupPropertiesOk returns a tuple with the BackupProperties field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetBackupPropertiesOk() (ret BackupPolicyGetBackupPropertiesRetType, ok bool) { return getBackupPolicyGetBackupPropertiesAttributeTypeOk(o.BackupProperties) } // HasBackupProperties returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) HasBackupProperties() bool { _, ok := o.GetBackupPropertiesOk() return ok } // SetBackupProperties gets a reference to the given BackupPolicyBackupProperties and assigns it to the BackupProperties field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) SetBackupProperties(v BackupPolicyGetBackupPropertiesRetType) { setBackupPolicyGetBackupPropertiesAttributeType(&o.BackupProperties, v) } // GetDefault returns the Default field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetDefault() (res BackupPolicygetDefaultRetType) { res, _ = o.GetDefaultOk() return @@ -221,22 +275,26 @@ func (o *BackupPolicy) GetDefault() (res BackupPolicygetDefaultRetType) { // GetDefaultOk returns a tuple with the Default field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetDefaultOk() (ret BackupPolicygetDefaultRetType, ok bool) { return getBackupPolicygetDefaultAttributeTypeOk(o.Default) } // HasDefault returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) HasDefault() bool { _, ok := o.GetDefaultOk() return ok } // SetDefault gets a reference to the given bool and assigns it to the Default field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) SetDefault(v BackupPolicygetDefaultRetType) { setBackupPolicygetDefaultAttributeType(&o.Default, v) } // GetDescription returns the Description field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetDescription() (res BackupPolicyGetDescriptionRetType) { res, _ = o.GetDescriptionOk() return @@ -244,22 +302,26 @@ func (o *BackupPolicy) GetDescription() (res BackupPolicyGetDescriptionRetType) // GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetDescriptionOk() (ret BackupPolicyGetDescriptionRetType, ok bool) { return getBackupPolicyGetDescriptionAttributeTypeOk(o.Description) } // HasDescription returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) HasDescription() bool { _, ok := o.GetDescriptionOk() return ok } // SetDescription gets a reference to the given string and assigns it to the Description field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) SetDescription(v BackupPolicyGetDescriptionRetType) { setBackupPolicyGetDescriptionAttributeType(&o.Description, v) } // GetEnabled returns the Enabled field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetEnabled() (res BackupPolicygetEnabledRetType) { res, _ = o.GetEnabledOk() return @@ -267,22 +329,26 @@ func (o *BackupPolicy) GetEnabled() (res BackupPolicygetEnabledRetType) { // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetEnabledOk() (ret BackupPolicygetEnabledRetType, ok bool) { return getBackupPolicygetEnabledAttributeTypeOk(o.Enabled) } // HasEnabled returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) HasEnabled() bool { _, ok := o.GetEnabledOk() return ok } // SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) SetEnabled(v BackupPolicygetEnabledRetType) { setBackupPolicygetEnabledAttributeType(&o.Enabled, v) } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetId() (res BackupPolicyGetIdRetType) { res, _ = o.GetIdOk() return @@ -290,22 +356,26 @@ func (o *BackupPolicy) GetId() (res BackupPolicyGetIdRetType) { // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetIdOk() (ret BackupPolicyGetIdRetType, ok bool) { return getBackupPolicyGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) SetId(v BackupPolicyGetIdRetType) { setBackupPolicyGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetName() (res BackupPolicyGetNameRetType) { res, _ = o.GetNameOk() return @@ -313,22 +383,26 @@ func (o *BackupPolicy) GetName() (res BackupPolicyGetNameRetType) { // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetNameOk() (ret BackupPolicyGetNameRetType, ok bool) { return getBackupPolicyGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) SetName(v BackupPolicyGetNameRetType) { setBackupPolicyGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetRrule() (res BackupPolicyGetRruleRetType) { res, _ = o.GetRruleOk() return @@ -336,21 +410,25 @@ func (o *BackupPolicy) GetRrule() (res BackupPolicyGetRruleRetType) { // GetRruleOk returns a tuple with the Rrule field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) GetRruleOk() (ret BackupPolicyGetRruleRetType, ok bool) { return getBackupPolicyGetRruleAttributeTypeOk(o.Rrule) } // HasRrule returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) HasRrule() bool { _, ok := o.GetRruleOk() return ok } // SetRrule gets a reference to the given string and assigns it to the Rrule field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicy) SetRrule(v BackupPolicyGetRruleRetType) { setBackupPolicyGetRruleAttributeType(&o.Rrule, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupPolicy) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupPolicyGetBackupPropertiesAttributeTypeOk(o.BackupProperties); ok { @@ -377,37 +455,45 @@ func (o BackupPolicy) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupPolicy struct { value *BackupPolicy isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupPolicy) Get() *BackupPolicy { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupPolicy) Set(val *BackupPolicy) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupPolicy) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupPolicy) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupPolicy(val *BackupPolicy) *NullableBackupPolicy { return &NullableBackupPolicy{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupPolicy) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupPolicy) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serverbackup/model_backup_policy_backup_properties.go b/services/serverbackup/model_backup_policy_backup_properties.go index d134f5465..d4a24d2b8 100644 --- a/services/serverbackup/model_backup_policy_backup_properties.go +++ b/services/serverbackup/model_backup_policy_backup_properties.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BackupPolicyBackupProperties{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyBackupPropertiesGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicyBackupPropertiesGetNameAttributeTypeOk(arg BackupPolicyBackupPropertiesGetNameAttributeType) (ret BackupPolicyBackupPropertiesGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBackupPolicyBackupPropertiesGetNameAttributeTypeOk(arg BackupPolicyBacku return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicyBackupPropertiesGetNameAttributeType(arg *BackupPolicyBackupPropertiesGetNameAttributeType, val BackupPolicyBackupPropertiesGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyBackupPropertiesGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyBackupPropertiesGetNameRetType = string /* @@ -43,10 +50,16 @@ type BackupPolicyBackupPropertiesGetNameRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyBackupPropertiesGetRetentionPeriodAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyBackupPropertiesGetRetentionPeriodArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyBackupPropertiesGetRetentionPeriodRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPolicyBackupPropertiesGetRetentionPeriodAttributeTypeOk(arg BackupPolicyBackupPropertiesGetRetentionPeriodAttributeType) (ret BackupPolicyBackupPropertiesGetRetentionPeriodRetType, ok bool) { if arg == nil { return ret, false @@ -54,11 +67,13 @@ func getBackupPolicyBackupPropertiesGetRetentionPeriodAttributeTypeOk(arg Backup return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPolicyBackupPropertiesGetRetentionPeriodAttributeType(arg *BackupPolicyBackupPropertiesGetRetentionPeriodAttributeType, val BackupPolicyBackupPropertiesGetRetentionPeriodRetType) { *arg = &val } // BackupPolicyBackupProperties struct for BackupPolicyBackupProperties +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPolicyBackupProperties struct { Name BackupPolicyBackupPropertiesGetNameAttributeType `json:"name,omitempty"` // Can be cast to int32 without loss of precision. @@ -69,6 +84,7 @@ type BackupPolicyBackupProperties struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupPolicyBackupProperties() *BackupPolicyBackupProperties { this := BackupPolicyBackupProperties{} return &this @@ -77,12 +93,14 @@ func NewBackupPolicyBackupProperties() *BackupPolicyBackupProperties { // NewBackupPolicyBackupPropertiesWithDefaults instantiates a new BackupPolicyBackupProperties 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupPolicyBackupPropertiesWithDefaults() *BackupPolicyBackupProperties { this := BackupPolicyBackupProperties{} return &this } // GetName returns the Name field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicyBackupProperties) GetName() (res BackupPolicyBackupPropertiesGetNameRetType) { res, _ = o.GetNameOk() return @@ -90,22 +108,26 @@ func (o *BackupPolicyBackupProperties) GetName() (res BackupPolicyBackupProperti // GetNameOk returns a tuple with the Name field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicyBackupProperties) GetNameOk() (ret BackupPolicyBackupPropertiesGetNameRetType, ok bool) { return getBackupPolicyBackupPropertiesGetNameAttributeTypeOk(o.Name) } // HasName returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicyBackupProperties) HasName() bool { _, ok := o.GetNameOk() return ok } // SetName gets a reference to the given string and assigns it to the Name field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicyBackupProperties) SetName(v BackupPolicyBackupPropertiesGetNameRetType) { setBackupPolicyBackupPropertiesGetNameAttributeType(&o.Name, v) } // GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicyBackupProperties) GetRetentionPeriod() (res BackupPolicyBackupPropertiesGetRetentionPeriodRetType) { res, _ = o.GetRetentionPeriodOk() return @@ -113,21 +135,25 @@ func (o *BackupPolicyBackupProperties) GetRetentionPeriod() (res BackupPolicyBac // GetRetentionPeriodOk returns a tuple with the RetentionPeriod field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicyBackupProperties) GetRetentionPeriodOk() (ret BackupPolicyBackupPropertiesGetRetentionPeriodRetType, ok bool) { return getBackupPolicyBackupPropertiesGetRetentionPeriodAttributeTypeOk(o.RetentionPeriod) } // HasRetentionPeriod returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicyBackupProperties) HasRetentionPeriod() bool { _, ok := o.GetRetentionPeriodOk() return ok } // SetRetentionPeriod gets a reference to the given int64 and assigns it to the RetentionPeriod field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupPolicyBackupProperties) SetRetentionPeriod(v BackupPolicyBackupPropertiesGetRetentionPeriodRetType) { setBackupPolicyBackupPropertiesGetRetentionPeriodAttributeType(&o.RetentionPeriod, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupPolicyBackupProperties) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupPolicyBackupPropertiesGetNameAttributeTypeOk(o.Name); ok { @@ -139,37 +165,45 @@ func (o BackupPolicyBackupProperties) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupPolicyBackupProperties struct { value *BackupPolicyBackupProperties isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupPolicyBackupProperties) Get() *BackupPolicyBackupProperties { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupPolicyBackupProperties) Set(val *BackupPolicyBackupProperties) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupPolicyBackupProperties) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupPolicyBackupProperties) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupPolicyBackupProperties(val *BackupPolicyBackupProperties) *NullableBackupPolicyBackupProperties { return &NullableBackupPolicyBackupProperties{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupPolicyBackupProperties) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupPolicyBackupProperties) 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 a1b86bae1..b75d2dbd9 100644 --- a/services/serverbackup/model_backup_properties.go +++ b/services/serverbackup/model_backup_properties.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &BackupProperties{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPropertiesGetNameAttributeTypeOk(arg BackupPropertiesGetNameAttributeType) (ret BackupPropertiesGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getBackupPropertiesGetNameAttributeTypeOk(arg BackupPropertiesGetNameAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPropertiesGetNameAttributeType(arg *BackupPropertiesGetNameAttributeType, val BackupPropertiesGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetNameRetType = string /* @@ -43,10 +50,16 @@ type BackupPropertiesGetNameRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetRetentionPeriodAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetRetentionPeriodArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetRetentionPeriodRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPropertiesGetRetentionPeriodAttributeTypeOk(arg BackupPropertiesGetRetentionPeriodAttributeType) (ret BackupPropertiesGetRetentionPeriodRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getBackupPropertiesGetRetentionPeriodAttributeTypeOk(arg BackupPropertiesGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPropertiesGetRetentionPeriodAttributeType(arg *BackupPropertiesGetRetentionPeriodAttributeType, val BackupPropertiesGetRetentionPeriodRetType) { *arg = &val } @@ -63,10 +77,16 @@ func setBackupPropertiesGetRetentionPeriodAttributeType(arg *BackupPropertiesGet */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetVolumeIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetVolumeIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupPropertiesGetVolumeIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupPropertiesGetVolumeIdsAttributeTypeOk(arg BackupPropertiesGetVolumeIdsAttributeType) (ret BackupPropertiesGetVolumeIdsRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +94,13 @@ func getBackupPropertiesGetVolumeIdsAttributeTypeOk(arg BackupPropertiesGetVolum return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupPropertiesGetVolumeIdsAttributeType(arg *BackupPropertiesGetVolumeIdsAttributeType, val BackupPropertiesGetVolumeIdsRetType) { *arg = &val } // BackupProperties struct for BackupProperties +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupProperties struct { // Max 255 characters // REQUIRED @@ -90,12 +112,14 @@ type BackupProperties struct { VolumeIds BackupPropertiesGetVolumeIdsAttributeType `json:"volumeIds,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupProperties(name BackupPropertiesGetNameArgType, retentionPeriod BackupPropertiesGetRetentionPeriodArgType) *BackupProperties { this := BackupProperties{} setBackupPropertiesGetNameAttributeType(&this.Name, name) @@ -106,12 +130,14 @@ func NewBackupProperties(name BackupPropertiesGetNameArgType, retentionPeriod Ba // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupPropertiesWithDefaults() *BackupProperties { this := BackupProperties{} return &this } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) GetName() (ret BackupPropertiesGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -119,16 +145,19 @@ func (o *BackupProperties) GetName() (ret BackupPropertiesGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) GetNameOk() (ret BackupPropertiesGetNameRetType, ok bool) { return getBackupPropertiesGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) SetName(v BackupPropertiesGetNameRetType) { setBackupPropertiesGetNameAttributeType(&o.Name, v) } // GetRetentionPeriod returns the RetentionPeriod field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) GetRetentionPeriod() (ret BackupPropertiesGetRetentionPeriodRetType) { ret, _ = o.GetRetentionPeriodOk() return ret @@ -136,16 +165,19 @@ func (o *BackupProperties) GetRetentionPeriod() (ret BackupPropertiesGetRetentio // GetRetentionPeriodOk returns a tuple with the RetentionPeriod field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) GetRetentionPeriodOk() (ret BackupPropertiesGetRetentionPeriodRetType, ok bool) { return getBackupPropertiesGetRetentionPeriodAttributeTypeOk(o.RetentionPeriod) } // SetRetentionPeriod sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) SetRetentionPeriod(v BackupPropertiesGetRetentionPeriodRetType) { setBackupPropertiesGetRetentionPeriodAttributeType(&o.RetentionPeriod, v) } // GetVolumeIds returns the VolumeIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) GetVolumeIds() (res BackupPropertiesGetVolumeIdsRetType) { res, _ = o.GetVolumeIdsOk() return @@ -153,21 +185,25 @@ func (o *BackupProperties) GetVolumeIds() (res BackupPropertiesGetVolumeIdsRetTy // GetVolumeIdsOk returns a tuple with the VolumeIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) GetVolumeIdsOk() (ret BackupPropertiesGetVolumeIdsRetType, ok bool) { return getBackupPropertiesGetVolumeIdsAttributeTypeOk(o.VolumeIds) } // HasVolumeIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) HasVolumeIds() bool { _, ok := o.GetVolumeIdsOk() return ok } // SetVolumeIds gets a reference to the given []string and assigns it to the VolumeIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupProperties) SetVolumeIds(v BackupPropertiesGetVolumeIdsRetType) { setBackupPropertiesGetVolumeIdsAttributeType(&o.VolumeIds, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupProperties) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupPropertiesGetNameAttributeTypeOk(o.Name); ok { @@ -182,37 +218,45 @@ func (o BackupProperties) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupProperties struct { value *BackupProperties isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupProperties) Get() *BackupProperties { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupProperties) Set(val *BackupProperties) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupProperties) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupProperties) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupProperties(val *BackupProperties) *NullableBackupProperties { return &NullableBackupProperties{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupProperties) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 913d076cc..04396afc1 100644 --- a/services/serverbackup/model_backup_schedule.go +++ b/services/serverbackup/model_backup_schedule.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &BackupSchedule{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetBackupPropertiesAttributeType = *BackupProperties + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetBackupPropertiesArgType = BackupProperties + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetBackupPropertiesRetType = BackupProperties +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupScheduleGetBackupPropertiesAttributeTypeOk(arg BackupScheduleGetBackupPropertiesAttributeType) (ret BackupScheduleGetBackupPropertiesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getBackupScheduleGetBackupPropertiesAttributeTypeOk(arg BackupScheduleGetBa return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupScheduleGetBackupPropertiesAttributeType(arg *BackupScheduleGetBackupPropertiesAttributeType, val BackupScheduleGetBackupPropertiesRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setBackupScheduleGetBackupPropertiesAttributeType(arg *BackupScheduleGetBac */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSchedulegetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSchedulegetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSchedulegetEnabledRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupSchedulegetEnabledAttributeTypeOk(arg BackupSchedulegetEnabledAttributeType) (ret BackupSchedulegetEnabledRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getBackupSchedulegetEnabledAttributeTypeOk(arg BackupSchedulegetEnabledAttr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupSchedulegetEnabledAttributeType(arg *BackupSchedulegetEnabledAttributeType, val BackupSchedulegetEnabledRetType) { *arg = &val } @@ -62,10 +77,16 @@ func setBackupSchedulegetEnabledAttributeType(arg *BackupSchedulegetEnabledAttri */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetIdAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetIdArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetIdRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupScheduleGetIdAttributeTypeOk(arg BackupScheduleGetIdAttributeType) (ret BackupScheduleGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -73,6 +94,7 @@ func getBackupScheduleGetIdAttributeTypeOk(arg BackupScheduleGetIdAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupScheduleGetIdAttributeType(arg *BackupScheduleGetIdAttributeType, val BackupScheduleGetIdRetType) { *arg = &val } @@ -82,8 +104,10 @@ func setBackupScheduleGetIdAttributeType(arg *BackupScheduleGetIdAttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupScheduleGetNameAttributeTypeOk(arg BackupScheduleGetNameAttributeType) (ret BackupScheduleGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -91,11 +115,15 @@ func getBackupScheduleGetNameAttributeTypeOk(arg BackupScheduleGetNameAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupScheduleGetNameAttributeType(arg *BackupScheduleGetNameAttributeType, val BackupScheduleGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetNameRetType = string /* @@ -103,8 +131,10 @@ type BackupScheduleGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetRruleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupScheduleGetRruleAttributeTypeOk(arg BackupScheduleGetRruleAttributeType) (ret BackupScheduleGetRruleRetType, ok bool) { if arg == nil { return ret, false @@ -112,14 +142,19 @@ func getBackupScheduleGetRruleAttributeTypeOk(arg BackupScheduleGetRruleAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupScheduleGetRruleAttributeType(arg *BackupScheduleGetRruleAttributeType, val BackupScheduleGetRruleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetRruleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupScheduleGetRruleRetType = string // BackupSchedule struct for BackupSchedule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupSchedule struct { BackupProperties BackupScheduleGetBackupPropertiesAttributeType `json:"backupProperties,omitempty"` // REQUIRED @@ -134,12 +169,14 @@ type BackupSchedule struct { Rrule BackupScheduleGetRruleAttributeType `json:"rrule" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupSchedule(enabled BackupSchedulegetEnabledArgType, id BackupScheduleGetIdArgType, name BackupScheduleGetNameArgType, rrule BackupScheduleGetRruleArgType) *BackupSchedule { this := BackupSchedule{} setBackupSchedulegetEnabledAttributeType(&this.Enabled, enabled) @@ -152,12 +189,14 @@ func NewBackupSchedule(enabled BackupSchedulegetEnabledArgType, id BackupSchedul // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupScheduleWithDefaults() *BackupSchedule { this := BackupSchedule{} return &this } // GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetBackupProperties() (res BackupScheduleGetBackupPropertiesRetType) { res, _ = o.GetBackupPropertiesOk() return @@ -165,22 +204,26 @@ func (o *BackupSchedule) GetBackupProperties() (res BackupScheduleGetBackupPrope // GetBackupPropertiesOk returns a tuple with the BackupProperties field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetBackupPropertiesOk() (ret BackupScheduleGetBackupPropertiesRetType, ok bool) { return getBackupScheduleGetBackupPropertiesAttributeTypeOk(o.BackupProperties) } // HasBackupProperties returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) HasBackupProperties() bool { _, ok := o.GetBackupPropertiesOk() return ok } // SetBackupProperties gets a reference to the given BackupProperties and assigns it to the BackupProperties field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) SetBackupProperties(v BackupScheduleGetBackupPropertiesRetType) { setBackupScheduleGetBackupPropertiesAttributeType(&o.BackupProperties, v) } // GetEnabled returns the Enabled field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetEnabled() (ret BackupSchedulegetEnabledRetType) { ret, _ = o.GetEnabledOk() return ret @@ -188,16 +231,19 @@ func (o *BackupSchedule) GetEnabled() (ret BackupSchedulegetEnabledRetType) { // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetEnabledOk() (ret BackupSchedulegetEnabledRetType, ok bool) { return getBackupSchedulegetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) SetEnabled(v BackupSchedulegetEnabledRetType) { setBackupSchedulegetEnabledAttributeType(&o.Enabled, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetId() (ret BackupScheduleGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -205,16 +251,19 @@ func (o *BackupSchedule) GetId() (ret BackupScheduleGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetIdOk() (ret BackupScheduleGetIdRetType, ok bool) { return getBackupScheduleGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) SetId(v BackupScheduleGetIdRetType) { setBackupScheduleGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetName() (ret BackupScheduleGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -222,16 +271,19 @@ func (o *BackupSchedule) GetName() (ret BackupScheduleGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetNameOk() (ret BackupScheduleGetNameRetType, ok bool) { return getBackupScheduleGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) SetName(v BackupScheduleGetNameRetType) { setBackupScheduleGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetRrule() (ret BackupScheduleGetRruleRetType) { ret, _ = o.GetRruleOk() return ret @@ -239,15 +291,18 @@ func (o *BackupSchedule) GetRrule() (ret BackupScheduleGetRruleRetType) { // GetRruleOk returns a tuple with the Rrule field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) GetRruleOk() (ret BackupScheduleGetRruleRetType, ok bool) { return getBackupScheduleGetRruleAttributeTypeOk(o.Rrule) } // SetRrule sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupSchedule) SetRrule(v BackupScheduleGetRruleRetType) { setBackupScheduleGetRruleAttributeType(&o.Rrule, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupSchedule) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupScheduleGetBackupPropertiesAttributeTypeOk(o.BackupProperties); ok { @@ -268,37 +323,45 @@ func (o BackupSchedule) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupSchedule struct { value *BackupSchedule isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupSchedule) Get() *BackupSchedule { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupSchedule) Set(val *BackupSchedule) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupSchedule) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupSchedule) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupSchedule(val *BackupSchedule) *NullableBackupSchedule { return &NullableBackupSchedule{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupSchedule) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 806e74bc0..73ac37a57 100644 --- a/services/serverbackup/model_backup_volume_backups_inner.go +++ b/services/serverbackup/model_backup_volume_backups_inner.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -23,8 +24,10 @@ var _ MappedNullable = &BackupVolumeBackupsInner{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupVolumeBackupsInnerGetIdAttributeTypeOk(arg BackupVolumeBackupsInnerGetIdAttributeType) (ret BackupVolumeBackupsInnerGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -32,11 +35,15 @@ func getBackupVolumeBackupsInnerGetIdAttributeTypeOk(arg BackupVolumeBackupsInne return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupVolumeBackupsInnerGetIdAttributeType(arg *BackupVolumeBackupsInnerGetIdAttributeType, val BackupVolumeBackupsInnerGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetIdRetType = string /* @@ -44,8 +51,10 @@ type BackupVolumeBackupsInnerGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetLastRestoredAtAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupVolumeBackupsInnerGetLastRestoredAtAttributeTypeOk(arg BackupVolumeBackupsInnerGetLastRestoredAtAttributeType) (ret BackupVolumeBackupsInnerGetLastRestoredAtRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +62,15 @@ func getBackupVolumeBackupsInnerGetLastRestoredAtAttributeTypeOk(arg BackupVolum return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupVolumeBackupsInnerGetLastRestoredAtAttributeType(arg *BackupVolumeBackupsInnerGetLastRestoredAtAttributeType, val BackupVolumeBackupsInnerGetLastRestoredAtRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetLastRestoredAtArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetLastRestoredAtRetType = string /* @@ -65,8 +78,10 @@ type BackupVolumeBackupsInnerGetLastRestoredAtRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetLastRestoredVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupVolumeBackupsInnerGetLastRestoredVolumeIdAttributeTypeOk(arg BackupVolumeBackupsInnerGetLastRestoredVolumeIdAttributeType) (ret BackupVolumeBackupsInnerGetLastRestoredVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +89,15 @@ func getBackupVolumeBackupsInnerGetLastRestoredVolumeIdAttributeTypeOk(arg Backu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupVolumeBackupsInnerGetLastRestoredVolumeIdAttributeType(arg *BackupVolumeBackupsInnerGetLastRestoredVolumeIdAttributeType, val BackupVolumeBackupsInnerGetLastRestoredVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetLastRestoredVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetLastRestoredVolumeIdRetType = string /* @@ -86,10 +105,16 @@ type BackupVolumeBackupsInnerGetLastRestoredVolumeIdRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetSizeAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetSizeArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetSizeRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupVolumeBackupsInnerGetSizeAttributeTypeOk(arg BackupVolumeBackupsInnerGetSizeAttributeType) (ret BackupVolumeBackupsInnerGetSizeRetType, ok bool) { if arg == nil { return ret, false @@ -97,6 +122,7 @@ func getBackupVolumeBackupsInnerGetSizeAttributeTypeOk(arg BackupVolumeBackupsIn return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupVolumeBackupsInnerGetSizeAttributeType(arg *BackupVolumeBackupsInnerGetSizeAttributeType, val BackupVolumeBackupsInnerGetSizeRetType) { *arg = &val } @@ -109,22 +135,33 @@ func setBackupVolumeBackupsInnerGetSizeAttributeType(arg *BackupVolumeBackupsInn // BackupVolumeBackupsInnerStatus the model 'BackupVolumeBackupsInner' // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerStatus string // List of Status const ( - BACKUPVOLUMEBACKUPSINNERSTATUS_AVAILABLE BackupVolumeBackupsInnerStatus = "available" - BACKUPVOLUMEBACKUPSINNERSTATUS_CREATING BackupVolumeBackupsInnerStatus = "creating" - BACKUPVOLUMEBACKUPSINNERSTATUS_DELETING BackupVolumeBackupsInnerStatus = "deleting" - BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_DELETING BackupVolumeBackupsInnerStatus = "error-deleting" - BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR BackupVolumeBackupsInnerStatus = "error" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPVOLUMEBACKUPSINNERSTATUS_AVAILABLE BackupVolumeBackupsInnerStatus = "available" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPVOLUMEBACKUPSINNERSTATUS_CREATING BackupVolumeBackupsInnerStatus = "creating" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPVOLUMEBACKUPSINNERSTATUS_DELETING BackupVolumeBackupsInnerStatus = "deleting" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_DELETING BackupVolumeBackupsInnerStatus = "error-deleting" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR BackupVolumeBackupsInnerStatus = "error" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_RESTORING BackupVolumeBackupsInnerStatus = "error-restoring" - BACKUPVOLUMEBACKUPSINNERSTATUS_RESTORING BackupVolumeBackupsInnerStatus = "restoring" - BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_CREATING BackupVolumeBackupsInnerStatus = "error-creating" - BACKUPVOLUMEBACKUPSINNERSTATUS_UNRECOGNIZED BackupVolumeBackupsInnerStatus = "unrecognized" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPVOLUMEBACKUPSINNERSTATUS_RESTORING BackupVolumeBackupsInnerStatus = "restoring" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPVOLUMEBACKUPSINNERSTATUS_ERROR_CREATING BackupVolumeBackupsInnerStatus = "error-creating" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + BACKUPVOLUMEBACKUPSINNERSTATUS_UNRECOGNIZED BackupVolumeBackupsInnerStatus = "unrecognized" ) // All allowed values of BackupVolumeBackupsInner enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedBackupVolumeBackupsInnerStatusEnumValues = []BackupVolumeBackupsInnerStatus{ "available", "creating", @@ -137,6 +174,7 @@ var AllowedBackupVolumeBackupsInnerStatusEnumValues = []BackupVolumeBackupsInner "unrecognized", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *BackupVolumeBackupsInnerStatus) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers @@ -164,6 +202,7 @@ func (v *BackupVolumeBackupsInnerStatus) UnmarshalJSON(src []byte) error { // NewBackupVolumeBackupsInnerStatusFromValue returns a pointer to a valid BackupVolumeBackupsInnerStatus // for the value passed as argument, or an error if the value passed is not allowed by the enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupVolumeBackupsInnerStatusFromValue(v BackupVolumeBackupsInnerStatus) (*BackupVolumeBackupsInnerStatus, error) { ev := BackupVolumeBackupsInnerStatus(v) if ev.IsValid() { @@ -174,6 +213,7 @@ func NewBackupVolumeBackupsInnerStatusFromValue(v BackupVolumeBackupsInnerStatus } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v BackupVolumeBackupsInnerStatus) IsValid() bool { for _, existing := range AllowedBackupVolumeBackupsInnerStatusEnumValues { if existing == v { @@ -184,50 +224,65 @@ func (v BackupVolumeBackupsInnerStatus) IsValid() bool { } // Ptr returns reference to StatusStatus value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v BackupVolumeBackupsInnerStatus) Ptr() *BackupVolumeBackupsInnerStatus { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupVolumeBackupsInnerStatus struct { value *BackupVolumeBackupsInnerStatus isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupVolumeBackupsInnerStatus) Get() *BackupVolumeBackupsInnerStatus { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupVolumeBackupsInnerStatus) Set(val *BackupVolumeBackupsInnerStatus) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupVolumeBackupsInnerStatus) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupVolumeBackupsInnerStatus) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupVolumeBackupsInnerStatus(val *BackupVolumeBackupsInnerStatus) *NullableBackupVolumeBackupsInnerStatus { return &NullableBackupVolumeBackupsInnerStatus{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupVolumeBackupsInnerStatus) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupVolumeBackupsInnerStatus) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetStatusAttributeType = *BackupVolumeBackupsInnerStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetStatusArgType = BackupVolumeBackupsInnerStatus + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetStatusRetType = BackupVolumeBackupsInnerStatus +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupVolumeBackupsInnerGetStatusAttributeTypeOk(arg BackupVolumeBackupsInnerGetStatusAttributeType) (ret BackupVolumeBackupsInnerGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -235,6 +290,7 @@ func getBackupVolumeBackupsInnerGetStatusAttributeTypeOk(arg BackupVolumeBackups return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupVolumeBackupsInnerGetStatusAttributeType(arg *BackupVolumeBackupsInnerGetStatusAttributeType, val BackupVolumeBackupsInnerGetStatusRetType) { *arg = &val } @@ -244,8 +300,10 @@ func setBackupVolumeBackupsInnerGetStatusAttributeType(arg *BackupVolumeBackupsI */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getBackupVolumeBackupsInnerGetVolumeIdAttributeTypeOk(arg BackupVolumeBackupsInnerGetVolumeIdAttributeType) (ret BackupVolumeBackupsInnerGetVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -253,14 +311,19 @@ func getBackupVolumeBackupsInnerGetVolumeIdAttributeTypeOk(arg BackupVolumeBacku return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setBackupVolumeBackupsInnerGetVolumeIdAttributeType(arg *BackupVolumeBackupsInnerGetVolumeIdAttributeType, val BackupVolumeBackupsInnerGetVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInnerGetVolumeIdRetType = string // BackupVolumeBackupsInner struct for BackupVolumeBackupsInner +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type BackupVolumeBackupsInner struct { Id BackupVolumeBackupsInnerGetIdAttributeType `json:"id,omitempty"` LastRestoredAt BackupVolumeBackupsInnerGetLastRestoredAtAttributeType `json:"lastRestoredAt,omitempty"` @@ -275,6 +338,7 @@ type BackupVolumeBackupsInner struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupVolumeBackupsInner() *BackupVolumeBackupsInner { this := BackupVolumeBackupsInner{} return &this @@ -283,12 +347,14 @@ func NewBackupVolumeBackupsInner() *BackupVolumeBackupsInner { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewBackupVolumeBackupsInnerWithDefaults() *BackupVolumeBackupsInner { this := BackupVolumeBackupsInner{} return &this } // GetId returns the Id field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetId() (res BackupVolumeBackupsInnerGetIdRetType) { res, _ = o.GetIdOk() return @@ -296,22 +362,26 @@ func (o *BackupVolumeBackupsInner) GetId() (res BackupVolumeBackupsInnerGetIdRet // GetIdOk returns a tuple with the Id field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetIdOk() (ret BackupVolumeBackupsInnerGetIdRetType, ok bool) { return getBackupVolumeBackupsInnerGetIdAttributeTypeOk(o.Id) } // HasId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) HasId() bool { _, ok := o.GetIdOk() return ok } // SetId gets a reference to the given string and assigns it to the Id field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) SetId(v BackupVolumeBackupsInnerGetIdRetType) { setBackupVolumeBackupsInnerGetIdAttributeType(&o.Id, v) } // GetLastRestoredAt returns the LastRestoredAt field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetLastRestoredAt() (res BackupVolumeBackupsInnerGetLastRestoredAtRetType) { res, _ = o.GetLastRestoredAtOk() return @@ -319,22 +389,26 @@ func (o *BackupVolumeBackupsInner) GetLastRestoredAt() (res BackupVolumeBackupsI // GetLastRestoredAtOk returns a tuple with the LastRestoredAt field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetLastRestoredAtOk() (ret BackupVolumeBackupsInnerGetLastRestoredAtRetType, ok bool) { return getBackupVolumeBackupsInnerGetLastRestoredAtAttributeTypeOk(o.LastRestoredAt) } // HasLastRestoredAt returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) HasLastRestoredAt() bool { _, ok := o.GetLastRestoredAtOk() return ok } // SetLastRestoredAt gets a reference to the given string and assigns it to the LastRestoredAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) SetLastRestoredAt(v BackupVolumeBackupsInnerGetLastRestoredAtRetType) { setBackupVolumeBackupsInnerGetLastRestoredAtAttributeType(&o.LastRestoredAt, v) } // GetLastRestoredVolumeId returns the LastRestoredVolumeId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetLastRestoredVolumeId() (res BackupVolumeBackupsInnerGetLastRestoredVolumeIdRetType) { res, _ = o.GetLastRestoredVolumeIdOk() return @@ -342,22 +416,26 @@ func (o *BackupVolumeBackupsInner) GetLastRestoredVolumeId() (res BackupVolumeBa // GetLastRestoredVolumeIdOk returns a tuple with the LastRestoredVolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetLastRestoredVolumeIdOk() (ret BackupVolumeBackupsInnerGetLastRestoredVolumeIdRetType, ok bool) { return getBackupVolumeBackupsInnerGetLastRestoredVolumeIdAttributeTypeOk(o.LastRestoredVolumeId) } // HasLastRestoredVolumeId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) HasLastRestoredVolumeId() bool { _, ok := o.GetLastRestoredVolumeIdOk() return ok } // SetLastRestoredVolumeId gets a reference to the given string and assigns it to the LastRestoredVolumeId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) SetLastRestoredVolumeId(v BackupVolumeBackupsInnerGetLastRestoredVolumeIdRetType) { setBackupVolumeBackupsInnerGetLastRestoredVolumeIdAttributeType(&o.LastRestoredVolumeId, v) } // GetSize returns the Size field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetSize() (res BackupVolumeBackupsInnerGetSizeRetType) { res, _ = o.GetSizeOk() return @@ -365,22 +443,26 @@ func (o *BackupVolumeBackupsInner) GetSize() (res BackupVolumeBackupsInnerGetSiz // GetSizeOk returns a tuple with the Size field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetSizeOk() (ret BackupVolumeBackupsInnerGetSizeRetType, ok bool) { return getBackupVolumeBackupsInnerGetSizeAttributeTypeOk(o.Size) } // HasSize returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) HasSize() bool { _, ok := o.GetSizeOk() return ok } // SetSize gets a reference to the given int64 and assigns it to the Size field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) SetSize(v BackupVolumeBackupsInnerGetSizeRetType) { setBackupVolumeBackupsInnerGetSizeAttributeType(&o.Size, v) } // GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetStatus() (res BackupVolumeBackupsInnerGetStatusRetType) { res, _ = o.GetStatusOk() return @@ -388,22 +470,26 @@ func (o *BackupVolumeBackupsInner) GetStatus() (res BackupVolumeBackupsInnerGetS // GetStatusOk returns a tuple with the Status field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetStatusOk() (ret BackupVolumeBackupsInnerGetStatusRetType, ok bool) { return getBackupVolumeBackupsInnerGetStatusAttributeTypeOk(o.Status) } // HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) HasStatus() bool { _, ok := o.GetStatusOk() return ok } // SetStatus gets a reference to the given string and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) SetStatus(v BackupVolumeBackupsInnerGetStatusRetType) { setBackupVolumeBackupsInnerGetStatusAttributeType(&o.Status, v) } // GetVolumeId returns the VolumeId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetVolumeId() (res BackupVolumeBackupsInnerGetVolumeIdRetType) { res, _ = o.GetVolumeIdOk() return @@ -411,21 +497,25 @@ func (o *BackupVolumeBackupsInner) GetVolumeId() (res BackupVolumeBackupsInnerGe // GetVolumeIdOk returns a tuple with the VolumeId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) GetVolumeIdOk() (ret BackupVolumeBackupsInnerGetVolumeIdRetType, ok bool) { return getBackupVolumeBackupsInnerGetVolumeIdAttributeTypeOk(o.VolumeId) } // HasVolumeId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) HasVolumeId() bool { _, ok := o.GetVolumeIdOk() return ok } // SetVolumeId gets a reference to the given string and assigns it to the VolumeId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *BackupVolumeBackupsInner) SetVolumeId(v BackupVolumeBackupsInnerGetVolumeIdRetType) { setBackupVolumeBackupsInnerGetVolumeIdAttributeType(&o.VolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o BackupVolumeBackupsInner) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getBackupVolumeBackupsInnerGetIdAttributeTypeOk(o.Id); ok { @@ -449,37 +539,45 @@ func (o BackupVolumeBackupsInner) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBackupVolumeBackupsInner struct { value *BackupVolumeBackupsInner isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupVolumeBackupsInner) Get() *BackupVolumeBackupsInner { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupVolumeBackupsInner) Set(val *BackupVolumeBackupsInner) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupVolumeBackupsInner) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBackupVolumeBackupsInner) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBackupVolumeBackupsInner(val *BackupVolumeBackupsInner) *NullableBackupVolumeBackupsInner { return &NullableBackupVolumeBackupsInner{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBackupVolumeBackupsInner) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 fde04416f..7451a8d7f 100644 --- a/services/serverbackup/model_create_backup_payload.go +++ b/services/serverbackup/model_create_backup_payload.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &CreateBackupPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupPayloadGetNameAttributeTypeOk(arg CreateBackupPayloadGetNameAttributeType) (ret CreateBackupPayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getCreateBackupPayloadGetNameAttributeTypeOk(arg CreateBackupPayloadGetName return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupPayloadGetNameAttributeType(arg *CreateBackupPayloadGetNameAttributeType, val CreateBackupPayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetNameRetType = string /* @@ -43,10 +50,16 @@ type CreateBackupPayloadGetNameRetType = string */ // isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetRetentionPeriodAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetRetentionPeriodArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetRetentionPeriodRetType = int64 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupPayloadGetRetentionPeriodAttributeTypeOk(arg CreateBackupPayloadGetRetentionPeriodAttributeType) (ret CreateBackupPayloadGetRetentionPeriodRetType, ok bool) { if arg == nil { return ret, false @@ -54,6 +67,7 @@ func getCreateBackupPayloadGetRetentionPeriodAttributeTypeOk(arg CreateBackupPay return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupPayloadGetRetentionPeriodAttributeType(arg *CreateBackupPayloadGetRetentionPeriodAttributeType, val CreateBackupPayloadGetRetentionPeriodRetType) { *arg = &val } @@ -63,10 +77,16 @@ func setCreateBackupPayloadGetRetentionPeriodAttributeType(arg *CreateBackupPayl */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetVolumeIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetVolumeIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayloadGetVolumeIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupPayloadGetVolumeIdsAttributeTypeOk(arg CreateBackupPayloadGetVolumeIdsAttributeType) (ret CreateBackupPayloadGetVolumeIdsRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +94,13 @@ func getCreateBackupPayloadGetVolumeIdsAttributeTypeOk(arg CreateBackupPayloadGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupPayloadGetVolumeIdsAttributeType(arg *CreateBackupPayloadGetVolumeIdsAttributeType, val CreateBackupPayloadGetVolumeIdsRetType) { *arg = &val } // CreateBackupPayload struct for CreateBackupPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupPayload struct { // Max 255 characters // REQUIRED @@ -90,12 +112,14 @@ type CreateBackupPayload struct { VolumeIds CreateBackupPayloadGetVolumeIdsAttributeType `json:"volumeIds,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateBackupPayload(name CreateBackupPayloadGetNameArgType, retentionPeriod CreateBackupPayloadGetRetentionPeriodArgType) *CreateBackupPayload { this := CreateBackupPayload{} setCreateBackupPayloadGetNameAttributeType(&this.Name, name) @@ -106,12 +130,14 @@ func NewCreateBackupPayload(name CreateBackupPayloadGetNameArgType, retentionPer // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateBackupPayloadWithDefaults() *CreateBackupPayload { this := CreateBackupPayload{} return &this } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetName() (ret CreateBackupPayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -119,16 +145,19 @@ func (o *CreateBackupPayload) GetName() (ret CreateBackupPayloadGetNameRetType) // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetNameOk() (ret CreateBackupPayloadGetNameRetType, ok bool) { return getCreateBackupPayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) SetName(v CreateBackupPayloadGetNameRetType) { setCreateBackupPayloadGetNameAttributeType(&o.Name, v) } // GetRetentionPeriod returns the RetentionPeriod field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetRetentionPeriod() (ret CreateBackupPayloadGetRetentionPeriodRetType) { ret, _ = o.GetRetentionPeriodOk() return ret @@ -136,16 +165,19 @@ func (o *CreateBackupPayload) GetRetentionPeriod() (ret CreateBackupPayloadGetRe // GetRetentionPeriodOk returns a tuple with the RetentionPeriod field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetRetentionPeriodOk() (ret CreateBackupPayloadGetRetentionPeriodRetType, ok bool) { return getCreateBackupPayloadGetRetentionPeriodAttributeTypeOk(o.RetentionPeriod) } // SetRetentionPeriod sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) SetRetentionPeriod(v CreateBackupPayloadGetRetentionPeriodRetType) { setCreateBackupPayloadGetRetentionPeriodAttributeType(&o.RetentionPeriod, v) } // GetVolumeIds returns the VolumeIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetVolumeIds() (res CreateBackupPayloadGetVolumeIdsRetType) { res, _ = o.GetVolumeIdsOk() return @@ -153,21 +185,25 @@ func (o *CreateBackupPayload) GetVolumeIds() (res CreateBackupPayloadGetVolumeId // GetVolumeIdsOk returns a tuple with the VolumeIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) GetVolumeIdsOk() (ret CreateBackupPayloadGetVolumeIdsRetType, ok bool) { return getCreateBackupPayloadGetVolumeIdsAttributeTypeOk(o.VolumeIds) } // HasVolumeIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) HasVolumeIds() bool { _, ok := o.GetVolumeIdsOk() return ok } // SetVolumeIds gets a reference to the given []string and assigns it to the VolumeIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupPayload) SetVolumeIds(v CreateBackupPayloadGetVolumeIdsRetType) { setCreateBackupPayloadGetVolumeIdsAttributeType(&o.VolumeIds, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateBackupPayloadGetNameAttributeTypeOk(o.Name); ok { @@ -182,37 +218,45 @@ func (o CreateBackupPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateBackupPayload struct { value *CreateBackupPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupPayload) Get() *CreateBackupPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateBackupPayload) Set(val *CreateBackupPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateBackupPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateBackupPayload(val *CreateBackupPayload) *NullableCreateBackupPayload { return &NullableCreateBackupPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 63b304522..953a6a35c 100644 --- a/services/serverbackup/model_create_backup_schedule_payload.go +++ b/services/serverbackup/model_create_backup_schedule_payload.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &CreateBackupSchedulePayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetBackupPropertiesAttributeType = *BackupProperties + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetBackupPropertiesArgType = BackupProperties + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetBackupPropertiesRetType = BackupProperties +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupSchedulePayloadGetBackupPropertiesAttributeTypeOk(arg CreateBackupSchedulePayloadGetBackupPropertiesAttributeType) (ret CreateBackupSchedulePayloadGetBackupPropertiesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getCreateBackupSchedulePayloadGetBackupPropertiesAttributeTypeOk(arg Create return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupSchedulePayloadGetBackupPropertiesAttributeType(arg *CreateBackupSchedulePayloadGetBackupPropertiesAttributeType, val CreateBackupSchedulePayloadGetBackupPropertiesRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setCreateBackupSchedulePayloadGetBackupPropertiesAttributeType(arg *CreateB */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadgetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadgetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadgetEnabledRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupSchedulePayloadgetEnabledAttributeTypeOk(arg CreateBackupSchedulePayloadgetEnabledAttributeType) (ret CreateBackupSchedulePayloadgetEnabledRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getCreateBackupSchedulePayloadgetEnabledAttributeTypeOk(arg CreateBackupSch return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupSchedulePayloadgetEnabledAttributeType(arg *CreateBackupSchedulePayloadgetEnabledAttributeType, val CreateBackupSchedulePayloadgetEnabledRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setCreateBackupSchedulePayloadgetEnabledAttributeType(arg *CreateBackupSche */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupSchedulePayloadGetNameAttributeTypeOk(arg CreateBackupSchedulePayloadGetNameAttributeType) (ret CreateBackupSchedulePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getCreateBackupSchedulePayloadGetNameAttributeTypeOk(arg CreateBackupSchedu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupSchedulePayloadGetNameAttributeType(arg *CreateBackupSchedulePayloadGetNameAttributeType, val CreateBackupSchedulePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetNameRetType = string /* @@ -83,8 +104,10 @@ type CreateBackupSchedulePayloadGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetRruleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateBackupSchedulePayloadGetRruleAttributeTypeOk(arg CreateBackupSchedulePayloadGetRruleAttributeType) (ret CreateBackupSchedulePayloadGetRruleRetType, ok bool) { if arg == nil { return ret, false @@ -92,14 +115,19 @@ func getCreateBackupSchedulePayloadGetRruleAttributeTypeOk(arg CreateBackupSched return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateBackupSchedulePayloadGetRruleAttributeType(arg *CreateBackupSchedulePayloadGetRruleAttributeType, val CreateBackupSchedulePayloadGetRruleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetRruleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayloadGetRruleRetType = string // CreateBackupSchedulePayload struct for CreateBackupSchedulePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateBackupSchedulePayload struct { BackupProperties CreateBackupSchedulePayloadGetBackupPropertiesAttributeType `json:"backupProperties,omitempty"` // REQUIRED @@ -112,12 +140,14 @@ type CreateBackupSchedulePayload struct { Rrule CreateBackupSchedulePayloadGetRruleAttributeType `json:"rrule" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateBackupSchedulePayload(enabled CreateBackupSchedulePayloadgetEnabledArgType, name CreateBackupSchedulePayloadGetNameArgType, rrule CreateBackupSchedulePayloadGetRruleArgType) *CreateBackupSchedulePayload { this := CreateBackupSchedulePayload{} setCreateBackupSchedulePayloadgetEnabledAttributeType(&this.Enabled, enabled) @@ -129,12 +159,14 @@ func NewCreateBackupSchedulePayload(enabled CreateBackupSchedulePayloadgetEnable // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateBackupSchedulePayloadWithDefaults() *CreateBackupSchedulePayload { this := CreateBackupSchedulePayload{} return &this } // GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) GetBackupProperties() (res CreateBackupSchedulePayloadGetBackupPropertiesRetType) { res, _ = o.GetBackupPropertiesOk() return @@ -142,22 +174,26 @@ func (o *CreateBackupSchedulePayload) GetBackupProperties() (res CreateBackupSch // GetBackupPropertiesOk returns a tuple with the BackupProperties field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) GetBackupPropertiesOk() (ret CreateBackupSchedulePayloadGetBackupPropertiesRetType, ok bool) { return getCreateBackupSchedulePayloadGetBackupPropertiesAttributeTypeOk(o.BackupProperties) } // HasBackupProperties returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) HasBackupProperties() bool { _, ok := o.GetBackupPropertiesOk() return ok } // SetBackupProperties gets a reference to the given BackupProperties and assigns it to the BackupProperties field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) SetBackupProperties(v CreateBackupSchedulePayloadGetBackupPropertiesRetType) { setCreateBackupSchedulePayloadGetBackupPropertiesAttributeType(&o.BackupProperties, v) } // GetEnabled returns the Enabled field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) GetEnabled() (ret CreateBackupSchedulePayloadgetEnabledRetType) { ret, _ = o.GetEnabledOk() return ret @@ -165,16 +201,19 @@ func (o *CreateBackupSchedulePayload) GetEnabled() (ret CreateBackupSchedulePayl // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) GetEnabledOk() (ret CreateBackupSchedulePayloadgetEnabledRetType, ok bool) { return getCreateBackupSchedulePayloadgetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) SetEnabled(v CreateBackupSchedulePayloadgetEnabledRetType) { setCreateBackupSchedulePayloadgetEnabledAttributeType(&o.Enabled, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) GetName() (ret CreateBackupSchedulePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -182,16 +221,19 @@ func (o *CreateBackupSchedulePayload) GetName() (ret CreateBackupSchedulePayload // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) GetNameOk() (ret CreateBackupSchedulePayloadGetNameRetType, ok bool) { return getCreateBackupSchedulePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) SetName(v CreateBackupSchedulePayloadGetNameRetType) { setCreateBackupSchedulePayloadGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) GetRrule() (ret CreateBackupSchedulePayloadGetRruleRetType) { ret, _ = o.GetRruleOk() return ret @@ -199,15 +241,18 @@ func (o *CreateBackupSchedulePayload) GetRrule() (ret CreateBackupSchedulePayloa // GetRruleOk returns a tuple with the Rrule field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) GetRruleOk() (ret CreateBackupSchedulePayloadGetRruleRetType, ok bool) { return getCreateBackupSchedulePayloadGetRruleAttributeTypeOk(o.Rrule) } // SetRrule sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateBackupSchedulePayload) SetRrule(v CreateBackupSchedulePayloadGetRruleRetType) { setCreateBackupSchedulePayloadGetRruleAttributeType(&o.Rrule, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateBackupSchedulePayloadGetBackupPropertiesAttributeTypeOk(o.BackupProperties); ok { @@ -225,37 +270,45 @@ func (o CreateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateBackupSchedulePayload struct { value *CreateBackupSchedulePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupSchedulePayload) Get() *CreateBackupSchedulePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateBackupSchedulePayload) Set(val *CreateBackupSchedulePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupSchedulePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateBackupSchedulePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateBackupSchedulePayload(val *CreateBackupSchedulePayload) *NullableCreateBackupSchedulePayload { return &NullableCreateBackupSchedulePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateBackupSchedulePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateBackupSchedulePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serverbackup/model_enable_service_resource_payload.go b/services/serverbackup/model_enable_service_resource_payload.go index 74b9d1b9a..ed07e18b9 100644 --- a/services/serverbackup/model_enable_service_resource_payload.go +++ b/services/serverbackup/model_enable_service_resource_payload.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &EnableServiceResourcePayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type EnableServiceResourcePayloadGetBackupPolicyIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getEnableServiceResourcePayloadGetBackupPolicyIdAttributeTypeOk(arg EnableServiceResourcePayloadGetBackupPolicyIdAttributeType) (ret EnableServiceResourcePayloadGetBackupPolicyIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,14 +34,19 @@ func getEnableServiceResourcePayloadGetBackupPolicyIdAttributeTypeOk(arg EnableS return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setEnableServiceResourcePayloadGetBackupPolicyIdAttributeType(arg *EnableServiceResourcePayloadGetBackupPolicyIdAttributeType, val EnableServiceResourcePayloadGetBackupPolicyIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type EnableServiceResourcePayloadGetBackupPolicyIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type EnableServiceResourcePayloadGetBackupPolicyIdRetType = string // EnableServiceResourcePayload struct for EnableServiceResourcePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type EnableServiceResourcePayload struct { BackupPolicyId EnableServiceResourcePayloadGetBackupPolicyIdAttributeType `json:"backupPolicyId,omitempty"` } @@ -47,6 +55,7 @@ type EnableServiceResourcePayload struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewEnableServiceResourcePayload() *EnableServiceResourcePayload { this := EnableServiceResourcePayload{} return &this @@ -55,12 +64,14 @@ func NewEnableServiceResourcePayload() *EnableServiceResourcePayload { // NewEnableServiceResourcePayloadWithDefaults instantiates a new EnableServiceResourcePayload 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewEnableServiceResourcePayloadWithDefaults() *EnableServiceResourcePayload { this := EnableServiceResourcePayload{} return &this } // GetBackupPolicyId returns the BackupPolicyId field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *EnableServiceResourcePayload) GetBackupPolicyId() (res EnableServiceResourcePayloadGetBackupPolicyIdRetType) { res, _ = o.GetBackupPolicyIdOk() return @@ -68,21 +79,25 @@ func (o *EnableServiceResourcePayload) GetBackupPolicyId() (res EnableServiceRes // GetBackupPolicyIdOk returns a tuple with the BackupPolicyId field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *EnableServiceResourcePayload) GetBackupPolicyIdOk() (ret EnableServiceResourcePayloadGetBackupPolicyIdRetType, ok bool) { return getEnableServiceResourcePayloadGetBackupPolicyIdAttributeTypeOk(o.BackupPolicyId) } // HasBackupPolicyId returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *EnableServiceResourcePayload) HasBackupPolicyId() bool { _, ok := o.GetBackupPolicyIdOk() return ok } // SetBackupPolicyId gets a reference to the given string and assigns it to the BackupPolicyId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *EnableServiceResourcePayload) SetBackupPolicyId(v EnableServiceResourcePayloadGetBackupPolicyIdRetType) { setEnableServiceResourcePayloadGetBackupPolicyIdAttributeType(&o.BackupPolicyId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o EnableServiceResourcePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getEnableServiceResourcePayloadGetBackupPolicyIdAttributeTypeOk(o.BackupPolicyId); ok { @@ -91,37 +106,45 @@ func (o EnableServiceResourcePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableEnableServiceResourcePayload struct { value *EnableServiceResourcePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableEnableServiceResourcePayload) Get() *EnableServiceResourcePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableEnableServiceResourcePayload) Set(val *EnableServiceResourcePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableEnableServiceResourcePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableEnableServiceResourcePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableEnableServiceResourcePayload(val *EnableServiceResourcePayload) *NullableEnableServiceResourcePayload { return &NullableEnableServiceResourcePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableEnableServiceResourcePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableEnableServiceResourcePayload) 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 188dc1689..a21a168b2 100644 --- a/services/serverbackup/model_error_response.go +++ b/services/serverbackup/model_error_response.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &ErrorResponse{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorResponseGetMessageAttributeTypeOk(arg ErrorResponseGetMessageAttributeType) (ret ErrorResponseGetMessageRetType, ok bool) { if arg == nil { return ret, false @@ -31,11 +34,15 @@ func getErrorResponseGetMessageAttributeTypeOk(arg ErrorResponseGetMessageAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorResponseGetMessageAttributeType(arg *ErrorResponseGetMessageAttributeType, val ErrorResponseGetMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetMessageRetType = string /* @@ -43,8 +50,10 @@ type ErrorResponseGetMessageRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetStatusAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getErrorResponseGetStatusAttributeTypeOk(arg ErrorResponseGetStatusAttributeType) (ret ErrorResponseGetStatusRetType, ok bool) { if arg == nil { return ret, false @@ -52,14 +61,19 @@ func getErrorResponseGetStatusAttributeTypeOk(arg ErrorResponseGetStatusAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setErrorResponseGetStatusAttributeType(arg *ErrorResponseGetStatusAttributeType, val ErrorResponseGetStatusRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponseGetStatusRetType = string // ErrorResponse struct for ErrorResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ErrorResponse struct { // Details about the error // REQUIRED @@ -69,12 +83,14 @@ type ErrorResponse struct { Status ErrorResponseGetStatusAttributeType `json:"status" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewErrorResponse(message ErrorResponseGetMessageArgType, status ErrorResponseGetStatusArgType) *ErrorResponse { this := ErrorResponse{} setErrorResponseGetMessageAttributeType(&this.Message, message) @@ -85,12 +101,14 @@ func NewErrorResponse(message ErrorResponseGetMessageArgType, status ErrorRespon // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewErrorResponseWithDefaults() *ErrorResponse { this := ErrorResponse{} return &this } // GetMessage returns the Message field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetMessage() (ret ErrorResponseGetMessageRetType) { ret, _ = o.GetMessageOk() return ret @@ -98,16 +116,19 @@ func (o *ErrorResponse) GetMessage() (ret ErrorResponseGetMessageRetType) { // GetMessageOk returns a tuple with the Message field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetMessageOk() (ret ErrorResponseGetMessageRetType, ok bool) { return getErrorResponseGetMessageAttributeTypeOk(o.Message) } // SetMessage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) SetMessage(v ErrorResponseGetMessageRetType) { setErrorResponseGetMessageAttributeType(&o.Message, v) } // GetStatus returns the Status field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetStatus() (ret ErrorResponseGetStatusRetType) { ret, _ = o.GetStatusOk() return ret @@ -115,15 +136,18 @@ func (o *ErrorResponse) GetStatus() (ret ErrorResponseGetStatusRetType) { // GetStatusOk returns a tuple with the Status field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) GetStatusOk() (ret ErrorResponseGetStatusRetType, ok bool) { return getErrorResponseGetStatusAttributeTypeOk(o.Status) } // SetStatus sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ErrorResponse) SetStatus(v ErrorResponseGetStatusRetType) { setErrorResponseGetStatusAttributeType(&o.Status, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ErrorResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getErrorResponseGetMessageAttributeTypeOk(o.Message); ok { @@ -135,37 +159,45 @@ func (o ErrorResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableErrorResponse struct { value *ErrorResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorResponse) Get() *ErrorResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorResponse) Set(val *ErrorResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableErrorResponse(val *ErrorResponse) *NullableErrorResponse { return &NullableErrorResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableErrorResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableErrorResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serverbackup/model_get_backup_policies_response.go b/services/serverbackup/model_get_backup_policies_response.go index ce2cec697..1bfa92a1b 100644 --- a/services/serverbackup/model_get_backup_policies_response.go +++ b/services/serverbackup/model_get_backup_policies_response.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetBackupPoliciesResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupPoliciesResponseGetItemsAttributeType = *[]BackupPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupPoliciesResponseGetItemsArgType = []BackupPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupPoliciesResponseGetItemsRetType = []BackupPolicy +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupPoliciesResponseGetItemsAttributeTypeOk(arg GetBackupPoliciesResponseGetItemsAttributeType) (ret GetBackupPoliciesResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getGetBackupPoliciesResponseGetItemsAttributeTypeOk(arg GetBackupPoliciesRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupPoliciesResponseGetItemsAttributeType(arg *GetBackupPoliciesResponseGetItemsAttributeType, val GetBackupPoliciesResponseGetItemsRetType) { *arg = &val } // GetBackupPoliciesResponse struct for GetBackupPoliciesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupPoliciesResponse struct { Items GetBackupPoliciesResponseGetItemsAttributeType `json:"items,omitempty"` } @@ -46,6 +55,7 @@ type GetBackupPoliciesResponse struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetBackupPoliciesResponse() *GetBackupPoliciesResponse { this := GetBackupPoliciesResponse{} return &this @@ -54,12 +64,14 @@ func NewGetBackupPoliciesResponse() *GetBackupPoliciesResponse { // NewGetBackupPoliciesResponseWithDefaults instantiates a new GetBackupPoliciesResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetBackupPoliciesResponseWithDefaults() *GetBackupPoliciesResponse { this := GetBackupPoliciesResponse{} return &this } // GetItems returns the Items field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupPoliciesResponse) GetItems() (res GetBackupPoliciesResponseGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -67,21 +79,25 @@ func (o *GetBackupPoliciesResponse) GetItems() (res GetBackupPoliciesResponseGet // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupPoliciesResponse) GetItemsOk() (ret GetBackupPoliciesResponseGetItemsRetType, ok bool) { return getGetBackupPoliciesResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupPoliciesResponse) HasItems() bool { _, ok := o.GetItemsOk() return ok } // SetItems gets a reference to the given []BackupPolicy and assigns it to the Items field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupPoliciesResponse) SetItems(v GetBackupPoliciesResponseGetItemsRetType) { setGetBackupPoliciesResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetBackupPoliciesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetBackupPoliciesResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -90,37 +106,45 @@ func (o GetBackupPoliciesResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetBackupPoliciesResponse struct { value *GetBackupPoliciesResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupPoliciesResponse) Get() *GetBackupPoliciesResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupPoliciesResponse) Set(val *GetBackupPoliciesResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupPoliciesResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupPoliciesResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetBackupPoliciesResponse(val *GetBackupPoliciesResponse) *NullableGetBackupPoliciesResponse { return &NullableGetBackupPoliciesResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupPoliciesResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupPoliciesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serverbackup/model_get_backup_schedules_response.go b/services/serverbackup/model_get_backup_schedules_response.go index e46ec2229..0de26a913 100644 --- a/services/serverbackup/model_get_backup_schedules_response.go +++ b/services/serverbackup/model_get_backup_schedules_response.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetBackupSchedulesResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupSchedulesResponseGetItemsAttributeType = *[]BackupSchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupSchedulesResponseGetItemsArgType = []BackupSchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupSchedulesResponseGetItemsRetType = []BackupSchedule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupSchedulesResponseGetItemsAttributeTypeOk(arg GetBackupSchedulesResponseGetItemsAttributeType) (ret GetBackupSchedulesResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getGetBackupSchedulesResponseGetItemsAttributeTypeOk(arg GetBackupSchedules return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupSchedulesResponseGetItemsAttributeType(arg *GetBackupSchedulesResponseGetItemsAttributeType, val GetBackupSchedulesResponseGetItemsRetType) { *arg = &val } // GetBackupSchedulesResponse struct for GetBackupSchedulesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupSchedulesResponse struct { Items GetBackupSchedulesResponseGetItemsAttributeType `json:"items,omitempty"` } @@ -46,6 +55,7 @@ type GetBackupSchedulesResponse struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetBackupSchedulesResponse() *GetBackupSchedulesResponse { this := GetBackupSchedulesResponse{} return &this @@ -54,12 +64,14 @@ func NewGetBackupSchedulesResponse() *GetBackupSchedulesResponse { // NewGetBackupSchedulesResponseWithDefaults instantiates a new GetBackupSchedulesResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetBackupSchedulesResponseWithDefaults() *GetBackupSchedulesResponse { this := GetBackupSchedulesResponse{} return &this } // GetItems returns the Items field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupSchedulesResponse) GetItems() (res GetBackupSchedulesResponseGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -67,21 +79,25 @@ func (o *GetBackupSchedulesResponse) GetItems() (res GetBackupSchedulesResponseG // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupSchedulesResponse) GetItemsOk() (ret GetBackupSchedulesResponseGetItemsRetType, ok bool) { return getGetBackupSchedulesResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupSchedulesResponse) HasItems() bool { _, ok := o.GetItemsOk() return ok } // SetItems gets a reference to the given []BackupSchedule and assigns it to the Items field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupSchedulesResponse) SetItems(v GetBackupSchedulesResponseGetItemsRetType) { setGetBackupSchedulesResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetBackupSchedulesResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetBackupSchedulesResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -90,37 +106,45 @@ func (o GetBackupSchedulesResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetBackupSchedulesResponse struct { value *GetBackupSchedulesResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupSchedulesResponse) Get() *GetBackupSchedulesResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupSchedulesResponse) Set(val *GetBackupSchedulesResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupSchedulesResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupSchedulesResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetBackupSchedulesResponse(val *GetBackupSchedulesResponse) *NullableGetBackupSchedulesResponse { return &NullableGetBackupSchedulesResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupSchedulesResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupSchedulesResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serverbackup/model_get_backup_service_response.go b/services/serverbackup/model_get_backup_service_response.go index 5f5f9ae0a..0d9f260a8 100644 --- a/services/serverbackup/model_get_backup_service_response.go +++ b/services/serverbackup/model_get_backup_service_response.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetBackupServiceResponse{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupServiceResponsegetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupServiceResponsegetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupServiceResponsegetEnabledRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupServiceResponsegetEnabledAttributeTypeOk(arg GetBackupServiceResponsegetEnabledAttributeType) (ret GetBackupServiceResponsegetEnabledRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getGetBackupServiceResponsegetEnabledAttributeTypeOk(arg GetBackupServiceRe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupServiceResponsegetEnabledAttributeType(arg *GetBackupServiceResponsegetEnabledAttributeType, val GetBackupServiceResponsegetEnabledRetType) { *arg = &val } // GetBackupServiceResponse struct for GetBackupServiceResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupServiceResponse struct { Enabled GetBackupServiceResponsegetEnabledAttributeType `json:"enabled,omitempty"` } @@ -46,6 +55,7 @@ type GetBackupServiceResponse struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetBackupServiceResponse() *GetBackupServiceResponse { this := GetBackupServiceResponse{} return &this @@ -54,12 +64,14 @@ func NewGetBackupServiceResponse() *GetBackupServiceResponse { // NewGetBackupServiceResponseWithDefaults instantiates a new GetBackupServiceResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetBackupServiceResponseWithDefaults() *GetBackupServiceResponse { this := GetBackupServiceResponse{} return &this } // GetEnabled returns the Enabled field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupServiceResponse) GetEnabled() (res GetBackupServiceResponsegetEnabledRetType) { res, _ = o.GetEnabledOk() return @@ -67,21 +79,25 @@ func (o *GetBackupServiceResponse) GetEnabled() (res GetBackupServiceResponseget // GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupServiceResponse) GetEnabledOk() (ret GetBackupServiceResponsegetEnabledRetType, ok bool) { return getGetBackupServiceResponsegetEnabledAttributeTypeOk(o.Enabled) } // HasEnabled returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupServiceResponse) HasEnabled() bool { _, ok := o.GetEnabledOk() return ok } // SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupServiceResponse) SetEnabled(v GetBackupServiceResponsegetEnabledRetType) { setGetBackupServiceResponsegetEnabledAttributeType(&o.Enabled, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetBackupServiceResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetBackupServiceResponsegetEnabledAttributeTypeOk(o.Enabled); ok { @@ -90,37 +106,45 @@ func (o GetBackupServiceResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetBackupServiceResponse struct { value *GetBackupServiceResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupServiceResponse) Get() *GetBackupServiceResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupServiceResponse) Set(val *GetBackupServiceResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupServiceResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupServiceResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetBackupServiceResponse(val *GetBackupServiceResponse) *NullableGetBackupServiceResponse { return &NullableGetBackupServiceResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupServiceResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupServiceResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serverbackup/model_get_backups_list_response.go b/services/serverbackup/model_get_backups_list_response.go index 08485aac3..6c664d8a8 100644 --- a/services/serverbackup/model_get_backups_list_response.go +++ b/services/serverbackup/model_get_backups_list_response.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GetBackupsListResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupsListResponseGetItemsAttributeType = *[]Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupsListResponseGetItemsArgType = []Backup + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupsListResponseGetItemsRetType = []Backup +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGetBackupsListResponseGetItemsAttributeTypeOk(arg GetBackupsListResponseGetItemsAttributeType) (ret GetBackupsListResponseGetItemsRetType, ok bool) { if arg == nil { return ret, false @@ -33,11 +40,13 @@ func getGetBackupsListResponseGetItemsAttributeTypeOk(arg GetBackupsListResponse return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGetBackupsListResponseGetItemsAttributeType(arg *GetBackupsListResponseGetItemsAttributeType, val GetBackupsListResponseGetItemsRetType) { *arg = &val } // GetBackupsListResponse struct for GetBackupsListResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetBackupsListResponse struct { Items GetBackupsListResponseGetItemsAttributeType `json:"items,omitempty"` } @@ -46,6 +55,7 @@ type GetBackupsListResponse struct { // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetBackupsListResponse() *GetBackupsListResponse { this := GetBackupsListResponse{} return &this @@ -54,12 +64,14 @@ func NewGetBackupsListResponse() *GetBackupsListResponse { // NewGetBackupsListResponseWithDefaults instantiates a new GetBackupsListResponse 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewGetBackupsListResponseWithDefaults() *GetBackupsListResponse { this := GetBackupsListResponse{} return &this } // GetItems returns the Items field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupsListResponse) GetItems() (res GetBackupsListResponseGetItemsRetType) { res, _ = o.GetItemsOk() return @@ -67,21 +79,25 @@ func (o *GetBackupsListResponse) GetItems() (res GetBackupsListResponseGetItemsR // GetItemsOk returns a tuple with the Items field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupsListResponse) GetItemsOk() (ret GetBackupsListResponseGetItemsRetType, ok bool) { return getGetBackupsListResponseGetItemsAttributeTypeOk(o.Items) } // HasItems returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupsListResponse) HasItems() bool { _, ok := o.GetItemsOk() return ok } // SetItems gets a reference to the given []Backup and assigns it to the Items field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GetBackupsListResponse) SetItems(v GetBackupsListResponseGetItemsRetType) { setGetBackupsListResponseGetItemsAttributeType(&o.Items, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GetBackupsListResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGetBackupsListResponseGetItemsAttributeTypeOk(o.Items); ok { @@ -90,37 +106,45 @@ func (o GetBackupsListResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGetBackupsListResponse struct { value *GetBackupsListResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupsListResponse) Get() *GetBackupsListResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupsListResponse) Set(val *GetBackupsListResponse) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupsListResponse) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupsListResponse) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableGetBackupsListResponse(val *GetBackupsListResponse) *NullableGetBackupsListResponse { return &NullableGetBackupsListResponse{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGetBackupsListResponse) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGetBackupsListResponse) 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 2dfdf61c1..bb0e99bd7 100644 --- a/services/serverbackup/model_restore_backup_payload.go +++ b/services/serverbackup/model_restore_backup_payload.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &RestoreBackupPayload{} */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupPayloadgetStartServerAfterRestoreAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupPayloadgetStartServerAfterRestoreArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupPayloadgetStartServerAfterRestoreRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRestoreBackupPayloadgetStartServerAfterRestoreAttributeTypeOk(arg RestoreBackupPayloadgetStartServerAfterRestoreAttributeType) (ret RestoreBackupPayloadgetStartServerAfterRestoreRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getRestoreBackupPayloadgetStartServerAfterRestoreAttributeTypeOk(arg Restor return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRestoreBackupPayloadgetStartServerAfterRestoreAttributeType(arg *RestoreBackupPayloadgetStartServerAfterRestoreAttributeType, val RestoreBackupPayloadgetStartServerAfterRestoreRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setRestoreBackupPayloadgetStartServerAfterRestoreAttributeType(arg *Restore */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupPayloadGetVolumeIdsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupPayloadGetVolumeIdsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupPayloadGetVolumeIdsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRestoreBackupPayloadGetVolumeIdsAttributeTypeOk(arg RestoreBackupPayloadGetVolumeIdsAttributeType) (ret RestoreBackupPayloadGetVolumeIdsRetType, ok bool) { if arg == nil { return ret, false @@ -53,23 +67,27 @@ func getRestoreBackupPayloadGetVolumeIdsAttributeTypeOk(arg RestoreBackupPayload return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRestoreBackupPayloadGetVolumeIdsAttributeType(arg *RestoreBackupPayloadGetVolumeIdsAttributeType, val RestoreBackupPayloadGetVolumeIdsRetType) { *arg = &val } // RestoreBackupPayload struct for RestoreBackupPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreBackupPayload struct { // REQUIRED StartServerAfterRestore RestoreBackupPayloadgetStartServerAfterRestoreAttributeType `json:"startServerAfterRestore" required:"true"` VolumeIds RestoreBackupPayloadGetVolumeIdsAttributeType `json:"volumeIds,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRestoreBackupPayload(startServerAfterRestore RestoreBackupPayloadgetStartServerAfterRestoreArgType) *RestoreBackupPayload { this := RestoreBackupPayload{} setRestoreBackupPayloadgetStartServerAfterRestoreAttributeType(&this.StartServerAfterRestore, startServerAfterRestore) @@ -79,12 +97,14 @@ func NewRestoreBackupPayload(startServerAfterRestore RestoreBackupPayloadgetStar // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRestoreBackupPayloadWithDefaults() *RestoreBackupPayload { this := RestoreBackupPayload{} return &this } // GetStartServerAfterRestore returns the StartServerAfterRestore field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreBackupPayload) GetStartServerAfterRestore() (ret RestoreBackupPayloadgetStartServerAfterRestoreRetType) { ret, _ = o.GetStartServerAfterRestoreOk() return ret @@ -92,16 +112,19 @@ func (o *RestoreBackupPayload) GetStartServerAfterRestore() (ret RestoreBackupPa // GetStartServerAfterRestoreOk returns a tuple with the StartServerAfterRestore field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreBackupPayload) GetStartServerAfterRestoreOk() (ret RestoreBackupPayloadgetStartServerAfterRestoreRetType, ok bool) { return getRestoreBackupPayloadgetStartServerAfterRestoreAttributeTypeOk(o.StartServerAfterRestore) } // SetStartServerAfterRestore sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreBackupPayload) SetStartServerAfterRestore(v RestoreBackupPayloadgetStartServerAfterRestoreRetType) { setRestoreBackupPayloadgetStartServerAfterRestoreAttributeType(&o.StartServerAfterRestore, v) } // GetVolumeIds returns the VolumeIds field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreBackupPayload) GetVolumeIds() (res RestoreBackupPayloadGetVolumeIdsRetType) { res, _ = o.GetVolumeIdsOk() return @@ -109,21 +132,25 @@ func (o *RestoreBackupPayload) GetVolumeIds() (res RestoreBackupPayloadGetVolume // GetVolumeIdsOk returns a tuple with the VolumeIds field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreBackupPayload) GetVolumeIdsOk() (ret RestoreBackupPayloadGetVolumeIdsRetType, ok bool) { return getRestoreBackupPayloadGetVolumeIdsAttributeTypeOk(o.VolumeIds) } // HasVolumeIds returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreBackupPayload) HasVolumeIds() bool { _, ok := o.GetVolumeIdsOk() return ok } // SetVolumeIds gets a reference to the given []string and assigns it to the VolumeIds field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreBackupPayload) SetVolumeIds(v RestoreBackupPayloadGetVolumeIdsRetType) { setRestoreBackupPayloadGetVolumeIdsAttributeType(&o.VolumeIds, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RestoreBackupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRestoreBackupPayloadgetStartServerAfterRestoreAttributeTypeOk(o.StartServerAfterRestore); ok { @@ -135,37 +162,45 @@ func (o RestoreBackupPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRestoreBackupPayload struct { value *RestoreBackupPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRestoreBackupPayload) Get() *RestoreBackupPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRestoreBackupPayload) Set(val *RestoreBackupPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRestoreBackupPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRestoreBackupPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRestoreBackupPayload(val *RestoreBackupPayload) *NullableRestoreBackupPayload { return &NullableRestoreBackupPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRestoreBackupPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 f67f64852..3184e7a27 100644 --- a/services/serverbackup/model_restore_volume_backup_payload.go +++ b/services/serverbackup/model_restore_volume_backup_payload.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,8 +23,10 @@ var _ MappedNullable = &RestoreVolumeBackupPayload{} */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getRestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeTypeOk(arg RestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeType) (ret RestoreVolumeBackupPayloadGetRestoreVolumeIdRetType, ok bool) { if arg == nil { return ret, false @@ -31,25 +34,32 @@ func getRestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeTypeOk(arg RestoreV return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setRestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeType(arg *RestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeType, val RestoreVolumeBackupPayloadGetRestoreVolumeIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreVolumeBackupPayloadGetRestoreVolumeIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreVolumeBackupPayloadGetRestoreVolumeIdRetType = string // RestoreVolumeBackupPayload struct for RestoreVolumeBackupPayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type RestoreVolumeBackupPayload struct { // REQUIRED RestoreVolumeId RestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeType `json:"restoreVolumeId" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRestoreVolumeBackupPayload(restoreVolumeId RestoreVolumeBackupPayloadGetRestoreVolumeIdArgType) *RestoreVolumeBackupPayload { this := RestoreVolumeBackupPayload{} setRestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeType(&this.RestoreVolumeId, restoreVolumeId) @@ -59,12 +69,14 @@ func NewRestoreVolumeBackupPayload(restoreVolumeId RestoreVolumeBackupPayloadGet // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewRestoreVolumeBackupPayloadWithDefaults() *RestoreVolumeBackupPayload { this := RestoreVolumeBackupPayload{} return &this } // GetRestoreVolumeId returns the RestoreVolumeId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreVolumeBackupPayload) GetRestoreVolumeId() (ret RestoreVolumeBackupPayloadGetRestoreVolumeIdRetType) { ret, _ = o.GetRestoreVolumeIdOk() return ret @@ -72,15 +84,18 @@ func (o *RestoreVolumeBackupPayload) GetRestoreVolumeId() (ret RestoreVolumeBack // GetRestoreVolumeIdOk returns a tuple with the RestoreVolumeId field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreVolumeBackupPayload) GetRestoreVolumeIdOk() (ret RestoreVolumeBackupPayloadGetRestoreVolumeIdRetType, ok bool) { return getRestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeTypeOk(o.RestoreVolumeId) } // SetRestoreVolumeId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *RestoreVolumeBackupPayload) SetRestoreVolumeId(v RestoreVolumeBackupPayloadGetRestoreVolumeIdRetType) { setRestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeType(&o.RestoreVolumeId, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o RestoreVolumeBackupPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getRestoreVolumeBackupPayloadGetRestoreVolumeIdAttributeTypeOk(o.RestoreVolumeId); ok { @@ -89,37 +104,45 @@ func (o RestoreVolumeBackupPayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableRestoreVolumeBackupPayload struct { value *RestoreVolumeBackupPayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRestoreVolumeBackupPayload) Get() *RestoreVolumeBackupPayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRestoreVolumeBackupPayload) Set(val *RestoreVolumeBackupPayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRestoreVolumeBackupPayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableRestoreVolumeBackupPayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableRestoreVolumeBackupPayload(val *RestoreVolumeBackupPayload) *NullableRestoreVolumeBackupPayload { return &NullableRestoreVolumeBackupPayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableRestoreVolumeBackupPayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 7989368f1..5f4bd3eba 100644 --- a/services/serverbackup/model_update_backup_schedule_payload.go +++ b/services/serverbackup/model_update_backup_schedule_payload.go @@ -8,6 +8,7 @@ API version: 2.0 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead package serverbackup import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &UpdateBackupSchedulePayload{} */ // isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetBackupPropertiesAttributeType = *BackupProperties + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetBackupPropertiesArgType = BackupProperties + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetBackupPropertiesRetType = BackupProperties +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupSchedulePayloadGetBackupPropertiesAttributeTypeOk(arg UpdateBackupSchedulePayloadGetBackupPropertiesAttributeType) (ret UpdateBackupSchedulePayloadGetBackupPropertiesRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getUpdateBackupSchedulePayloadGetBackupPropertiesAttributeTypeOk(arg Update return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupSchedulePayloadGetBackupPropertiesAttributeType(arg *UpdateBackupSchedulePayloadGetBackupPropertiesAttributeType, val UpdateBackupSchedulePayloadGetBackupPropertiesRetType) { *arg = &val } @@ -42,10 +50,16 @@ func setUpdateBackupSchedulePayloadGetBackupPropertiesAttributeType(arg *UpdateB */ // isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadgetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadgetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadgetEnabledRetType = bool +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupSchedulePayloadgetEnabledAttributeTypeOk(arg UpdateBackupSchedulePayloadgetEnabledAttributeType) (ret UpdateBackupSchedulePayloadgetEnabledRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +67,7 @@ func getUpdateBackupSchedulePayloadgetEnabledAttributeTypeOk(arg UpdateBackupSch return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupSchedulePayloadgetEnabledAttributeType(arg *UpdateBackupSchedulePayloadgetEnabledAttributeType, val UpdateBackupSchedulePayloadgetEnabledRetType) { *arg = &val } @@ -62,8 +77,10 @@ func setUpdateBackupSchedulePayloadgetEnabledAttributeType(arg *UpdateBackupSche */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupSchedulePayloadGetNameAttributeTypeOk(arg UpdateBackupSchedulePayloadGetNameAttributeType) (ret UpdateBackupSchedulePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -71,11 +88,15 @@ func getUpdateBackupSchedulePayloadGetNameAttributeTypeOk(arg UpdateBackupSchedu return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupSchedulePayloadGetNameAttributeType(arg *UpdateBackupSchedulePayloadGetNameAttributeType, val UpdateBackupSchedulePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetNameRetType = string /* @@ -83,8 +104,10 @@ type UpdateBackupSchedulePayloadGetNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetRruleAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getUpdateBackupSchedulePayloadGetRruleAttributeTypeOk(arg UpdateBackupSchedulePayloadGetRruleAttributeType) (ret UpdateBackupSchedulePayloadGetRruleRetType, ok bool) { if arg == nil { return ret, false @@ -92,14 +115,19 @@ func getUpdateBackupSchedulePayloadGetRruleAttributeTypeOk(arg UpdateBackupSched return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setUpdateBackupSchedulePayloadGetRruleAttributeType(arg *UpdateBackupSchedulePayloadGetRruleAttributeType, val UpdateBackupSchedulePayloadGetRruleRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetRruleArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayloadGetRruleRetType = string // UpdateBackupSchedulePayload struct for UpdateBackupSchedulePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateBackupSchedulePayload struct { BackupProperties UpdateBackupSchedulePayloadGetBackupPropertiesAttributeType `json:"backupProperties,omitempty"` // REQUIRED @@ -112,12 +140,14 @@ type UpdateBackupSchedulePayload struct { Rrule UpdateBackupSchedulePayloadGetRruleAttributeType `json:"rrule" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateBackupSchedulePayload(enabled UpdateBackupSchedulePayloadgetEnabledArgType, name UpdateBackupSchedulePayloadGetNameArgType, rrule UpdateBackupSchedulePayloadGetRruleArgType) *UpdateBackupSchedulePayload { this := UpdateBackupSchedulePayload{} setUpdateBackupSchedulePayloadgetEnabledAttributeType(&this.Enabled, enabled) @@ -129,12 +159,14 @@ func NewUpdateBackupSchedulePayload(enabled UpdateBackupSchedulePayloadgetEnable // 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 +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewUpdateBackupSchedulePayloadWithDefaults() *UpdateBackupSchedulePayload { this := UpdateBackupSchedulePayload{} return &this } // GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetBackupProperties() (res UpdateBackupSchedulePayloadGetBackupPropertiesRetType) { res, _ = o.GetBackupPropertiesOk() return @@ -142,22 +174,26 @@ func (o *UpdateBackupSchedulePayload) GetBackupProperties() (res UpdateBackupSch // GetBackupPropertiesOk returns a tuple with the BackupProperties field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetBackupPropertiesOk() (ret UpdateBackupSchedulePayloadGetBackupPropertiesRetType, ok bool) { return getUpdateBackupSchedulePayloadGetBackupPropertiesAttributeTypeOk(o.BackupProperties) } // HasBackupProperties returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) HasBackupProperties() bool { _, ok := o.GetBackupPropertiesOk() return ok } // SetBackupProperties gets a reference to the given BackupProperties and assigns it to the BackupProperties field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) SetBackupProperties(v UpdateBackupSchedulePayloadGetBackupPropertiesRetType) { setUpdateBackupSchedulePayloadGetBackupPropertiesAttributeType(&o.BackupProperties, v) } // GetEnabled returns the Enabled field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetEnabled() (ret UpdateBackupSchedulePayloadgetEnabledRetType) { ret, _ = o.GetEnabledOk() return ret @@ -165,16 +201,19 @@ func (o *UpdateBackupSchedulePayload) GetEnabled() (ret UpdateBackupSchedulePayl // GetEnabledOk returns a tuple with the Enabled field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetEnabledOk() (ret UpdateBackupSchedulePayloadgetEnabledRetType, ok bool) { return getUpdateBackupSchedulePayloadgetEnabledAttributeTypeOk(o.Enabled) } // SetEnabled sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) SetEnabled(v UpdateBackupSchedulePayloadgetEnabledRetType) { setUpdateBackupSchedulePayloadgetEnabledAttributeType(&o.Enabled, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetName() (ret UpdateBackupSchedulePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -182,16 +221,19 @@ func (o *UpdateBackupSchedulePayload) GetName() (ret UpdateBackupSchedulePayload // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetNameOk() (ret UpdateBackupSchedulePayloadGetNameRetType, ok bool) { return getUpdateBackupSchedulePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) SetName(v UpdateBackupSchedulePayloadGetNameRetType) { setUpdateBackupSchedulePayloadGetNameAttributeType(&o.Name, v) } // GetRrule returns the Rrule field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetRrule() (ret UpdateBackupSchedulePayloadGetRruleRetType) { ret, _ = o.GetRruleOk() return ret @@ -199,15 +241,18 @@ func (o *UpdateBackupSchedulePayload) GetRrule() (ret UpdateBackupSchedulePayloa // GetRruleOk returns a tuple with the Rrule field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) GetRruleOk() (ret UpdateBackupSchedulePayloadGetRruleRetType, ok bool) { return getUpdateBackupSchedulePayloadGetRruleAttributeTypeOk(o.Rrule) } // SetRrule sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *UpdateBackupSchedulePayload) SetRrule(v UpdateBackupSchedulePayloadGetRruleRetType) { setUpdateBackupSchedulePayloadGetRruleAttributeType(&o.Rrule, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getUpdateBackupSchedulePayloadGetBackupPropertiesAttributeTypeOk(o.BackupProperties); ok { @@ -225,37 +270,45 @@ func (o UpdateBackupSchedulePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableUpdateBackupSchedulePayload struct { value *UpdateBackupSchedulePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateBackupSchedulePayload) Get() *UpdateBackupSchedulePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateBackupSchedulePayload) Set(val *UpdateBackupSchedulePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateBackupSchedulePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateBackupSchedulePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableUpdateBackupSchedulePayload(val *UpdateBackupSchedulePayload) *NullableUpdateBackupSchedulePayload { return &NullableUpdateBackupSchedulePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableUpdateBackupSchedulePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableUpdateBackupSchedulePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/serverbackup/oas_commit b/services/serverbackup/oas_commit index 588ee296b..bf3189995 100644 --- a/services/serverbackup/oas_commit +++ b/services/serverbackup/oas_commit @@ -1 +1 @@ -964ac4ce34f0b6417f2496a1d48585c4926dee3a +3e9c109388be83b40c16d8cb5ab146aa314eb6e8 diff --git a/services/serverbackup/utils.go b/services/serverbackup/utils.go index 4beedf09e..07e63d073 100644 --- a/services/serverbackup/utils.go +++ b/services/serverbackup/utils.go @@ -18,341 +18,419 @@ import ( ) // PtrBool is a helper routine that returns a pointer to given boolean value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrBool(v bool) *bool { return &v } // PtrInt is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt(v int) *int { return &v } // PtrInt32 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt32(v int32) *int32 { return &v } // PtrInt64 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt64(v int64) *int64 { return &v } // PtrFloat32 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat32(v float32) *float32 { return &v } // PtrFloat64 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat64(v float64) *float64 { return &v } // PtrString is a helper routine that returns a pointer to given string value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrTime(v time.Time) *time.Time { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableValue[T any] struct { value *T isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) Get() *T { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Set(val *T) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBool struct { value *bool isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) Get() *bool { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Set(val *bool) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBool(val *bool) *NullableBool { return &NullableBool{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt struct { value *int isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) Get() *int { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Set(val *int) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt(val *int) *NullableInt { return &NullableInt{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt32 struct { value *int32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) Get() *int32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Set(val *int32) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt32(val *int32) *NullableInt32 { return &NullableInt32{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt64 struct { value *int64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) Get() *int64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Set(val *int64) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt64(val *int64) *NullableInt64 { return &NullableInt64{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat32 struct { value *float32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) Get() *float32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Set(val *float32) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFloat32(val *float32) *NullableFloat32 { return &NullableFloat32{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat64 struct { value *float64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) Get() *float64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Set(val *float64) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFloat64(val *float64) *NullableFloat64 { return &NullableFloat64{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableString struct { value *string isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) Get() *string { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Set(val *string) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableString(val *string) *NullableString { return &NullableString{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableTime struct { value *time.Time isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) Get() *time.Time { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Set(val *time.Time) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableTime(val *time.Time) *NullableTime { return &NullableTime{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) MarshalJSON() ([]byte, error) { return v.value.MarshalJSON() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } // IsNil checks if an input is nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func IsNil(i interface{}) bool { if i == nil { return true @@ -369,13 +447,16 @@ func IsNil(i interface{}) bool { return false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MappedNullable interface { ToMap() (map[string]interface{}, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // randString returns a random string with a specified length. It panics if n <= 0. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func randString(n int) string { b := make([]byte, n) for i := range b { diff --git a/services/serverbackup/v1api/api_default.go b/services/serverbackup/v1api/api_default.go new file mode 100644 index 000000000..e1119b531 --- /dev/null +++ b/services/serverbackup/v1api/api_default.go @@ -0,0 +1,2394 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateBackup create backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, serverId string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return BackupJob + CreateBackupExecute(r ApiCreateBackupRequest) (*BackupJob, error) + + /* + CreateBackupSchedule create backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiCreateBackupScheduleRequest + */ + CreateBackupSchedule(ctx context.Context, projectId string, serverId string) ApiCreateBackupScheduleRequest + + // CreateBackupScheduleExecute executes the request + // @return BackupSchedule + CreateBackupScheduleExecute(r ApiCreateBackupScheduleRequest) (*BackupSchedule, error) + + /* + DeleteBackup delete backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @return ApiDeleteBackupRequest + */ + DeleteBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiDeleteBackupRequest + + // DeleteBackupExecute executes the request + DeleteBackupExecute(r ApiDeleteBackupRequest) error + + /* + DeleteBackupSchedule delete backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupScheduleId backup schedule id + @return ApiDeleteBackupScheduleRequest + */ + DeleteBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiDeleteBackupScheduleRequest + + // DeleteBackupScheduleExecute executes the request + DeleteBackupScheduleExecute(r ApiDeleteBackupScheduleRequest) error + + /* + DeleteVolumeBackup delete volume backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @param volumeBackupId id of the volume backup + @return ApiDeleteVolumeBackupRequest + */ + DeleteVolumeBackup(ctx context.Context, projectId string, serverId string, backupId string, volumeBackupId string) ApiDeleteVolumeBackupRequest + + // DeleteVolumeBackupExecute executes the request + DeleteVolumeBackupExecute(r ApiDeleteVolumeBackupRequest) error + + /* + DisableService disable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiDisableServiceRequest + + Deprecated + */ + DisableService(ctx context.Context, projectId string, serverId string) ApiDisableServiceRequest + + // DisableServiceExecute executes the request + // Deprecated + DisableServiceExecute(r ApiDisableServiceRequest) error + + /* + DisableServiceResource disable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiDisableServiceResourceRequest + */ + DisableServiceResource(ctx context.Context, projectId string, serverId string) ApiDisableServiceResourceRequest + + // DisableServiceResourceExecute executes the request + DisableServiceResourceExecute(r ApiDisableServiceResourceRequest) error + + /* + EnableService enable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiEnableServiceRequest + + Deprecated + */ + EnableService(ctx context.Context, projectId string, serverId string) ApiEnableServiceRequest + + // EnableServiceExecute executes the request + // Deprecated + EnableServiceExecute(r ApiEnableServiceRequest) error + + /* + EnableServiceResource enable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiEnableServiceResourceRequest + */ + EnableServiceResource(ctx context.Context, projectId string, serverId string) ApiEnableServiceResourceRequest + + // EnableServiceResourceExecute executes the request + EnableServiceResourceExecute(r ApiEnableServiceResourceRequest) error + + /* + GetBackup get backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @return ApiGetBackupRequest + */ + GetBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return Backup + GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) + + /* + GetBackupSchedule get single backup schedule details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupScheduleId backup schedule id + @return ApiGetBackupScheduleRequest + */ + GetBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiGetBackupScheduleRequest + + // GetBackupScheduleExecute executes the request + // @return BackupSchedule + GetBackupScheduleExecute(r ApiGetBackupScheduleRequest) (*BackupSchedule, error) + + /* + GetServiceResource get backup service details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiGetServiceResourceRequest + */ + GetServiceResource(ctx context.Context, projectId string, serverId string) ApiGetServiceResourceRequest + + // GetServiceResourceExecute executes the request + // @return GetBackupServiceResponse + GetServiceResourceExecute(r ApiGetServiceResourceRequest) (*GetBackupServiceResponse, error) + + /* + ListBackupPolicies get list of backup policies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @return ApiListBackupPoliciesRequest + */ + ListBackupPolicies(ctx context.Context, projectId string) ApiListBackupPoliciesRequest + + // ListBackupPoliciesExecute executes the request + // @return GetBackupPoliciesResponse + ListBackupPoliciesExecute(r ApiListBackupPoliciesRequest) (*GetBackupPoliciesResponse, error) + + /* + ListBackupSchedules get list of backup schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiListBackupSchedulesRequest + */ + ListBackupSchedules(ctx context.Context, projectId string, serverId string) ApiListBackupSchedulesRequest + + // ListBackupSchedulesExecute executes the request + // @return GetBackupSchedulesResponse + ListBackupSchedulesExecute(r ApiListBackupSchedulesRequest) (*GetBackupSchedulesResponse, error) + + /* + ListBackups get list of backups + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, serverId string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return GetBackupsListResponse + ListBackupsExecute(r ApiListBackupsRequest) (*GetBackupsListResponse, error) + + /* + RestoreBackup trigger restore of the requested backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @return ApiRestoreBackupRequest + */ + RestoreBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiRestoreBackupRequest + + // RestoreBackupExecute executes the request + RestoreBackupExecute(r ApiRestoreBackupRequest) error + + /* + RestoreVolumeBackup trigger restore of the requested volume backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @param volumeBackupId id of the volume backup + @return ApiRestoreVolumeBackupRequest + */ + RestoreVolumeBackup(ctx context.Context, projectId string, serverId string, backupId string, volumeBackupId string) ApiRestoreVolumeBackupRequest + + // RestoreVolumeBackupExecute executes the request + RestoreVolumeBackupExecute(r ApiRestoreVolumeBackupRequest) error + + /* + UpdateBackupSchedule update backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupScheduleId backup schedule id + @return ApiUpdateBackupScheduleRequest + */ + UpdateBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiUpdateBackupScheduleRequest + + // UpdateBackupScheduleExecute executes the request + // @return BackupSchedule + UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) (*BackupSchedule, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + createBackupPayload *CreateBackupPayload +} + +func (r ApiCreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { + r.createBackupPayload = &createBackupPayload + return r +} + +func (r ApiCreateBackupRequest) Execute() (*BackupJob, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup create backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, serverId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return BackupJob +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) (*BackupJob, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupJob + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + createBackupSchedulePayload *CreateBackupSchedulePayload +} + +func (r ApiCreateBackupScheduleRequest) CreateBackupSchedulePayload(createBackupSchedulePayload CreateBackupSchedulePayload) ApiCreateBackupScheduleRequest { + r.createBackupSchedulePayload = &createBackupSchedulePayload + return r +} + +func (r ApiCreateBackupScheduleRequest) Execute() (*BackupSchedule, error) { + return r.ApiService.CreateBackupScheduleExecute(r) +} + +/* +CreateBackupSchedule create backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiCreateBackupScheduleRequest +*/ +func (a *DefaultAPIService) CreateBackupSchedule(ctx context.Context, projectId string, serverId string) ApiCreateBackupScheduleRequest { + return ApiCreateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return BackupSchedule +func (a *DefaultAPIService) CreateBackupScheduleExecute(r ApiCreateBackupScheduleRequest) (*BackupSchedule, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupSchedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackupSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backup-schedules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createBackupSchedulePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + backupId string + force *bool +} + +// force delete the backup +func (r ApiDeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { + r.force = &force + return r +} + +func (r ApiDeleteBackupRequest) Execute() error { + return r.ApiService.DeleteBackupExecute(r) +} + +/* +DeleteBackup delete backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @return ApiDeleteBackupRequest +*/ +func (a *DefaultAPIService) DeleteBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiDeleteBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + backupScheduleId string +} + +func (r ApiDeleteBackupScheduleRequest) Execute() error { + return r.ApiService.DeleteBackupScheduleExecute(r) +} + +/* +DeleteBackupSchedule delete backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupScheduleId backup schedule id + @return ApiDeleteBackupScheduleRequest +*/ +func (a *DefaultAPIService) DeleteBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiDeleteBackupScheduleRequest { + return ApiDeleteBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupScheduleId: backupScheduleId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteBackupScheduleExecute(r ApiDeleteBackupScheduleRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteBackupSchedule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backup-schedules/{backupScheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupScheduleId"+"}", url.PathEscape(parameterValueToString(r.backupScheduleId, "backupScheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiDeleteVolumeBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + backupId string + volumeBackupId string + force *bool +} + +// Force delete the volume backup +func (r ApiDeleteVolumeBackupRequest) Force(force bool) ApiDeleteVolumeBackupRequest { + r.force = &force + return r +} + +func (r ApiDeleteVolumeBackupRequest) Execute() error { + return r.ApiService.DeleteVolumeBackupExecute(r) +} + +/* +DeleteVolumeBackup delete volume backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @param volumeBackupId id of the volume backup + @return ApiDeleteVolumeBackupRequest +*/ +func (a *DefaultAPIService) DeleteVolumeBackup(ctx context.Context, projectId string, serverId string, backupId string, volumeBackupId string) ApiDeleteVolumeBackupRequest { + return ApiDeleteVolumeBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + volumeBackupId: volumeBackupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteVolumeBackupExecute(r ApiDeleteVolumeBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVolumeBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backups/{backupId}/volume-backups/{volumeBackupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeBackupId"+"}", url.PathEscape(parameterValueToString(r.volumeBackupId, "volumeBackupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiDisableServiceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiDisableServiceRequest) Execute() error { + return r.ApiService.DisableServiceExecute(r) +} + +/* +DisableService disable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiDisableServiceRequest + +Deprecated +*/ +func (a *DefaultAPIService) DisableService(ctx context.Context, projectId string, serverId string) ApiDisableServiceRequest { + return ApiDisableServiceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) DisableServiceExecute(r ApiDisableServiceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DisableService") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiDisableServiceResourceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiDisableServiceResourceRequest) Execute() error { + return r.ApiService.DisableServiceResourceExecute(r) +} + +/* +DisableServiceResource disable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiDisableServiceResourceRequest +*/ +func (a *DefaultAPIService) DisableServiceResource(ctx context.Context, projectId string, serverId string) ApiDisableServiceResourceRequest { + return ApiDisableServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DisableServiceResourceExecute(r ApiDisableServiceResourceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DisableServiceResource") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiEnableServiceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + enableServicePayload *EnableServicePayload +} + +func (r ApiEnableServiceRequest) EnableServicePayload(enableServicePayload EnableServicePayload) ApiEnableServiceRequest { + r.enableServicePayload = &enableServicePayload + return r +} + +func (r ApiEnableServiceRequest) Execute() error { + return r.ApiService.EnableServiceExecute(r) +} + +/* +EnableService enable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiEnableServiceRequest + +Deprecated +*/ +func (a *DefaultAPIService) EnableService(ctx context.Context, projectId string, serverId string) ApiEnableServiceRequest { + return ApiEnableServiceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// Deprecated +func (a *DefaultAPIService) EnableServiceExecute(r ApiEnableServiceRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.EnableService") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.enableServicePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiEnableServiceResourceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + enableServiceResourcePayload *EnableServiceResourcePayload +} + +func (r ApiEnableServiceResourceRequest) EnableServiceResourcePayload(enableServiceResourcePayload EnableServiceResourcePayload) ApiEnableServiceResourceRequest { + r.enableServiceResourcePayload = &enableServiceResourcePayload + return r +} + +func (r ApiEnableServiceResourceRequest) Execute() error { + return r.ApiService.EnableServiceResourceExecute(r) +} + +/* +EnableServiceResource enable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiEnableServiceResourceRequest +*/ +func (a *DefaultAPIService) EnableServiceResource(ctx context.Context, projectId string, serverId string) ApiEnableServiceResourceRequest { + return ApiEnableServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) EnableServiceResourceExecute(r ApiEnableServiceResourceRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.EnableServiceResource") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.enableServiceResourcePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*Backup, error) { + return r.ApiService.GetBackupExecute(r) +} + +/* +GetBackup get backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @return ApiGetBackupRequest +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return Backup +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + backupScheduleId string +} + +func (r ApiGetBackupScheduleRequest) Execute() (*BackupSchedule, error) { + return r.ApiService.GetBackupScheduleExecute(r) +} + +/* +GetBackupSchedule get single backup schedule details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupScheduleId backup schedule id + @return ApiGetBackupScheduleRequest +*/ +func (a *DefaultAPIService) GetBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiGetBackupScheduleRequest { + return ApiGetBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupScheduleId: backupScheduleId, + } +} + +// Execute executes the request +// +// @return BackupSchedule +func (a *DefaultAPIService) GetBackupScheduleExecute(r ApiGetBackupScheduleRequest) (*BackupSchedule, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupSchedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackupSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backup-schedules/{backupScheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupScheduleId"+"}", url.PathEscape(parameterValueToString(r.backupScheduleId, "backupScheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServiceResourceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiGetServiceResourceRequest) Execute() (*GetBackupServiceResponse, error) { + return r.ApiService.GetServiceResourceExecute(r) +} + +/* +GetServiceResource get backup service details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiGetServiceResourceRequest +*/ +func (a *DefaultAPIService) GetServiceResource(ctx context.Context, projectId string, serverId string) ApiGetServiceResourceRequest { + return ApiGetServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return GetBackupServiceResponse +func (a *DefaultAPIService) GetServiceResourceExecute(r ApiGetServiceResourceRequest) (*GetBackupServiceResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupServiceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServiceResource") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/service" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupPoliciesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListBackupPoliciesRequest) Execute() (*GetBackupPoliciesResponse, error) { + return r.ApiService.ListBackupPoliciesExecute(r) +} + +/* +ListBackupPolicies get list of backup policies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @return ApiListBackupPoliciesRequest +*/ +func (a *DefaultAPIService) ListBackupPolicies(ctx context.Context, projectId string) ApiListBackupPoliciesRequest { + return ApiListBackupPoliciesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return GetBackupPoliciesResponse +func (a *DefaultAPIService) ListBackupPoliciesExecute(r ApiListBackupPoliciesRequest) (*GetBackupPoliciesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupPoliciesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackupPolicies") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/backup-policies" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupSchedulesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiListBackupSchedulesRequest) Execute() (*GetBackupSchedulesResponse, error) { + return r.ApiService.ListBackupSchedulesExecute(r) +} + +/* +ListBackupSchedules get list of backup schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiListBackupSchedulesRequest +*/ +func (a *DefaultAPIService) ListBackupSchedules(ctx context.Context, projectId string, serverId string) ApiListBackupSchedulesRequest { + return ApiListBackupSchedulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return GetBackupSchedulesResponse +func (a *DefaultAPIService) ListBackupSchedulesExecute(r ApiListBackupSchedulesRequest) (*GetBackupSchedulesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupSchedulesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackupSchedules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backup-schedules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string +} + +func (r ApiListBackupsRequest) Execute() (*GetBackupsListResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups get list of backups + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, serverId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Execute executes the request +// +// @return GetBackupsListResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*GetBackupsListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupsListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiRestoreBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + backupId string + restoreBackupPayload *RestoreBackupPayload +} + +func (r ApiRestoreBackupRequest) RestoreBackupPayload(restoreBackupPayload RestoreBackupPayload) ApiRestoreBackupRequest { + r.restoreBackupPayload = &restoreBackupPayload + return r +} + +func (r ApiRestoreBackupRequest) Execute() error { + return r.ApiService.RestoreBackupExecute(r) +} + +/* +RestoreBackup trigger restore of the requested backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @return ApiRestoreBackupRequest +*/ +func (a *DefaultAPIService) RestoreBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.restoreBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiRestoreVolumeBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + backupId string + volumeBackupId string + restoreVolumeBackupPayload *RestoreVolumeBackupPayload +} + +func (r ApiRestoreVolumeBackupRequest) RestoreVolumeBackupPayload(restoreVolumeBackupPayload RestoreVolumeBackupPayload) ApiRestoreVolumeBackupRequest { + r.restoreVolumeBackupPayload = &restoreVolumeBackupPayload + return r +} + +func (r ApiRestoreVolumeBackupRequest) Execute() error { + return r.ApiService.RestoreVolumeBackupExecute(r) +} + +/* +RestoreVolumeBackup trigger restore of the requested volume backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupId id of the backup + @param volumeBackupId id of the volume backup + @return ApiRestoreVolumeBackupRequest +*/ +func (a *DefaultAPIService) RestoreVolumeBackup(ctx context.Context, projectId string, serverId string, backupId string, volumeBackupId string) ApiRestoreVolumeBackupRequest { + return ApiRestoreVolumeBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + volumeBackupId: volumeBackupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RestoreVolumeBackupExecute(r ApiRestoreVolumeBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreVolumeBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backups/{backupId}/volume-backups/{volumeBackupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeBackupId"+"}", url.PathEscape(parameterValueToString(r.volumeBackupId, "volumeBackupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.restoreVolumeBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return newErr + } + + return nil +} + +type ApiUpdateBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + backupScheduleId string + updateBackupSchedulePayload *UpdateBackupSchedulePayload +} + +func (r ApiUpdateBackupScheduleRequest) UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest { + r.updateBackupSchedulePayload = &updateBackupSchedulePayload + return r +} + +func (r ApiUpdateBackupScheduleRequest) Execute() (*BackupSchedule, error) { + return r.ApiService.UpdateBackupScheduleExecute(r) +} + +/* +UpdateBackupSchedule update backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param backupScheduleId backup schedule id + @return ApiUpdateBackupScheduleRequest +*/ +func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiUpdateBackupScheduleRequest { + return ApiUpdateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupScheduleId: backupScheduleId, + } +} + +// Execute executes the request +// +// @return BackupSchedule +func (a *DefaultAPIService) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) (*BackupSchedule, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupSchedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/servers/{serverId}/backup-schedules/{backupScheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupScheduleId"+"}", url.PathEscape(parameterValueToString(r.backupScheduleId, "backupScheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupSchedulePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/serverbackup/v1api/api_default_mock.go b/services/serverbackup/v1api/api_default_mock.go new file mode 100644 index 000000000..efa0525c2 --- /dev/null +++ b/services/serverbackup/v1api/api_default_mock.go @@ -0,0 +1,404 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) (*BackupJob, error) + // CreateBackupScheduleExecuteMock can be populated to implement the behavior of the CreateBackupScheduleExecute function of this mock + CreateBackupScheduleExecuteMock *func(r ApiCreateBackupScheduleRequest) (*BackupSchedule, error) + // DeleteBackupExecuteMock can be populated to implement the behavior of the DeleteBackupExecute function of this mock + DeleteBackupExecuteMock *func(r ApiDeleteBackupRequest) error + // DeleteBackupScheduleExecuteMock can be populated to implement the behavior of the DeleteBackupScheduleExecute function of this mock + DeleteBackupScheduleExecuteMock *func(r ApiDeleteBackupScheduleRequest) error + // DeleteVolumeBackupExecuteMock can be populated to implement the behavior of the DeleteVolumeBackupExecute function of this mock + DeleteVolumeBackupExecuteMock *func(r ApiDeleteVolumeBackupRequest) error + // Deprecated: DisableServiceExecuteMock can be populated to implement the behavior of the DisableServiceExecute function of this mock + DisableServiceExecuteMock *func(r ApiDisableServiceRequest) error + // DisableServiceResourceExecuteMock can be populated to implement the behavior of the DisableServiceResourceExecute function of this mock + DisableServiceResourceExecuteMock *func(r ApiDisableServiceResourceRequest) error + // Deprecated: EnableServiceExecuteMock can be populated to implement the behavior of the EnableServiceExecute function of this mock + EnableServiceExecuteMock *func(r ApiEnableServiceRequest) error + // EnableServiceResourceExecuteMock can be populated to implement the behavior of the EnableServiceResourceExecute function of this mock + EnableServiceResourceExecuteMock *func(r ApiEnableServiceResourceRequest) error + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*Backup, error) + // GetBackupScheduleExecuteMock can be populated to implement the behavior of the GetBackupScheduleExecute function of this mock + GetBackupScheduleExecuteMock *func(r ApiGetBackupScheduleRequest) (*BackupSchedule, error) + // GetServiceResourceExecuteMock can be populated to implement the behavior of the GetServiceResourceExecute function of this mock + GetServiceResourceExecuteMock *func(r ApiGetServiceResourceRequest) (*GetBackupServiceResponse, error) + // ListBackupPoliciesExecuteMock can be populated to implement the behavior of the ListBackupPoliciesExecute function of this mock + ListBackupPoliciesExecuteMock *func(r ApiListBackupPoliciesRequest) (*GetBackupPoliciesResponse, error) + // ListBackupSchedulesExecuteMock can be populated to implement the behavior of the ListBackupSchedulesExecute function of this mock + ListBackupSchedulesExecuteMock *func(r ApiListBackupSchedulesRequest) (*GetBackupSchedulesResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*GetBackupsListResponse, error) + // RestoreBackupExecuteMock can be populated to implement the behavior of the RestoreBackupExecute function of this mock + RestoreBackupExecuteMock *func(r ApiRestoreBackupRequest) error + // RestoreVolumeBackupExecuteMock can be populated to implement the behavior of the RestoreVolumeBackupExecute function of this mock + RestoreVolumeBackupExecuteMock *func(r ApiRestoreVolumeBackupRequest) error + // UpdateBackupScheduleExecuteMock can be populated to implement the behavior of the UpdateBackupScheduleExecute function of this mock + UpdateBackupScheduleExecuteMock *func(r ApiUpdateBackupScheduleRequest) (*BackupSchedule, error) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, serverId string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) (*BackupJob, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue *BackupJob + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateBackupSchedule(ctx context.Context, projectId string, serverId string) ApiCreateBackupScheduleRequest { + return ApiCreateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// CreateBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupScheduleExecute(r ApiCreateBackupScheduleRequest) (*BackupSchedule, error) { + if a.CreateBackupScheduleExecuteMock == nil { + var localVarReturnValue *BackupSchedule + return localVarReturnValue, nil + } + + return (*a.CreateBackupScheduleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + } +} + +// DeleteBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + if a.DeleteBackupExecuteMock == nil { + return nil + } + + return (*a.DeleteBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiDeleteBackupScheduleRequest { + return ApiDeleteBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupScheduleId: backupScheduleId, + } +} + +// DeleteBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteBackupScheduleExecute(r ApiDeleteBackupScheduleRequest) error { + if a.DeleteBackupScheduleExecuteMock == nil { + return nil + } + + return (*a.DeleteBackupScheduleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteVolumeBackup(ctx context.Context, projectId string, serverId string, backupId string, volumeBackupId string) ApiDeleteVolumeBackupRequest { + return ApiDeleteVolumeBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + volumeBackupId: volumeBackupId, + } +} + +// DeleteVolumeBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVolumeBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteVolumeBackupExecute(r ApiDeleteVolumeBackupRequest) error { + if a.DeleteVolumeBackupExecuteMock == nil { + return nil + } + + return (*a.DeleteVolumeBackupExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) DisableService(ctx context.Context, projectId string, serverId string) ApiDisableServiceRequest { + return ApiDisableServiceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: DisableServiceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DisableServiceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DisableServiceExecute(r ApiDisableServiceRequest) error { + if a.DisableServiceExecuteMock == nil { + return nil + } + + return (*a.DisableServiceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DisableServiceResource(ctx context.Context, projectId string, serverId string) ApiDisableServiceResourceRequest { + return ApiDisableServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// DisableServiceResourceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DisableServiceResourceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DisableServiceResourceExecute(r ApiDisableServiceResourceRequest) error { + if a.DisableServiceResourceExecuteMock == nil { + return nil + } + + return (*a.DisableServiceResourceExecuteMock)(r) +} + +// Deprecated +func (a DefaultAPIServiceMock) EnableService(ctx context.Context, projectId string, serverId string) ApiEnableServiceRequest { + return ApiEnableServiceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// Deprecated: EnableServiceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the EnableServiceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) EnableServiceExecute(r ApiEnableServiceRequest) error { + if a.EnableServiceExecuteMock == nil { + return nil + } + + return (*a.EnableServiceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) EnableServiceResource(ctx context.Context, projectId string, serverId string) ApiEnableServiceResourceRequest { + return ApiEnableServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// EnableServiceResourceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the EnableServiceResourceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) EnableServiceResourceExecute(r ApiEnableServiceResourceRequest) error { + if a.EnableServiceResourceExecuteMock == nil { + return nil + } + + return (*a.EnableServiceResourceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + } +} + +// GetBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiGetBackupScheduleRequest { + return ApiGetBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupScheduleId: backupScheduleId, + } +} + +// GetBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupScheduleExecute(r ApiGetBackupScheduleRequest) (*BackupSchedule, error) { + if a.GetBackupScheduleExecuteMock == nil { + var localVarReturnValue *BackupSchedule + return localVarReturnValue, nil + } + + return (*a.GetBackupScheduleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServiceResource(ctx context.Context, projectId string, serverId string) ApiGetServiceResourceRequest { + return ApiGetServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// GetServiceResourceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServiceResourceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServiceResourceExecute(r ApiGetServiceResourceRequest) (*GetBackupServiceResponse, error) { + if a.GetServiceResourceExecuteMock == nil { + var localVarReturnValue *GetBackupServiceResponse + return localVarReturnValue, nil + } + + return (*a.GetServiceResourceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackupPolicies(ctx context.Context, projectId string) ApiListBackupPoliciesRequest { + return ApiListBackupPoliciesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListBackupPoliciesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupPoliciesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupPoliciesExecute(r ApiListBackupPoliciesRequest) (*GetBackupPoliciesResponse, error) { + if a.ListBackupPoliciesExecuteMock == nil { + var localVarReturnValue *GetBackupPoliciesResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupPoliciesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackupSchedules(ctx context.Context, projectId string, serverId string) ApiListBackupSchedulesRequest { + return ApiListBackupSchedulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// ListBackupSchedulesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupSchedulesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupSchedulesExecute(r ApiListBackupSchedulesRequest) (*GetBackupSchedulesResponse, error) { + if a.ListBackupSchedulesExecuteMock == nil { + var localVarReturnValue *GetBackupSchedulesResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupSchedulesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, serverId string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*GetBackupsListResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *GetBackupsListResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RestoreBackup(ctx context.Context, projectId string, serverId string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + } +} + +// RestoreBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + if a.RestoreBackupExecuteMock == nil { + return nil + } + + return (*a.RestoreBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RestoreVolumeBackup(ctx context.Context, projectId string, serverId string, backupId string, volumeBackupId string) ApiRestoreVolumeBackupRequest { + return ApiRestoreVolumeBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupId: backupId, + volumeBackupId: volumeBackupId, + } +} + +// RestoreVolumeBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreVolumeBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreVolumeBackupExecute(r ApiRestoreVolumeBackupRequest) error { + if a.RestoreVolumeBackupExecuteMock == nil { + return nil + } + + return (*a.RestoreVolumeBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, serverId string, backupScheduleId string) ApiUpdateBackupScheduleRequest { + return ApiUpdateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + backupScheduleId: backupScheduleId, + } +} + +// UpdateBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) (*BackupSchedule, error) { + if a.UpdateBackupScheduleExecuteMock == nil { + var localVarReturnValue *BackupSchedule + return localVarReturnValue, nil + } + + return (*a.UpdateBackupScheduleExecuteMock)(r) +} diff --git a/services/serverbackup/v1api/client.go b/services/serverbackup/v1api/client.go new file mode 100644 index 000000000..40a25a68b --- /dev/null +++ b/services/serverbackup/v1api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Server Backup Management API API v1.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/serverbackup/v1api/configuration.go b/services/serverbackup/v1api/configuration.go new file mode 100644 index 000000000..a4b9381e4 --- /dev/null +++ b/services/serverbackup/v1api/configuration.go @@ -0,0 +1,41 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/serverbackup", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://server-backup.api.{region}stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "eu01.", + EnumValues: []string{ + "eu01.", + }, + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/serverbackup/v1api/model_backup.go b/services/serverbackup/v1api/model_backup.go new file mode 100644 index 000000000..4ea0c8068 --- /dev/null +++ b/services/serverbackup/v1api/model_backup.go @@ -0,0 +1,377 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + CreatedAt string `json:"createdAt"` + ExpireAt string `json:"expireAt"` + Id string `json:"id"` + LastRestoredAt *string `json:"lastRestoredAt,omitempty"` + Name string `json:"name"` + Size *int32 `json:"size,omitempty"` + 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() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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() (*int32, 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 int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *Backup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "expireAt", + "id", + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackup := _Backup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackup) + + if err != nil { + return err + } + + *o = Backup(varBackup) + + return err +} + +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/v1api/model_backup_job.go b/services/serverbackup/v1api/model_backup_job.go new file mode 100644 index 000000000..7a179b79a --- /dev/null +++ b/services/serverbackup/v1api/model_backup_job.go @@ -0,0 +1,157 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupJob type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupJob{} + +// BackupJob struct for BackupJob +type BackupJob struct { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupJob) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *BackupJob) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupJob := _BackupJob{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupJob) + + if err != nil { + return err + } + + *o = BackupJob(varBackupJob) + + return err +} + +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/v1api/model_backup_policy.go b/services/serverbackup/v1api/model_backup_policy.go new file mode 100644 index 000000000..41c13fb91 --- /dev/null +++ b/services/serverbackup/v1api/model_backup_policy.go @@ -0,0 +1,342 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the BackupPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupPolicy{} + +// BackupPolicy struct for BackupPolicy +type BackupPolicy struct { + BackupProperties *BackupPolicyBackupProperties `json:"backupProperties,omitempty"` + Default *bool `json:"default,omitempty"` + Description *string `json:"description,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // An rrule (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates + Rrule *string `json:"rrule,omitempty"` +} + +// NewBackupPolicy instantiates a new BackupPolicy 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 NewBackupPolicy() *BackupPolicy { + this := BackupPolicy{} + return &this +} + +// NewBackupPolicyWithDefaults instantiates a new BackupPolicy 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 NewBackupPolicyWithDefaults() *BackupPolicy { + this := BackupPolicy{} + return &this +} + +// GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +func (o *BackupPolicy) GetBackupProperties() BackupPolicyBackupProperties { + if o == nil || IsNil(o.BackupProperties) { + var ret BackupPolicyBackupProperties + 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 *BackupPolicy) GetBackupPropertiesOk() (*BackupPolicyBackupProperties, 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 *BackupPolicy) HasBackupProperties() bool { + if o != nil && !IsNil(o.BackupProperties) { + return true + } + + return false +} + +// SetBackupProperties gets a reference to the given BackupPolicyBackupProperties and assigns it to the BackupProperties field. +func (o *BackupPolicy) SetBackupProperties(v BackupPolicyBackupProperties) { + o.BackupProperties = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *BackupPolicy) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicy) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *BackupPolicy) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *BackupPolicy) SetDefault(v bool) { + o.Default = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BackupPolicy) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicy) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *BackupPolicy) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *BackupPolicy) SetDescription(v string) { + o.Description = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *BackupPolicy) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicy) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *BackupPolicy) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *BackupPolicy) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BackupPolicy) 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 *BackupPolicy) 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 *BackupPolicy) 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 *BackupPolicy) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BackupPolicy) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// 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 *BackupPolicy) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *BackupPolicy) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *BackupPolicy) SetName(v string) { + o.Name = &v +} + +// GetRrule returns the Rrule field value if set, zero value otherwise. +func (o *BackupPolicy) GetRrule() string { + if o == nil || IsNil(o.Rrule) { + var ret string + return ret + } + return *o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicy) GetRruleOk() (*string, bool) { + if o == nil || IsNil(o.Rrule) { + return nil, false + } + return o.Rrule, true +} + +// HasRrule returns a boolean if a field has been set. +func (o *BackupPolicy) HasRrule() bool { + if o != nil && !IsNil(o.Rrule) { + return true + } + + return false +} + +// SetRrule gets a reference to the given string and assigns it to the Rrule field. +func (o *BackupPolicy) SetRrule(v string) { + o.Rrule = &v +} + +func (o BackupPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupProperties) { + toSerialize["backupProperties"] = o.BackupProperties + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Rrule) { + toSerialize["rrule"] = o.Rrule + } + return toSerialize, nil +} + +type NullableBackupPolicy struct { + value *BackupPolicy + isSet bool +} + +func (v NullableBackupPolicy) Get() *BackupPolicy { + return v.value +} + +func (v *NullableBackupPolicy) Set(val *BackupPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableBackupPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupPolicy(val *BackupPolicy) *NullableBackupPolicy { + return &NullableBackupPolicy{value: val, isSet: true} +} + +func (v NullableBackupPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v1api/model_backup_policy_backup_properties.go b/services/serverbackup/v1api/model_backup_policy_backup_properties.go new file mode 100644 index 000000000..291ef7b01 --- /dev/null +++ b/services/serverbackup/v1api/model_backup_policy_backup_properties.go @@ -0,0 +1,161 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the BackupPolicyBackupProperties type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupPolicyBackupProperties{} + +// BackupPolicyBackupProperties struct for BackupPolicyBackupProperties +type BackupPolicyBackupProperties struct { + Name *string `json:"name,omitempty"` + RetentionPeriod *int32 `json:"retentionPeriod,omitempty"` +} + +// NewBackupPolicyBackupProperties instantiates a new BackupPolicyBackupProperties 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 NewBackupPolicyBackupProperties() *BackupPolicyBackupProperties { + this := BackupPolicyBackupProperties{} + return &this +} + +// NewBackupPolicyBackupPropertiesWithDefaults instantiates a new BackupPolicyBackupProperties 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 NewBackupPolicyBackupPropertiesWithDefaults() *BackupPolicyBackupProperties { + this := BackupPolicyBackupProperties{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BackupPolicyBackupProperties) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// 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 *BackupPolicyBackupProperties) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *BackupPolicyBackupProperties) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *BackupPolicyBackupProperties) SetName(v string) { + o.Name = &v +} + +// GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. +func (o *BackupPolicyBackupProperties) GetRetentionPeriod() int32 { + if o == nil || IsNil(o.RetentionPeriod) { + var ret int32 + return ret + } + return *o.RetentionPeriod +} + +// GetRetentionPeriodOk returns a tuple with the RetentionPeriod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicyBackupProperties) GetRetentionPeriodOk() (*int32, bool) { + if o == nil || IsNil(o.RetentionPeriod) { + return nil, false + } + return o.RetentionPeriod, true +} + +// HasRetentionPeriod returns a boolean if a field has been set. +func (o *BackupPolicyBackupProperties) HasRetentionPeriod() bool { + if o != nil && !IsNil(o.RetentionPeriod) { + return true + } + + return false +} + +// SetRetentionPeriod gets a reference to the given int32 and assigns it to the RetentionPeriod field. +func (o *BackupPolicyBackupProperties) SetRetentionPeriod(v int32) { + o.RetentionPeriod = &v +} + +func (o BackupPolicyBackupProperties) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupPolicyBackupProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.RetentionPeriod) { + toSerialize["retentionPeriod"] = o.RetentionPeriod + } + return toSerialize, nil +} + +type NullableBackupPolicyBackupProperties struct { + value *BackupPolicyBackupProperties + isSet bool +} + +func (v NullableBackupPolicyBackupProperties) Get() *BackupPolicyBackupProperties { + return v.value +} + +func (v *NullableBackupPolicyBackupProperties) Set(val *BackupPolicyBackupProperties) { + v.value = val + v.isSet = true +} + +func (v NullableBackupPolicyBackupProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupPolicyBackupProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupPolicyBackupProperties(val *BackupPolicyBackupProperties) *NullableBackupPolicyBackupProperties { + return &NullableBackupPolicyBackupProperties{value: val, isSet: true} +} + +func (v NullableBackupPolicyBackupProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupPolicyBackupProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v1api/model_backup_properties.go b/services/serverbackup/v1api/model_backup_properties.go new file mode 100644 index 000000000..401d39a33 --- /dev/null +++ b/services/serverbackup/v1api/model_backup_properties.go @@ -0,0 +1,223 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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 + Name string `json:"name"` + // Values are set in days (1-36500) + RetentionPeriod int32 `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 int32) *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() int32 { + if o == nil { + var ret int32 + 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() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RetentionPeriod, true +} + +// SetRetentionPeriod sets field value +func (o *BackupProperties) SetRetentionPeriod(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *BackupProperties) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "retentionPeriod", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupProperties := _BackupProperties{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupProperties) + + if err != nil { + return err + } + + *o = BackupProperties(varBackupProperties) + + return err +} + +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/v1api/model_backup_schedule.go b/services/serverbackup/v1api/model_backup_schedule.go new file mode 100644 index 000000000..22abfc153 --- /dev/null +++ b/services/serverbackup/v1api/model_backup_schedule.go @@ -0,0 +1,278 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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"` + Enabled bool `json:"enabled"` + Id int32 `json:"id"` + Name string `json:"name"` + // An rrule (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates + 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 int32, 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() int32 { + if o == nil { + var ret int32 + 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() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BackupSchedule) SetId(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *BackupSchedule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + "id", + "name", + "rrule", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupSchedule := _BackupSchedule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupSchedule) + + if err != nil { + return err + } + + *o = BackupSchedule(varBackupSchedule) + + return err +} + +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/v1api/model_backup_volume_backups_inner.go b/services/serverbackup/v1api/model_backup_volume_backups_inner.go new file mode 100644 index 000000000..14d30e5e6 --- /dev/null +++ b/services/serverbackup/v1api/model_backup_volume_backups_inner.go @@ -0,0 +1,305 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +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"` + LastRestoredAt *string `json:"lastRestoredAt,omitempty"` + LastRestoredVolumeId *string `json:"lastRestoredVolumeId,omitempty"` + Size *int32 `json:"size,omitempty"` + 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() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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() (*int32, 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 int32 and assigns it to the Size field. +func (o *BackupVolumeBackupsInner) SetSize(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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/v1api/model_create_backup_payload.go b/services/serverbackup/v1api/model_create_backup_payload.go new file mode 100644 index 000000000..cded0b8d1 --- /dev/null +++ b/services/serverbackup/v1api/model_create_backup_payload.go @@ -0,0 +1,223 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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 + Name string `json:"name"` + // Values are set in days (1-36500) + RetentionPeriod int32 `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 int32) *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() int32 { + if o == nil { + var ret int32 + 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() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RetentionPeriod, true +} + +// SetRetentionPeriod sets field value +func (o *CreateBackupPayload) SetRetentionPeriod(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *CreateBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "retentionPeriod", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupPayload := _CreateBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateBackupPayload) + + if err != nil { + return err + } + + *o = CreateBackupPayload(varCreateBackupPayload) + + return err +} + +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/v1api/model_create_backup_schedule_payload.go b/services/serverbackup/v1api/model_create_backup_schedule_payload.go new file mode 100644 index 000000000..e1194d78f --- /dev/null +++ b/services/serverbackup/v1api/model_create_backup_schedule_payload.go @@ -0,0 +1,251 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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"` + Enabled bool `json:"enabled"` + // Max 255 characters + Name string `json:"name"` + // An rrule (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *CreateBackupSchedulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + "name", + "rrule", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupSchedulePayload := _CreateBackupSchedulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateBackupSchedulePayload) + + if err != nil { + return err + } + + *o = CreateBackupSchedulePayload(varCreateBackupSchedulePayload) + + return err +} + +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/v1api/model_enable_service_payload.go b/services/serverbackup/v1api/model_enable_service_payload.go new file mode 100644 index 000000000..d543c1434 --- /dev/null +++ b/services/serverbackup/v1api/model_enable_service_payload.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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/v1api/model_enable_service_resource_payload.go b/services/serverbackup/v1api/model_enable_service_resource_payload.go new file mode 100644 index 000000000..4d313f2ba --- /dev/null +++ b/services/serverbackup/v1api/model_enable_service_resource_payload.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the EnableServiceResourcePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnableServiceResourcePayload{} + +// EnableServiceResourcePayload struct for EnableServiceResourcePayload +type EnableServiceResourcePayload struct { + BackupPolicyId *string `json:"backupPolicyId,omitempty"` +} + +// NewEnableServiceResourcePayload instantiates a new EnableServiceResourcePayload 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 NewEnableServiceResourcePayload() *EnableServiceResourcePayload { + this := EnableServiceResourcePayload{} + return &this +} + +// NewEnableServiceResourcePayloadWithDefaults instantiates a new EnableServiceResourcePayload 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 NewEnableServiceResourcePayloadWithDefaults() *EnableServiceResourcePayload { + this := EnableServiceResourcePayload{} + return &this +} + +// GetBackupPolicyId returns the BackupPolicyId field value if set, zero value otherwise. +func (o *EnableServiceResourcePayload) 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 *EnableServiceResourcePayload) 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 *EnableServiceResourcePayload) 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 *EnableServiceResourcePayload) SetBackupPolicyId(v string) { + o.BackupPolicyId = &v +} + +func (o EnableServiceResourcePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnableServiceResourcePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupPolicyId) { + toSerialize["backupPolicyId"] = o.BackupPolicyId + } + return toSerialize, nil +} + +type NullableEnableServiceResourcePayload struct { + value *EnableServiceResourcePayload + isSet bool +} + +func (v NullableEnableServiceResourcePayload) Get() *EnableServiceResourcePayload { + return v.value +} + +func (v *NullableEnableServiceResourcePayload) Set(val *EnableServiceResourcePayload) { + v.value = val + v.isSet = true +} + +func (v NullableEnableServiceResourcePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableEnableServiceResourcePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnableServiceResourcePayload(val *EnableServiceResourcePayload) *NullableEnableServiceResourcePayload { + return &NullableEnableServiceResourcePayload{value: val, isSet: true} +} + +func (v NullableEnableServiceResourcePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnableServiceResourcePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v1api/model_get_backup_policies_response.go b/services/serverbackup/v1api/model_get_backup_policies_response.go new file mode 100644 index 000000000..b5c5a10e5 --- /dev/null +++ b/services/serverbackup/v1api/model_get_backup_policies_response.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetBackupPoliciesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupPoliciesResponse{} + +// GetBackupPoliciesResponse struct for GetBackupPoliciesResponse +type GetBackupPoliciesResponse struct { + Items []BackupPolicy `json:"items,omitempty"` +} + +// NewGetBackupPoliciesResponse instantiates a new GetBackupPoliciesResponse 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 NewGetBackupPoliciesResponse() *GetBackupPoliciesResponse { + this := GetBackupPoliciesResponse{} + return &this +} + +// NewGetBackupPoliciesResponseWithDefaults instantiates a new GetBackupPoliciesResponse 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 NewGetBackupPoliciesResponseWithDefaults() *GetBackupPoliciesResponse { + this := GetBackupPoliciesResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *GetBackupPoliciesResponse) GetItems() []BackupPolicy { + if o == nil || IsNil(o.Items) { + var ret []BackupPolicy + 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 *GetBackupPoliciesResponse) GetItemsOk() ([]BackupPolicy, 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 *GetBackupPoliciesResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []BackupPolicy and assigns it to the Items field. +func (o *GetBackupPoliciesResponse) SetItems(v []BackupPolicy) { + o.Items = v +} + +func (o GetBackupPoliciesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupPoliciesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableGetBackupPoliciesResponse struct { + value *GetBackupPoliciesResponse + isSet bool +} + +func (v NullableGetBackupPoliciesResponse) Get() *GetBackupPoliciesResponse { + return v.value +} + +func (v *NullableGetBackupPoliciesResponse) Set(val *GetBackupPoliciesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupPoliciesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupPoliciesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupPoliciesResponse(val *GetBackupPoliciesResponse) *NullableGetBackupPoliciesResponse { + return &NullableGetBackupPoliciesResponse{value: val, isSet: true} +} + +func (v NullableGetBackupPoliciesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupPoliciesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v1api/model_get_backup_schedules_response.go b/services/serverbackup/v1api/model_get_backup_schedules_response.go new file mode 100644 index 000000000..7a15a7c8a --- /dev/null +++ b/services/serverbackup/v1api/model_get_backup_schedules_response.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetBackupSchedulesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupSchedulesResponse{} + +// GetBackupSchedulesResponse struct for GetBackupSchedulesResponse +type GetBackupSchedulesResponse struct { + Items []BackupSchedule `json:"items,omitempty"` +} + +// NewGetBackupSchedulesResponse instantiates a new GetBackupSchedulesResponse 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 NewGetBackupSchedulesResponse() *GetBackupSchedulesResponse { + this := GetBackupSchedulesResponse{} + return &this +} + +// NewGetBackupSchedulesResponseWithDefaults instantiates a new GetBackupSchedulesResponse 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 NewGetBackupSchedulesResponseWithDefaults() *GetBackupSchedulesResponse { + this := GetBackupSchedulesResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *GetBackupSchedulesResponse) 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 *GetBackupSchedulesResponse) 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 *GetBackupSchedulesResponse) 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 *GetBackupSchedulesResponse) SetItems(v []BackupSchedule) { + o.Items = v +} + +func (o GetBackupSchedulesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupSchedulesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableGetBackupSchedulesResponse struct { + value *GetBackupSchedulesResponse + isSet bool +} + +func (v NullableGetBackupSchedulesResponse) Get() *GetBackupSchedulesResponse { + return v.value +} + +func (v *NullableGetBackupSchedulesResponse) Set(val *GetBackupSchedulesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupSchedulesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupSchedulesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupSchedulesResponse(val *GetBackupSchedulesResponse) *NullableGetBackupSchedulesResponse { + return &NullableGetBackupSchedulesResponse{value: val, isSet: true} +} + +func (v NullableGetBackupSchedulesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupSchedulesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v1api/model_get_backup_service_response.go b/services/serverbackup/v1api/model_get_backup_service_response.go new file mode 100644 index 000000000..9965f8292 --- /dev/null +++ b/services/serverbackup/v1api/model_get_backup_service_response.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetBackupServiceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupServiceResponse{} + +// GetBackupServiceResponse struct for GetBackupServiceResponse +type GetBackupServiceResponse struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// NewGetBackupServiceResponse instantiates a new GetBackupServiceResponse 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 NewGetBackupServiceResponse() *GetBackupServiceResponse { + this := GetBackupServiceResponse{} + return &this +} + +// NewGetBackupServiceResponseWithDefaults instantiates a new GetBackupServiceResponse 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 NewGetBackupServiceResponseWithDefaults() *GetBackupServiceResponse { + this := GetBackupServiceResponse{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *GetBackupServiceResponse) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBackupServiceResponse) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *GetBackupServiceResponse) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *GetBackupServiceResponse) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o GetBackupServiceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupServiceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableGetBackupServiceResponse struct { + value *GetBackupServiceResponse + isSet bool +} + +func (v NullableGetBackupServiceResponse) Get() *GetBackupServiceResponse { + return v.value +} + +func (v *NullableGetBackupServiceResponse) Set(val *GetBackupServiceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupServiceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupServiceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupServiceResponse(val *GetBackupServiceResponse) *NullableGetBackupServiceResponse { + return &NullableGetBackupServiceResponse{value: val, isSet: true} +} + +func (v NullableGetBackupServiceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupServiceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v1api/model_get_backups_list_response.go b/services/serverbackup/v1api/model_get_backups_list_response.go new file mode 100644 index 000000000..0cb72b423 --- /dev/null +++ b/services/serverbackup/v1api/model_get_backups_list_response.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetBackupsListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupsListResponse{} + +// GetBackupsListResponse struct for GetBackupsListResponse +type GetBackupsListResponse struct { + Items []Backup `json:"items,omitempty"` +} + +// NewGetBackupsListResponse instantiates a new GetBackupsListResponse 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 NewGetBackupsListResponse() *GetBackupsListResponse { + this := GetBackupsListResponse{} + return &this +} + +// NewGetBackupsListResponseWithDefaults instantiates a new GetBackupsListResponse 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 NewGetBackupsListResponseWithDefaults() *GetBackupsListResponse { + this := GetBackupsListResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *GetBackupsListResponse) 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 *GetBackupsListResponse) 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 *GetBackupsListResponse) 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 *GetBackupsListResponse) SetItems(v []Backup) { + o.Items = v +} + +func (o GetBackupsListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupsListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableGetBackupsListResponse struct { + value *GetBackupsListResponse + isSet bool +} + +func (v NullableGetBackupsListResponse) Get() *GetBackupsListResponse { + return v.value +} + +func (v *NullableGetBackupsListResponse) Set(val *GetBackupsListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupsListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupsListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupsListResponse(val *GetBackupsListResponse) *NullableGetBackupsListResponse { + return &NullableGetBackupsListResponse{value: val, isSet: true} +} + +func (v NullableGetBackupsListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupsListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v1api/model_restore_backup_payload.go b/services/serverbackup/v1api/model_restore_backup_payload.go new file mode 100644 index 000000000..29cfbed6b --- /dev/null +++ b/services/serverbackup/v1api/model_restore_backup_payload.go @@ -0,0 +1,193 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RestoreBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreBackupPayload{} + +// RestoreBackupPayload struct for RestoreBackupPayload +type RestoreBackupPayload struct { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *RestoreBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "startServerAfterRestore", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestoreBackupPayload := _RestoreBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRestoreBackupPayload) + + if err != nil { + return err + } + + *o = RestoreBackupPayload(varRestoreBackupPayload) + + return err +} + +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/v1api/model_restore_volume_backup_payload.go b/services/serverbackup/v1api/model_restore_volume_backup_payload.go new file mode 100644 index 000000000..a24cd87e0 --- /dev/null +++ b/services/serverbackup/v1api/model_restore_volume_backup_payload.go @@ -0,0 +1,157 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RestoreVolumeBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreVolumeBackupPayload{} + +// RestoreVolumeBackupPayload struct for RestoreVolumeBackupPayload +type RestoreVolumeBackupPayload struct { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestoreVolumeBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["restoreVolumeId"] = o.RestoreVolumeId + return toSerialize, nil +} + +func (o *RestoreVolumeBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "restoreVolumeId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestoreVolumeBackupPayload := _RestoreVolumeBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRestoreVolumeBackupPayload) + + if err != nil { + return err + } + + *o = RestoreVolumeBackupPayload(varRestoreVolumeBackupPayload) + + return err +} + +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/v1api/model_update_backup_schedule_payload.go b/services/serverbackup/v1api/model_update_backup_schedule_payload.go new file mode 100644 index 000000000..726f1cf4a --- /dev/null +++ b/services/serverbackup/v1api/model_update_backup_schedule_payload.go @@ -0,0 +1,251 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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"` + Enabled bool `json:"enabled"` + // Max 255 characters + Name string `json:"name"` + // An rrule (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *UpdateBackupSchedulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + "name", + "rrule", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupSchedulePayload := _UpdateBackupSchedulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateBackupSchedulePayload) + + if err != nil { + return err + } + + *o = UpdateBackupSchedulePayload(varUpdateBackupSchedulePayload) + + return err +} + +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) +} diff --git a/services/serverbackup/v1api/response.go b/services/serverbackup/v1api/response.go new file mode 100644 index 000000000..45543f6fc --- /dev/null +++ b/services/serverbackup/v1api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/serverbackup/v1api/utils.go b/services/serverbackup/v1api/utils.go new file mode 100644 index 000000000..f284c0624 --- /dev/null +++ b/services/serverbackup/v1api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 1.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/serverbackup/v2api/api_default.go b/services/serverbackup/v2api/api_default.go new file mode 100644 index 000000000..14bdc6655 --- /dev/null +++ b/services/serverbackup/v2api/api_default.go @@ -0,0 +1,2407 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateBackup create backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiCreateBackupRequest + */ + CreateBackup(ctx context.Context, projectId string, serverId string, region string) ApiCreateBackupRequest + + // CreateBackupExecute executes the request + // @return BackupJob + CreateBackupExecute(r ApiCreateBackupRequest) (*BackupJob, error) + + /* + CreateBackupSchedule create backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiCreateBackupScheduleRequest + */ + CreateBackupSchedule(ctx context.Context, projectId string, serverId string, region string) ApiCreateBackupScheduleRequest + + // CreateBackupScheduleExecute executes the request + // @return BackupSchedule + CreateBackupScheduleExecute(r ApiCreateBackupScheduleRequest) (*BackupSchedule, error) + + /* + DeleteBackup delete backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @return ApiDeleteBackupRequest + */ + DeleteBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiDeleteBackupRequest + + // DeleteBackupExecute executes the request + DeleteBackupExecute(r ApiDeleteBackupRequest) error + + /* + DeleteBackupSchedule delete backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupScheduleId backup schedule id + @return ApiDeleteBackupScheduleRequest + */ + DeleteBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiDeleteBackupScheduleRequest + + // DeleteBackupScheduleExecute executes the request + DeleteBackupScheduleExecute(r ApiDeleteBackupScheduleRequest) error + + /* + DeleteVolumeBackup delete volume backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @param volumeBackupId id of the volume backup + @return ApiDeleteVolumeBackupRequest + */ + DeleteVolumeBackup(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) ApiDeleteVolumeBackupRequest + + // DeleteVolumeBackupExecute executes the request + DeleteVolumeBackupExecute(r ApiDeleteVolumeBackupRequest) error + + /* + DisableServiceResource disable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiDisableServiceResourceRequest + */ + DisableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiDisableServiceResourceRequest + + // DisableServiceResourceExecute executes the request + DisableServiceResourceExecute(r ApiDisableServiceResourceRequest) error + + /* + EnableServiceResource enable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiEnableServiceResourceRequest + */ + EnableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiEnableServiceResourceRequest + + // EnableServiceResourceExecute executes the request + EnableServiceResourceExecute(r ApiEnableServiceResourceRequest) error + + /* + GetBackup get backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @return ApiGetBackupRequest + */ + GetBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiGetBackupRequest + + // GetBackupExecute executes the request + // @return Backup + GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) + + /* + GetBackupSchedule get single backup schedule details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupScheduleId backup schedule id + @return ApiGetBackupScheduleRequest + */ + GetBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiGetBackupScheduleRequest + + // GetBackupScheduleExecute executes the request + // @return BackupSchedule + GetBackupScheduleExecute(r ApiGetBackupScheduleRequest) (*BackupSchedule, error) + + /* + GetServiceResource get backup service details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiGetServiceResourceRequest + */ + GetServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiGetServiceResourceRequest + + // GetServiceResourceExecute executes the request + // @return GetBackupServiceResponse + GetServiceResourceExecute(r ApiGetServiceResourceRequest) (*GetBackupServiceResponse, error) + + /* + ListBackupPolicies get list of backup policies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @return ApiListBackupPoliciesRequest + */ + ListBackupPolicies(ctx context.Context, projectId string) ApiListBackupPoliciesRequest + + // ListBackupPoliciesExecute executes the request + // @return GetBackupPoliciesResponse + ListBackupPoliciesExecute(r ApiListBackupPoliciesRequest) (*GetBackupPoliciesResponse, error) + + /* + ListBackupSchedules get list of backup schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiListBackupSchedulesRequest + */ + ListBackupSchedules(ctx context.Context, projectId string, serverId string, region string) ApiListBackupSchedulesRequest + + // ListBackupSchedulesExecute executes the request + // @return GetBackupSchedulesResponse + ListBackupSchedulesExecute(r ApiListBackupSchedulesRequest) (*GetBackupSchedulesResponse, error) + + /* + ListBackups get list of backups + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiListBackupsRequest + */ + ListBackups(ctx context.Context, projectId string, serverId string, region string) ApiListBackupsRequest + + // ListBackupsExecute executes the request + // @return GetBackupsListResponse + ListBackupsExecute(r ApiListBackupsRequest) (*GetBackupsListResponse, error) + + /* + RestoreBackup trigger restore of the requested backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @return ApiRestoreBackupRequest + */ + RestoreBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiRestoreBackupRequest + + // RestoreBackupExecute executes the request + RestoreBackupExecute(r ApiRestoreBackupRequest) error + + /* + RestoreVolumeBackup trigger restore of the requested volume backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @param volumeBackupId id of the volume backup + @return ApiRestoreVolumeBackupRequest + */ + RestoreVolumeBackup(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) ApiRestoreVolumeBackupRequest + + // RestoreVolumeBackupExecute executes the request + RestoreVolumeBackupExecute(r ApiRestoreVolumeBackupRequest) error + + /* + UpdateBackupSchedule update backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupScheduleId backup schedule id + @return ApiUpdateBackupScheduleRequest + */ + UpdateBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiUpdateBackupScheduleRequest + + // UpdateBackupScheduleExecute executes the request + // @return BackupSchedule + UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) (*BackupSchedule, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + createBackupPayload *CreateBackupPayload +} + +func (r ApiCreateBackupRequest) CreateBackupPayload(createBackupPayload CreateBackupPayload) ApiCreateBackupRequest { + r.createBackupPayload = &createBackupPayload + return r +} + +func (r ApiCreateBackupRequest) Execute() (*BackupJob, error) { + return r.ApiService.CreateBackupExecute(r) +} + +/* +CreateBackup create backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiCreateBackupRequest +*/ +func (a *DefaultAPIService) CreateBackup(ctx context.Context, projectId string, serverId string, region string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// Execute executes the request +// +// @return BackupJob +func (a *DefaultAPIService) CreateBackupExecute(r ApiCreateBackupRequest) (*BackupJob, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupJob + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + createBackupSchedulePayload *CreateBackupSchedulePayload +} + +func (r ApiCreateBackupScheduleRequest) CreateBackupSchedulePayload(createBackupSchedulePayload CreateBackupSchedulePayload) ApiCreateBackupScheduleRequest { + r.createBackupSchedulePayload = &createBackupSchedulePayload + return r +} + +func (r ApiCreateBackupScheduleRequest) Execute() (*BackupSchedule, error) { + return r.ApiService.CreateBackupScheduleExecute(r) +} + +/* +CreateBackupSchedule create backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiCreateBackupScheduleRequest +*/ +func (a *DefaultAPIService) CreateBackupSchedule(ctx context.Context, projectId string, serverId string, region string) ApiCreateBackupScheduleRequest { + return ApiCreateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// Execute executes the request +// +// @return BackupSchedule +func (a *DefaultAPIService) CreateBackupScheduleExecute(r ApiCreateBackupScheduleRequest) (*BackupSchedule, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupSchedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateBackupSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backup-schedules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createBackupSchedulePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + backupId string + force *bool +} + +// force delete the backup +func (r ApiDeleteBackupRequest) Force(force bool) ApiDeleteBackupRequest { + r.force = &force + return r +} + +func (r ApiDeleteBackupRequest) Execute() error { + return r.ApiService.DeleteBackupExecute(r) +} + +/* +DeleteBackup delete backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @return ApiDeleteBackupRequest +*/ +func (a *DefaultAPIService) DeleteBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + backupScheduleId string +} + +func (r ApiDeleteBackupScheduleRequest) Execute() error { + return r.ApiService.DeleteBackupScheduleExecute(r) +} + +/* +DeleteBackupSchedule delete backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupScheduleId backup schedule id + @return ApiDeleteBackupScheduleRequest +*/ +func (a *DefaultAPIService) DeleteBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiDeleteBackupScheduleRequest { + return ApiDeleteBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupScheduleId: backupScheduleId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteBackupScheduleExecute(r ApiDeleteBackupScheduleRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteBackupSchedule") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backup-schedules/{backupScheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupScheduleId"+"}", url.PathEscape(parameterValueToString(r.backupScheduleId, "backupScheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteVolumeBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + backupId string + volumeBackupId string + force *bool +} + +// Force delete the volume backup +func (r ApiDeleteVolumeBackupRequest) Force(force bool) ApiDeleteVolumeBackupRequest { + r.force = &force + return r +} + +func (r ApiDeleteVolumeBackupRequest) Execute() error { + return r.ApiService.DeleteVolumeBackupExecute(r) +} + +/* +DeleteVolumeBackup delete volume backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @param volumeBackupId id of the volume backup + @return ApiDeleteVolumeBackupRequest +*/ +func (a *DefaultAPIService) DeleteVolumeBackup(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) ApiDeleteVolumeBackupRequest { + return ApiDeleteVolumeBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + volumeBackupId: volumeBackupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteVolumeBackupExecute(r ApiDeleteVolumeBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteVolumeBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backups/{backupId}/volume-backups/{volumeBackupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeBackupId"+"}", url.PathEscape(parameterValueToString(r.volumeBackupId, "volumeBackupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.force != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "force", r.force, "form", "") + } + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + return newErr + } + + return nil +} + +type ApiDisableServiceResourceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string +} + +func (r ApiDisableServiceResourceRequest) Execute() error { + return r.ApiService.DisableServiceResourceExecute(r) +} + +/* +DisableServiceResource disable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiDisableServiceResourceRequest +*/ +func (a *DefaultAPIService) DisableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiDisableServiceResourceRequest { + return ApiDisableServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DisableServiceResourceExecute(r ApiDisableServiceResourceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DisableServiceResource") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + return newErr + } + + return nil +} + +type ApiEnableServiceResourceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + enableServiceResourcePayload *EnableServiceResourcePayload +} + +func (r ApiEnableServiceResourceRequest) EnableServiceResourcePayload(enableServiceResourcePayload EnableServiceResourcePayload) ApiEnableServiceResourceRequest { + r.enableServiceResourcePayload = &enableServiceResourcePayload + return r +} + +func (r ApiEnableServiceResourceRequest) Execute() error { + return r.ApiService.EnableServiceResourceExecute(r) +} + +/* +EnableServiceResource enable backup service + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiEnableServiceResourceRequest +*/ +func (a *DefaultAPIService) EnableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiEnableServiceResourceRequest { + return ApiEnableServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// Execute executes the request +func (a *DefaultAPIService) EnableServiceResourceExecute(r ApiEnableServiceResourceRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.EnableServiceResource") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.enableServiceResourcePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + return newErr + } + + return nil +} + +type ApiGetBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + backupId string +} + +func (r ApiGetBackupRequest) Execute() (*Backup, error) { + return r.ApiService.GetBackupExecute(r) +} + +/* +GetBackup get backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @return ApiGetBackupRequest +*/ +func (a *DefaultAPIService) GetBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +// +// @return Backup +func (a *DefaultAPIService) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Backup + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackup") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backups/{backupId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + backupScheduleId string +} + +func (r ApiGetBackupScheduleRequest) Execute() (*BackupSchedule, error) { + return r.ApiService.GetBackupScheduleExecute(r) +} + +/* +GetBackupSchedule get single backup schedule details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupScheduleId backup schedule id + @return ApiGetBackupScheduleRequest +*/ +func (a *DefaultAPIService) GetBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiGetBackupScheduleRequest { + return ApiGetBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupScheduleId: backupScheduleId, + } +} + +// Execute executes the request +// +// @return BackupSchedule +func (a *DefaultAPIService) GetBackupScheduleExecute(r ApiGetBackupScheduleRequest) (*BackupSchedule, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupSchedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetBackupSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backup-schedules/{backupScheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupScheduleId"+"}", url.PathEscape(parameterValueToString(r.backupScheduleId, "backupScheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetServiceResourceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string +} + +func (r ApiGetServiceResourceRequest) Execute() (*GetBackupServiceResponse, error) { + return r.ApiService.GetServiceResourceExecute(r) +} + +/* +GetServiceResource get backup service details + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiGetServiceResourceRequest +*/ +func (a *DefaultAPIService) GetServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiGetServiceResourceRequest { + return ApiGetServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// Execute executes the request +// +// @return GetBackupServiceResponse +func (a *DefaultAPIService) GetServiceResourceExecute(r ApiGetServiceResourceRequest) (*GetBackupServiceResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupServiceResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetServiceResource") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/service" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupPoliciesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListBackupPoliciesRequest) Execute() (*GetBackupPoliciesResponse, error) { + return r.ApiService.ListBackupPoliciesExecute(r) +} + +/* +ListBackupPolicies get list of backup policies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @return ApiListBackupPoliciesRequest +*/ +func (a *DefaultAPIService) ListBackupPolicies(ctx context.Context, projectId string) ApiListBackupPoliciesRequest { + return ApiListBackupPoliciesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return GetBackupPoliciesResponse +func (a *DefaultAPIService) ListBackupPoliciesExecute(r ApiListBackupPoliciesRequest) (*GetBackupPoliciesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupPoliciesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackupPolicies") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/backup-policies" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupSchedulesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string +} + +func (r ApiListBackupSchedulesRequest) Execute() (*GetBackupSchedulesResponse, error) { + return r.ApiService.ListBackupSchedulesExecute(r) +} + +/* +ListBackupSchedules get list of backup schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiListBackupSchedulesRequest +*/ +func (a *DefaultAPIService) ListBackupSchedules(ctx context.Context, projectId string, serverId string, region string) ApiListBackupSchedulesRequest { + return ApiListBackupSchedulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// Execute executes the request +// +// @return GetBackupSchedulesResponse +func (a *DefaultAPIService) ListBackupSchedulesExecute(r ApiListBackupSchedulesRequest) (*GetBackupSchedulesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupSchedulesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackupSchedules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backup-schedules" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListBackupsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string +} + +func (r ApiListBackupsRequest) Execute() (*GetBackupsListResponse, error) { + return r.ApiService.ListBackupsExecute(r) +} + +/* +ListBackups get list of backups + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @return ApiListBackupsRequest +*/ +func (a *DefaultAPIService) ListBackups(ctx context.Context, projectId string, serverId string, region string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// Execute executes the request +// +// @return GetBackupsListResponse +func (a *DefaultAPIService) ListBackupsExecute(r ApiListBackupsRequest) (*GetBackupsListResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetBackupsListResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListBackups") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backups" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiRestoreBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + backupId string + restoreBackupPayload *RestoreBackupPayload +} + +func (r ApiRestoreBackupRequest) RestoreBackupPayload(restoreBackupPayload RestoreBackupPayload) ApiRestoreBackupRequest { + r.restoreBackupPayload = &restoreBackupPayload + return r +} + +func (r ApiRestoreBackupRequest) Execute() error { + return r.ApiService.RestoreBackupExecute(r) +} + +/* +RestoreBackup trigger restore of the requested backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @return ApiRestoreBackupRequest +*/ +func (a *DefaultAPIService) RestoreBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backups/{backupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.restoreBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + return newErr + } + + return nil +} + +type ApiRestoreVolumeBackupRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + backupId string + volumeBackupId string + restoreVolumeBackupPayload *RestoreVolumeBackupPayload +} + +func (r ApiRestoreVolumeBackupRequest) RestoreVolumeBackupPayload(restoreVolumeBackupPayload RestoreVolumeBackupPayload) ApiRestoreVolumeBackupRequest { + r.restoreVolumeBackupPayload = &restoreVolumeBackupPayload + return r +} + +func (r ApiRestoreVolumeBackupRequest) Execute() error { + return r.ApiService.RestoreVolumeBackupExecute(r) +} + +/* +RestoreVolumeBackup trigger restore of the requested volume backup + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupId id of the backup + @param volumeBackupId id of the volume backup + @return ApiRestoreVolumeBackupRequest +*/ +func (a *DefaultAPIService) RestoreVolumeBackup(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) ApiRestoreVolumeBackupRequest { + return ApiRestoreVolumeBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + volumeBackupId: volumeBackupId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) RestoreVolumeBackupExecute(r ApiRestoreVolumeBackupRequest) error { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.RestoreVolumeBackup") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backups/{backupId}/volume-backups/{volumeBackupId}/restore" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupId"+"}", url.PathEscape(parameterValueToString(r.backupId, "backupId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"volumeBackupId"+"}", url.PathEscape(parameterValueToString(r.volumeBackupId, "volumeBackupId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.restoreVolumeBackupPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + return newErr + } + + return nil +} + +type ApiUpdateBackupScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + serverId string + region string + backupScheduleId string + updateBackupSchedulePayload *UpdateBackupSchedulePayload +} + +func (r ApiUpdateBackupScheduleRequest) UpdateBackupSchedulePayload(updateBackupSchedulePayload UpdateBackupSchedulePayload) ApiUpdateBackupScheduleRequest { + r.updateBackupSchedulePayload = &updateBackupSchedulePayload + return r +} + +func (r ApiUpdateBackupScheduleRequest) Execute() (*BackupSchedule, error) { + return r.ApiService.UpdateBackupScheduleExecute(r) +} + +/* +UpdateBackupSchedule update backup schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId project id + @param serverId server id + @param region region + @param backupScheduleId backup schedule id + @return ApiUpdateBackupScheduleRequest +*/ +func (a *DefaultAPIService) UpdateBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiUpdateBackupScheduleRequest { + return ApiUpdateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupScheduleId: backupScheduleId, + } +} + +// Execute executes the request +// +// @return BackupSchedule +func (a *DefaultAPIService) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) (*BackupSchedule, error) { + var ( + localVarHTTPMethod = http.MethodPut + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *BackupSchedule + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.UpdateBackupSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v2/projects/{projectId}/regions/{region}/servers/{serverId}/backup-schedules/{backupScheduleId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"serverId"+"}", url.PathEscape(parameterValueToString(r.serverId, "serverId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"backupScheduleId"+"}", url.PathEscape(parameterValueToString(r.backupScheduleId, "backupScheduleId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.updateBackupSchedulePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 401 { + var v ErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/serverbackup/v2api/api_default_mock.go b/services/serverbackup/v2api/api_default_mock.go new file mode 100644 index 000000000..84446685c --- /dev/null +++ b/services/serverbackup/v2api/api_default_mock.go @@ -0,0 +1,377 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateBackupExecuteMock can be populated to implement the behavior of the CreateBackupExecute function of this mock + CreateBackupExecuteMock *func(r ApiCreateBackupRequest) (*BackupJob, error) + // CreateBackupScheduleExecuteMock can be populated to implement the behavior of the CreateBackupScheduleExecute function of this mock + CreateBackupScheduleExecuteMock *func(r ApiCreateBackupScheduleRequest) (*BackupSchedule, error) + // DeleteBackupExecuteMock can be populated to implement the behavior of the DeleteBackupExecute function of this mock + DeleteBackupExecuteMock *func(r ApiDeleteBackupRequest) error + // DeleteBackupScheduleExecuteMock can be populated to implement the behavior of the DeleteBackupScheduleExecute function of this mock + DeleteBackupScheduleExecuteMock *func(r ApiDeleteBackupScheduleRequest) error + // DeleteVolumeBackupExecuteMock can be populated to implement the behavior of the DeleteVolumeBackupExecute function of this mock + DeleteVolumeBackupExecuteMock *func(r ApiDeleteVolumeBackupRequest) error + // DisableServiceResourceExecuteMock can be populated to implement the behavior of the DisableServiceResourceExecute function of this mock + DisableServiceResourceExecuteMock *func(r ApiDisableServiceResourceRequest) error + // EnableServiceResourceExecuteMock can be populated to implement the behavior of the EnableServiceResourceExecute function of this mock + EnableServiceResourceExecuteMock *func(r ApiEnableServiceResourceRequest) error + // GetBackupExecuteMock can be populated to implement the behavior of the GetBackupExecute function of this mock + GetBackupExecuteMock *func(r ApiGetBackupRequest) (*Backup, error) + // GetBackupScheduleExecuteMock can be populated to implement the behavior of the GetBackupScheduleExecute function of this mock + GetBackupScheduleExecuteMock *func(r ApiGetBackupScheduleRequest) (*BackupSchedule, error) + // GetServiceResourceExecuteMock can be populated to implement the behavior of the GetServiceResourceExecute function of this mock + GetServiceResourceExecuteMock *func(r ApiGetServiceResourceRequest) (*GetBackupServiceResponse, error) + // ListBackupPoliciesExecuteMock can be populated to implement the behavior of the ListBackupPoliciesExecute function of this mock + ListBackupPoliciesExecuteMock *func(r ApiListBackupPoliciesRequest) (*GetBackupPoliciesResponse, error) + // ListBackupSchedulesExecuteMock can be populated to implement the behavior of the ListBackupSchedulesExecute function of this mock + ListBackupSchedulesExecuteMock *func(r ApiListBackupSchedulesRequest) (*GetBackupSchedulesResponse, error) + // ListBackupsExecuteMock can be populated to implement the behavior of the ListBackupsExecute function of this mock + ListBackupsExecuteMock *func(r ApiListBackupsRequest) (*GetBackupsListResponse, error) + // RestoreBackupExecuteMock can be populated to implement the behavior of the RestoreBackupExecute function of this mock + RestoreBackupExecuteMock *func(r ApiRestoreBackupRequest) error + // RestoreVolumeBackupExecuteMock can be populated to implement the behavior of the RestoreVolumeBackupExecute function of this mock + RestoreVolumeBackupExecuteMock *func(r ApiRestoreVolumeBackupRequest) error + // UpdateBackupScheduleExecuteMock can be populated to implement the behavior of the UpdateBackupScheduleExecute function of this mock + UpdateBackupScheduleExecuteMock *func(r ApiUpdateBackupScheduleRequest) (*BackupSchedule, error) +} + +func (a DefaultAPIServiceMock) CreateBackup(ctx context.Context, projectId string, serverId string, region string) ApiCreateBackupRequest { + return ApiCreateBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// CreateBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupExecute(r ApiCreateBackupRequest) (*BackupJob, error) { + if a.CreateBackupExecuteMock == nil { + var localVarReturnValue *BackupJob + return localVarReturnValue, nil + } + + return (*a.CreateBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateBackupSchedule(ctx context.Context, projectId string, serverId string, region string) ApiCreateBackupScheduleRequest { + return ApiCreateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// CreateBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateBackupScheduleExecute(r ApiCreateBackupScheduleRequest) (*BackupSchedule, error) { + if a.CreateBackupScheduleExecuteMock == nil { + var localVarReturnValue *BackupSchedule + return localVarReturnValue, nil + } + + return (*a.CreateBackupScheduleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiDeleteBackupRequest { + return ApiDeleteBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + } +} + +// DeleteBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteBackupExecute(r ApiDeleteBackupRequest) error { + if a.DeleteBackupExecuteMock == nil { + return nil + } + + return (*a.DeleteBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiDeleteBackupScheduleRequest { + return ApiDeleteBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupScheduleId: backupScheduleId, + } +} + +// DeleteBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteBackupScheduleExecute(r ApiDeleteBackupScheduleRequest) error { + if a.DeleteBackupScheduleExecuteMock == nil { + return nil + } + + return (*a.DeleteBackupScheduleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteVolumeBackup(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) ApiDeleteVolumeBackupRequest { + return ApiDeleteVolumeBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + volumeBackupId: volumeBackupId, + } +} + +// DeleteVolumeBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteVolumeBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteVolumeBackupExecute(r ApiDeleteVolumeBackupRequest) error { + if a.DeleteVolumeBackupExecuteMock == nil { + return nil + } + + return (*a.DeleteVolumeBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DisableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiDisableServiceResourceRequest { + return ApiDisableServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// DisableServiceResourceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DisableServiceResourceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DisableServiceResourceExecute(r ApiDisableServiceResourceRequest) error { + if a.DisableServiceResourceExecuteMock == nil { + return nil + } + + return (*a.DisableServiceResourceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) EnableServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiEnableServiceResourceRequest { + return ApiEnableServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// EnableServiceResourceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the EnableServiceResourceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) EnableServiceResourceExecute(r ApiEnableServiceResourceRequest) error { + if a.EnableServiceResourceExecuteMock == nil { + return nil + } + + return (*a.EnableServiceResourceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiGetBackupRequest { + return ApiGetBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + } +} + +// GetBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupExecute(r ApiGetBackupRequest) (*Backup, error) { + if a.GetBackupExecuteMock == nil { + var localVarReturnValue *Backup + return localVarReturnValue, nil + } + + return (*a.GetBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiGetBackupScheduleRequest { + return ApiGetBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupScheduleId: backupScheduleId, + } +} + +// GetBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetBackupScheduleExecute(r ApiGetBackupScheduleRequest) (*BackupSchedule, error) { + if a.GetBackupScheduleExecuteMock == nil { + var localVarReturnValue *BackupSchedule + return localVarReturnValue, nil + } + + return (*a.GetBackupScheduleExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetServiceResource(ctx context.Context, projectId string, serverId string, region string) ApiGetServiceResourceRequest { + return ApiGetServiceResourceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// GetServiceResourceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetServiceResourceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetServiceResourceExecute(r ApiGetServiceResourceRequest) (*GetBackupServiceResponse, error) { + if a.GetServiceResourceExecuteMock == nil { + var localVarReturnValue *GetBackupServiceResponse + return localVarReturnValue, nil + } + + return (*a.GetServiceResourceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackupPolicies(ctx context.Context, projectId string) ApiListBackupPoliciesRequest { + return ApiListBackupPoliciesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListBackupPoliciesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupPoliciesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupPoliciesExecute(r ApiListBackupPoliciesRequest) (*GetBackupPoliciesResponse, error) { + if a.ListBackupPoliciesExecuteMock == nil { + var localVarReturnValue *GetBackupPoliciesResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupPoliciesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackupSchedules(ctx context.Context, projectId string, serverId string, region string) ApiListBackupSchedulesRequest { + return ApiListBackupSchedulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// ListBackupSchedulesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupSchedulesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupSchedulesExecute(r ApiListBackupSchedulesRequest) (*GetBackupSchedulesResponse, error) { + if a.ListBackupSchedulesExecuteMock == nil { + var localVarReturnValue *GetBackupSchedulesResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupSchedulesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListBackups(ctx context.Context, projectId string, serverId string, region string) ApiListBackupsRequest { + return ApiListBackupsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + } +} + +// ListBackupsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListBackupsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListBackupsExecute(r ApiListBackupsRequest) (*GetBackupsListResponse, error) { + if a.ListBackupsExecuteMock == nil { + var localVarReturnValue *GetBackupsListResponse + return localVarReturnValue, nil + } + + return (*a.ListBackupsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RestoreBackup(ctx context.Context, projectId string, serverId string, region string, backupId string) ApiRestoreBackupRequest { + return ApiRestoreBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + } +} + +// RestoreBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreBackupExecute(r ApiRestoreBackupRequest) error { + if a.RestoreBackupExecuteMock == nil { + return nil + } + + return (*a.RestoreBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) RestoreVolumeBackup(ctx context.Context, projectId string, serverId string, region string, backupId string, volumeBackupId string) ApiRestoreVolumeBackupRequest { + return ApiRestoreVolumeBackupRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupId: backupId, + volumeBackupId: volumeBackupId, + } +} + +// RestoreVolumeBackupExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the RestoreVolumeBackupExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) RestoreVolumeBackupExecute(r ApiRestoreVolumeBackupRequest) error { + if a.RestoreVolumeBackupExecuteMock == nil { + return nil + } + + return (*a.RestoreVolumeBackupExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) UpdateBackupSchedule(ctx context.Context, projectId string, serverId string, region string, backupScheduleId string) ApiUpdateBackupScheduleRequest { + return ApiUpdateBackupScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + serverId: serverId, + region: region, + backupScheduleId: backupScheduleId, + } +} + +// UpdateBackupScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the UpdateBackupScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) UpdateBackupScheduleExecute(r ApiUpdateBackupScheduleRequest) (*BackupSchedule, error) { + if a.UpdateBackupScheduleExecuteMock == nil { + var localVarReturnValue *BackupSchedule + return localVarReturnValue, nil + } + + return (*a.UpdateBackupScheduleExecuteMock)(r) +} diff --git a/services/serverbackup/v2api/client.go b/services/serverbackup/v2api/client.go new file mode 100644 index 000000000..c815df3ee --- /dev/null +++ b/services/serverbackup/v2api/client.go @@ -0,0 +1,659 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Server Backup Management API API v2.0 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/serverbackup/v2api/configuration.go b/services/serverbackup/v2api/configuration.go new file mode 100644 index 000000000..4291b003a --- /dev/null +++ b/services/serverbackup/v2api/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v2api + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/serverbackup", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://server-backup.api.stackit.cloud", + Description: "No description provided", + Variables: map[string]config.ServerVariable{ + "region": { + Description: "No description provided", + DefaultValue: "global", + }, + }, + }, + }, + OperationServers: map[string]config.ServerConfigurations{}, + } + return cfg +} diff --git a/services/serverbackup/v2api/model_backup.go b/services/serverbackup/v2api/model_backup.go new file mode 100644 index 000000000..5c2875149 --- /dev/null +++ b/services/serverbackup/v2api/model_backup.go @@ -0,0 +1,377 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Backup type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Backup{} + +// Backup struct for Backup +type Backup struct { + CreatedAt string `json:"createdAt"` + ExpireAt string `json:"expireAt"` + Id string `json:"id"` + LastRestoredAt *string `json:"lastRestoredAt,omitempty"` + Name string `json:"name"` + Size *int32 `json:"size,omitempty"` + 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() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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() (*int32, 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 int32 and assigns it to the Size field. +func (o *Backup) SetSize(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *Backup) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "createdAt", + "expireAt", + "id", + "name", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackup := _Backup{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackup) + + if err != nil { + return err + } + + *o = Backup(varBackup) + + return err +} + +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/v2api/model_backup_job.go b/services/serverbackup/v2api/model_backup_job.go new file mode 100644 index 000000000..cd743ab7e --- /dev/null +++ b/services/serverbackup/v2api/model_backup_job.go @@ -0,0 +1,157 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the BackupJob type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupJob{} + +// BackupJob struct for BackupJob +type BackupJob struct { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupJob) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["id"] = o.Id + return toSerialize, nil +} + +func (o *BackupJob) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "id", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupJob := _BackupJob{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupJob) + + if err != nil { + return err + } + + *o = BackupJob(varBackupJob) + + return err +} + +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/v2api/model_backup_policy.go b/services/serverbackup/v2api/model_backup_policy.go new file mode 100644 index 000000000..c2f1faf9c --- /dev/null +++ b/services/serverbackup/v2api/model_backup_policy.go @@ -0,0 +1,342 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the BackupPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupPolicy{} + +// BackupPolicy struct for BackupPolicy +type BackupPolicy struct { + BackupProperties *BackupPolicyBackupProperties `json:"backupProperties,omitempty"` + Default *bool `json:"default,omitempty"` + Description *string `json:"description,omitempty"` + Enabled *bool `json:"enabled,omitempty"` + Id *string `json:"id,omitempty"` + Name *string `json:"name,omitempty"` + // An rrule (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates + Rrule *string `json:"rrule,omitempty"` +} + +// NewBackupPolicy instantiates a new BackupPolicy 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 NewBackupPolicy() *BackupPolicy { + this := BackupPolicy{} + return &this +} + +// NewBackupPolicyWithDefaults instantiates a new BackupPolicy 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 NewBackupPolicyWithDefaults() *BackupPolicy { + this := BackupPolicy{} + return &this +} + +// GetBackupProperties returns the BackupProperties field value if set, zero value otherwise. +func (o *BackupPolicy) GetBackupProperties() BackupPolicyBackupProperties { + if o == nil || IsNil(o.BackupProperties) { + var ret BackupPolicyBackupProperties + 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 *BackupPolicy) GetBackupPropertiesOk() (*BackupPolicyBackupProperties, 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 *BackupPolicy) HasBackupProperties() bool { + if o != nil && !IsNil(o.BackupProperties) { + return true + } + + return false +} + +// SetBackupProperties gets a reference to the given BackupPolicyBackupProperties and assigns it to the BackupProperties field. +func (o *BackupPolicy) SetBackupProperties(v BackupPolicyBackupProperties) { + o.BackupProperties = &v +} + +// GetDefault returns the Default field value if set, zero value otherwise. +func (o *BackupPolicy) GetDefault() bool { + if o == nil || IsNil(o.Default) { + var ret bool + return ret + } + return *o.Default +} + +// GetDefaultOk returns a tuple with the Default field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicy) GetDefaultOk() (*bool, bool) { + if o == nil || IsNil(o.Default) { + return nil, false + } + return o.Default, true +} + +// HasDefault returns a boolean if a field has been set. +func (o *BackupPolicy) HasDefault() bool { + if o != nil && !IsNil(o.Default) { + return true + } + + return false +} + +// SetDefault gets a reference to the given bool and assigns it to the Default field. +func (o *BackupPolicy) SetDefault(v bool) { + o.Default = &v +} + +// GetDescription returns the Description field value if set, zero value otherwise. +func (o *BackupPolicy) GetDescription() string { + if o == nil || IsNil(o.Description) { + var ret string + return ret + } + return *o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicy) GetDescriptionOk() (*string, bool) { + if o == nil || IsNil(o.Description) { + return nil, false + } + return o.Description, true +} + +// HasDescription returns a boolean if a field has been set. +func (o *BackupPolicy) HasDescription() bool { + if o != nil && !IsNil(o.Description) { + return true + } + + return false +} + +// SetDescription gets a reference to the given string and assigns it to the Description field. +func (o *BackupPolicy) SetDescription(v string) { + o.Description = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *BackupPolicy) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicy) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *BackupPolicy) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *BackupPolicy) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *BackupPolicy) 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 *BackupPolicy) 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 *BackupPolicy) 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 *BackupPolicy) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BackupPolicy) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// 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 *BackupPolicy) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *BackupPolicy) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *BackupPolicy) SetName(v string) { + o.Name = &v +} + +// GetRrule returns the Rrule field value if set, zero value otherwise. +func (o *BackupPolicy) GetRrule() string { + if o == nil || IsNil(o.Rrule) { + var ret string + return ret + } + return *o.Rrule +} + +// GetRruleOk returns a tuple with the Rrule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicy) GetRruleOk() (*string, bool) { + if o == nil || IsNil(o.Rrule) { + return nil, false + } + return o.Rrule, true +} + +// HasRrule returns a boolean if a field has been set. +func (o *BackupPolicy) HasRrule() bool { + if o != nil && !IsNil(o.Rrule) { + return true + } + + return false +} + +// SetRrule gets a reference to the given string and assigns it to the Rrule field. +func (o *BackupPolicy) SetRrule(v string) { + o.Rrule = &v +} + +func (o BackupPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupProperties) { + toSerialize["backupProperties"] = o.BackupProperties + } + if !IsNil(o.Default) { + toSerialize["default"] = o.Default + } + if !IsNil(o.Description) { + toSerialize["description"] = o.Description + } + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.Rrule) { + toSerialize["rrule"] = o.Rrule + } + return toSerialize, nil +} + +type NullableBackupPolicy struct { + value *BackupPolicy + isSet bool +} + +func (v NullableBackupPolicy) Get() *BackupPolicy { + return v.value +} + +func (v *NullableBackupPolicy) Set(val *BackupPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableBackupPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupPolicy(val *BackupPolicy) *NullableBackupPolicy { + return &NullableBackupPolicy{value: val, isSet: true} +} + +func (v NullableBackupPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_backup_policy_backup_properties.go b/services/serverbackup/v2api/model_backup_policy_backup_properties.go new file mode 100644 index 000000000..0dc5ee13d --- /dev/null +++ b/services/serverbackup/v2api/model_backup_policy_backup_properties.go @@ -0,0 +1,161 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the BackupPolicyBackupProperties type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BackupPolicyBackupProperties{} + +// BackupPolicyBackupProperties struct for BackupPolicyBackupProperties +type BackupPolicyBackupProperties struct { + Name *string `json:"name,omitempty"` + RetentionPeriod *int32 `json:"retentionPeriod,omitempty"` +} + +// NewBackupPolicyBackupProperties instantiates a new BackupPolicyBackupProperties 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 NewBackupPolicyBackupProperties() *BackupPolicyBackupProperties { + this := BackupPolicyBackupProperties{} + return &this +} + +// NewBackupPolicyBackupPropertiesWithDefaults instantiates a new BackupPolicyBackupProperties 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 NewBackupPolicyBackupPropertiesWithDefaults() *BackupPolicyBackupProperties { + this := BackupPolicyBackupProperties{} + return &this +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *BackupPolicyBackupProperties) GetName() string { + if o == nil || IsNil(o.Name) { + var ret string + return ret + } + return *o.Name +} + +// 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 *BackupPolicyBackupProperties) GetNameOk() (*string, bool) { + if o == nil || IsNil(o.Name) { + return nil, false + } + return o.Name, true +} + +// HasName returns a boolean if a field has been set. +func (o *BackupPolicyBackupProperties) HasName() bool { + if o != nil && !IsNil(o.Name) { + return true + } + + return false +} + +// SetName gets a reference to the given string and assigns it to the Name field. +func (o *BackupPolicyBackupProperties) SetName(v string) { + o.Name = &v +} + +// GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. +func (o *BackupPolicyBackupProperties) GetRetentionPeriod() int32 { + if o == nil || IsNil(o.RetentionPeriod) { + var ret int32 + return ret + } + return *o.RetentionPeriod +} + +// GetRetentionPeriodOk returns a tuple with the RetentionPeriod field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BackupPolicyBackupProperties) GetRetentionPeriodOk() (*int32, bool) { + if o == nil || IsNil(o.RetentionPeriod) { + return nil, false + } + return o.RetentionPeriod, true +} + +// HasRetentionPeriod returns a boolean if a field has been set. +func (o *BackupPolicyBackupProperties) HasRetentionPeriod() bool { + if o != nil && !IsNil(o.RetentionPeriod) { + return true + } + + return false +} + +// SetRetentionPeriod gets a reference to the given int32 and assigns it to the RetentionPeriod field. +func (o *BackupPolicyBackupProperties) SetRetentionPeriod(v int32) { + o.RetentionPeriod = &v +} + +func (o BackupPolicyBackupProperties) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BackupPolicyBackupProperties) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + if !IsNil(o.RetentionPeriod) { + toSerialize["retentionPeriod"] = o.RetentionPeriod + } + return toSerialize, nil +} + +type NullableBackupPolicyBackupProperties struct { + value *BackupPolicyBackupProperties + isSet bool +} + +func (v NullableBackupPolicyBackupProperties) Get() *BackupPolicyBackupProperties { + return v.value +} + +func (v *NullableBackupPolicyBackupProperties) Set(val *BackupPolicyBackupProperties) { + v.value = val + v.isSet = true +} + +func (v NullableBackupPolicyBackupProperties) IsSet() bool { + return v.isSet +} + +func (v *NullableBackupPolicyBackupProperties) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBackupPolicyBackupProperties(val *BackupPolicyBackupProperties) *NullableBackupPolicyBackupProperties { + return &NullableBackupPolicyBackupProperties{value: val, isSet: true} +} + +func (v NullableBackupPolicyBackupProperties) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBackupPolicyBackupProperties) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_backup_properties.go b/services/serverbackup/v2api/model_backup_properties.go new file mode 100644 index 000000000..e7c112db5 --- /dev/null +++ b/services/serverbackup/v2api/model_backup_properties.go @@ -0,0 +1,223 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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 + Name string `json:"name"` + // Values are set in days (1-36500) + RetentionPeriod int32 `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 int32) *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() int32 { + if o == nil { + var ret int32 + 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() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RetentionPeriod, true +} + +// SetRetentionPeriod sets field value +func (o *BackupProperties) SetRetentionPeriod(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *BackupProperties) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "retentionPeriod", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupProperties := _BackupProperties{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupProperties) + + if err != nil { + return err + } + + *o = BackupProperties(varBackupProperties) + + return err +} + +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/v2api/model_backup_schedule.go b/services/serverbackup/v2api/model_backup_schedule.go new file mode 100644 index 000000000..8319da919 --- /dev/null +++ b/services/serverbackup/v2api/model_backup_schedule.go @@ -0,0 +1,278 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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"` + Enabled bool `json:"enabled"` + Id int32 `json:"id"` + Name string `json:"name"` + // An rrule (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates + 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 int32, 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() int32 { + if o == nil { + var ret int32 + 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() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *BackupSchedule) SetId(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *BackupSchedule) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + "id", + "name", + "rrule", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varBackupSchedule := _BackupSchedule{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varBackupSchedule) + + if err != nil { + return err + } + + *o = BackupSchedule(varBackupSchedule) + + return err +} + +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/v2api/model_backup_volume_backups_inner.go b/services/serverbackup/v2api/model_backup_volume_backups_inner.go new file mode 100644 index 000000000..55e360ace --- /dev/null +++ b/services/serverbackup/v2api/model_backup_volume_backups_inner.go @@ -0,0 +1,305 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +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"` + LastRestoredAt *string `json:"lastRestoredAt,omitempty"` + LastRestoredVolumeId *string `json:"lastRestoredVolumeId,omitempty"` + Size *int32 `json:"size,omitempty"` + 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() int32 { + if o == nil || IsNil(o.Size) { + var ret int32 + 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() (*int32, 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 int32 and assigns it to the Size field. +func (o *BackupVolumeBackupsInner) SetSize(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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/v2api/model_create_backup_payload.go b/services/serverbackup/v2api/model_create_backup_payload.go new file mode 100644 index 000000000..d1d50eb79 --- /dev/null +++ b/services/serverbackup/v2api/model_create_backup_payload.go @@ -0,0 +1,223 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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 + Name string `json:"name"` + // Values are set in days (1-36500) + RetentionPeriod int32 `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 int32) *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() int32 { + if o == nil { + var ret int32 + 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() (*int32, bool) { + if o == nil { + return nil, false + } + return &o.RetentionPeriod, true +} + +// SetRetentionPeriod sets field value +func (o *CreateBackupPayload) SetRetentionPeriod(v int32) { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *CreateBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + "retentionPeriod", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupPayload := _CreateBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateBackupPayload) + + if err != nil { + return err + } + + *o = CreateBackupPayload(varCreateBackupPayload) + + return err +} + +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/v2api/model_create_backup_schedule_payload.go b/services/serverbackup/v2api/model_create_backup_schedule_payload.go new file mode 100644 index 000000000..dd606f61f --- /dev/null +++ b/services/serverbackup/v2api/model_create_backup_schedule_payload.go @@ -0,0 +1,251 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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"` + Enabled bool `json:"enabled"` + // Max 255 characters + Name string `json:"name"` + // An rrule (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *CreateBackupSchedulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + "name", + "rrule", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateBackupSchedulePayload := _CreateBackupSchedulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateBackupSchedulePayload) + + if err != nil { + return err + } + + *o = CreateBackupSchedulePayload(varCreateBackupSchedulePayload) + + return err +} + +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/v2api/model_enable_service_resource_payload.go b/services/serverbackup/v2api/model_enable_service_resource_payload.go new file mode 100644 index 000000000..dd9a98e9a --- /dev/null +++ b/services/serverbackup/v2api/model_enable_service_resource_payload.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the EnableServiceResourcePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &EnableServiceResourcePayload{} + +// EnableServiceResourcePayload struct for EnableServiceResourcePayload +type EnableServiceResourcePayload struct { + BackupPolicyId *string `json:"backupPolicyId,omitempty"` +} + +// NewEnableServiceResourcePayload instantiates a new EnableServiceResourcePayload 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 NewEnableServiceResourcePayload() *EnableServiceResourcePayload { + this := EnableServiceResourcePayload{} + return &this +} + +// NewEnableServiceResourcePayloadWithDefaults instantiates a new EnableServiceResourcePayload 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 NewEnableServiceResourcePayloadWithDefaults() *EnableServiceResourcePayload { + this := EnableServiceResourcePayload{} + return &this +} + +// GetBackupPolicyId returns the BackupPolicyId field value if set, zero value otherwise. +func (o *EnableServiceResourcePayload) 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 *EnableServiceResourcePayload) 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 *EnableServiceResourcePayload) 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 *EnableServiceResourcePayload) SetBackupPolicyId(v string) { + o.BackupPolicyId = &v +} + +func (o EnableServiceResourcePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o EnableServiceResourcePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.BackupPolicyId) { + toSerialize["backupPolicyId"] = o.BackupPolicyId + } + return toSerialize, nil +} + +type NullableEnableServiceResourcePayload struct { + value *EnableServiceResourcePayload + isSet bool +} + +func (v NullableEnableServiceResourcePayload) Get() *EnableServiceResourcePayload { + return v.value +} + +func (v *NullableEnableServiceResourcePayload) Set(val *EnableServiceResourcePayload) { + v.value = val + v.isSet = true +} + +func (v NullableEnableServiceResourcePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableEnableServiceResourcePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableEnableServiceResourcePayload(val *EnableServiceResourcePayload) *NullableEnableServiceResourcePayload { + return &NullableEnableServiceResourcePayload{value: val, isSet: true} +} + +func (v NullableEnableServiceResourcePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableEnableServiceResourcePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_error_response.go b/services/serverbackup/v2api/model_error_response.go new file mode 100644 index 000000000..85ca8a273 --- /dev/null +++ b/services/serverbackup/v2api/model_error_response.go @@ -0,0 +1,187 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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 + Message string `json:"message"` + // The string representation of the http status code (i.e. Not Found, Bad Request, etc) + Status string `json:"status"` +} + +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) *ErrorResponse { + this := ErrorResponse{} + this.Message = message + this.Status = status + 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 +} + +func (o ErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *ErrorResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varErrorResponse := _ErrorResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varErrorResponse) + + if err != nil { + return err + } + + *o = ErrorResponse(varErrorResponse) + + return err +} + +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/v2api/model_get_backup_policies_response.go b/services/serverbackup/v2api/model_get_backup_policies_response.go new file mode 100644 index 000000000..0ac9644e6 --- /dev/null +++ b/services/serverbackup/v2api/model_get_backup_policies_response.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the GetBackupPoliciesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupPoliciesResponse{} + +// GetBackupPoliciesResponse struct for GetBackupPoliciesResponse +type GetBackupPoliciesResponse struct { + Items []BackupPolicy `json:"items,omitempty"` +} + +// NewGetBackupPoliciesResponse instantiates a new GetBackupPoliciesResponse 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 NewGetBackupPoliciesResponse() *GetBackupPoliciesResponse { + this := GetBackupPoliciesResponse{} + return &this +} + +// NewGetBackupPoliciesResponseWithDefaults instantiates a new GetBackupPoliciesResponse 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 NewGetBackupPoliciesResponseWithDefaults() *GetBackupPoliciesResponse { + this := GetBackupPoliciesResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *GetBackupPoliciesResponse) GetItems() []BackupPolicy { + if o == nil || IsNil(o.Items) { + var ret []BackupPolicy + 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 *GetBackupPoliciesResponse) GetItemsOk() ([]BackupPolicy, 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 *GetBackupPoliciesResponse) HasItems() bool { + if o != nil && !IsNil(o.Items) { + return true + } + + return false +} + +// SetItems gets a reference to the given []BackupPolicy and assigns it to the Items field. +func (o *GetBackupPoliciesResponse) SetItems(v []BackupPolicy) { + o.Items = v +} + +func (o GetBackupPoliciesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupPoliciesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableGetBackupPoliciesResponse struct { + value *GetBackupPoliciesResponse + isSet bool +} + +func (v NullableGetBackupPoliciesResponse) Get() *GetBackupPoliciesResponse { + return v.value +} + +func (v *NullableGetBackupPoliciesResponse) Set(val *GetBackupPoliciesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupPoliciesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupPoliciesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupPoliciesResponse(val *GetBackupPoliciesResponse) *NullableGetBackupPoliciesResponse { + return &NullableGetBackupPoliciesResponse{value: val, isSet: true} +} + +func (v NullableGetBackupPoliciesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupPoliciesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_get_backup_schedules_response.go b/services/serverbackup/v2api/model_get_backup_schedules_response.go new file mode 100644 index 000000000..63e9859b2 --- /dev/null +++ b/services/serverbackup/v2api/model_get_backup_schedules_response.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the GetBackupSchedulesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupSchedulesResponse{} + +// GetBackupSchedulesResponse struct for GetBackupSchedulesResponse +type GetBackupSchedulesResponse struct { + Items []BackupSchedule `json:"items,omitempty"` +} + +// NewGetBackupSchedulesResponse instantiates a new GetBackupSchedulesResponse 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 NewGetBackupSchedulesResponse() *GetBackupSchedulesResponse { + this := GetBackupSchedulesResponse{} + return &this +} + +// NewGetBackupSchedulesResponseWithDefaults instantiates a new GetBackupSchedulesResponse 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 NewGetBackupSchedulesResponseWithDefaults() *GetBackupSchedulesResponse { + this := GetBackupSchedulesResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *GetBackupSchedulesResponse) 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 *GetBackupSchedulesResponse) 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 *GetBackupSchedulesResponse) 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 *GetBackupSchedulesResponse) SetItems(v []BackupSchedule) { + o.Items = v +} + +func (o GetBackupSchedulesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupSchedulesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableGetBackupSchedulesResponse struct { + value *GetBackupSchedulesResponse + isSet bool +} + +func (v NullableGetBackupSchedulesResponse) Get() *GetBackupSchedulesResponse { + return v.value +} + +func (v *NullableGetBackupSchedulesResponse) Set(val *GetBackupSchedulesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupSchedulesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupSchedulesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupSchedulesResponse(val *GetBackupSchedulesResponse) *NullableGetBackupSchedulesResponse { + return &NullableGetBackupSchedulesResponse{value: val, isSet: true} +} + +func (v NullableGetBackupSchedulesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupSchedulesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_get_backup_service_response.go b/services/serverbackup/v2api/model_get_backup_service_response.go new file mode 100644 index 000000000..257c43425 --- /dev/null +++ b/services/serverbackup/v2api/model_get_backup_service_response.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the GetBackupServiceResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupServiceResponse{} + +// GetBackupServiceResponse struct for GetBackupServiceResponse +type GetBackupServiceResponse struct { + Enabled *bool `json:"enabled,omitempty"` +} + +// NewGetBackupServiceResponse instantiates a new GetBackupServiceResponse 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 NewGetBackupServiceResponse() *GetBackupServiceResponse { + this := GetBackupServiceResponse{} + return &this +} + +// NewGetBackupServiceResponseWithDefaults instantiates a new GetBackupServiceResponse 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 NewGetBackupServiceResponseWithDefaults() *GetBackupServiceResponse { + this := GetBackupServiceResponse{} + return &this +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *GetBackupServiceResponse) GetEnabled() bool { + if o == nil || IsNil(o.Enabled) { + var ret bool + return ret + } + return *o.Enabled +} + +// GetEnabledOk returns a tuple with the Enabled field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetBackupServiceResponse) GetEnabledOk() (*bool, bool) { + if o == nil || IsNil(o.Enabled) { + return nil, false + } + return o.Enabled, true +} + +// HasEnabled returns a boolean if a field has been set. +func (o *GetBackupServiceResponse) HasEnabled() bool { + if o != nil && !IsNil(o.Enabled) { + return true + } + + return false +} + +// SetEnabled gets a reference to the given bool and assigns it to the Enabled field. +func (o *GetBackupServiceResponse) SetEnabled(v bool) { + o.Enabled = &v +} + +func (o GetBackupServiceResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupServiceResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Enabled) { + toSerialize["enabled"] = o.Enabled + } + return toSerialize, nil +} + +type NullableGetBackupServiceResponse struct { + value *GetBackupServiceResponse + isSet bool +} + +func (v NullableGetBackupServiceResponse) Get() *GetBackupServiceResponse { + return v.value +} + +func (v *NullableGetBackupServiceResponse) Set(val *GetBackupServiceResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupServiceResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupServiceResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupServiceResponse(val *GetBackupServiceResponse) *NullableGetBackupServiceResponse { + return &NullableGetBackupServiceResponse{value: val, isSet: true} +} + +func (v NullableGetBackupServiceResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupServiceResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_get_backups_list_response.go b/services/serverbackup/v2api/model_get_backups_list_response.go new file mode 100644 index 000000000..58096d8bb --- /dev/null +++ b/services/serverbackup/v2api/model_get_backups_list_response.go @@ -0,0 +1,125 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "encoding/json" +) + +// checks if the GetBackupsListResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetBackupsListResponse{} + +// GetBackupsListResponse struct for GetBackupsListResponse +type GetBackupsListResponse struct { + Items []Backup `json:"items,omitempty"` +} + +// NewGetBackupsListResponse instantiates a new GetBackupsListResponse 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 NewGetBackupsListResponse() *GetBackupsListResponse { + this := GetBackupsListResponse{} + return &this +} + +// NewGetBackupsListResponseWithDefaults instantiates a new GetBackupsListResponse 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 NewGetBackupsListResponseWithDefaults() *GetBackupsListResponse { + this := GetBackupsListResponse{} + return &this +} + +// GetItems returns the Items field value if set, zero value otherwise. +func (o *GetBackupsListResponse) 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 *GetBackupsListResponse) 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 *GetBackupsListResponse) 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 *GetBackupsListResponse) SetItems(v []Backup) { + o.Items = v +} + +func (o GetBackupsListResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetBackupsListResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Items) { + toSerialize["items"] = o.Items + } + return toSerialize, nil +} + +type NullableGetBackupsListResponse struct { + value *GetBackupsListResponse + isSet bool +} + +func (v NullableGetBackupsListResponse) Get() *GetBackupsListResponse { + return v.value +} + +func (v *NullableGetBackupsListResponse) Set(val *GetBackupsListResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetBackupsListResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetBackupsListResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetBackupsListResponse(val *GetBackupsListResponse) *NullableGetBackupsListResponse { + return &NullableGetBackupsListResponse{value: val, isSet: true} +} + +func (v NullableGetBackupsListResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetBackupsListResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/serverbackup/v2api/model_restore_backup_payload.go b/services/serverbackup/v2api/model_restore_backup_payload.go new file mode 100644 index 000000000..015c232a8 --- /dev/null +++ b/services/serverbackup/v2api/model_restore_backup_payload.go @@ -0,0 +1,193 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RestoreBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreBackupPayload{} + +// RestoreBackupPayload struct for RestoreBackupPayload +type RestoreBackupPayload struct { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *RestoreBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "startServerAfterRestore", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestoreBackupPayload := _RestoreBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRestoreBackupPayload) + + if err != nil { + return err + } + + *o = RestoreBackupPayload(varRestoreBackupPayload) + + return err +} + +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/v2api/model_restore_volume_backup_payload.go b/services/serverbackup/v2api/model_restore_volume_backup_payload.go new file mode 100644 index 000000000..19fe8e103 --- /dev/null +++ b/services/serverbackup/v2api/model_restore_volume_backup_payload.go @@ -0,0 +1,157 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RestoreVolumeBackupPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RestoreVolumeBackupPayload{} + +// RestoreVolumeBackupPayload struct for RestoreVolumeBackupPayload +type RestoreVolumeBackupPayload struct { + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RestoreVolumeBackupPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["restoreVolumeId"] = o.RestoreVolumeId + return toSerialize, nil +} + +func (o *RestoreVolumeBackupPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "restoreVolumeId", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRestoreVolumeBackupPayload := _RestoreVolumeBackupPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRestoreVolumeBackupPayload) + + if err != nil { + return err + } + + *o = RestoreVolumeBackupPayload(varRestoreVolumeBackupPayload) + + return err +} + +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/v2api/model_update_backup_schedule_payload.go b/services/serverbackup/v2api/model_update_backup_schedule_payload.go new file mode 100644 index 000000000..17ba43ecb --- /dev/null +++ b/services/serverbackup/v2api/model_update_backup_schedule_payload.go @@ -0,0 +1,251 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// 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"` + Enabled bool `json:"enabled"` + // Max 255 characters + Name string `json:"name"` + // An rrule (Recurrence Rule) is a standardized string format used in iCalendar (RFC 5545) to define repeating events, and you can generate one by using a dedicated library or by using online generator tools to specify parameters like frequency, interval, and end dates + 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) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +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 +} + +func (o *UpdateBackupSchedulePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "enabled", + "name", + "rrule", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUpdateBackupSchedulePayload := _UpdateBackupSchedulePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUpdateBackupSchedulePayload) + + if err != nil { + return err + } + + *o = UpdateBackupSchedulePayload(varUpdateBackupSchedulePayload) + + return err +} + +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) +} diff --git a/services/serverbackup/v2api/response.go b/services/serverbackup/v2api/response.go new file mode 100644 index 000000000..aa717621a --- /dev/null +++ b/services/serverbackup/v2api/response.go @@ -0,0 +1,48 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/serverbackup/v2api/utils.go b/services/serverbackup/v2api/utils.go new file mode 100644 index 000000000..0941881ae --- /dev/null +++ b/services/serverbackup/v2api/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT Server Backup Management API + +API endpoints for Server Backup Operations on STACKIT Servers. + +API version: 2.0 +Contact: support@stackit.de +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v2api + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +}