From f90cda6605e8eb06837ae9d1f423a751fede14f2 Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Wed, 1 Apr 2026 09:56:17 +0000 Subject: [PATCH] Generate sfs --- services/sfs/api_default.go | 1048 +++++++++++++++- services/sfs/model_create_lock_response.go | 151 +++ .../sfs/model_create_lock_response_test.go | 11 + .../sfs/model_create_resource_pool_payload.go | 59 + ...te_resource_pool_response_resource_pool.go | 71 ++ ...l_create_resource_pool_snapshot_payload.go | 72 ++ ...napshot_response_resource_pool_snapshot.go | 72 ++ ...et_resource_pool_response_resource_pool.go | 71 ++ ...napshot_response_resource_pool_snapshot.go | 72 ++ services/sfs/model_get_schedule_response.go | 151 +++ .../model_get_schedule_response_schedule.go | 330 +++++ ...del_get_schedule_response_schedule_test.go | 11 + .../sfs/model_get_schedule_response_test.go | 11 + .../sfs/model_get_snapshot_policy_response.go | 151 +++ ...napshot_policy_response_snapshot_policy.go | 448 +++++++ ...ot_policy_response_snapshot_policy_test.go | 11 + ...model_get_snapshot_policy_response_test.go | 11 + services/sfs/model_list_schedules_response.go | 152 +++ .../sfs/model_list_schedules_response_test.go | 11 + .../model_list_snapshot_policies_response.go | 152 +++ ...el_list_snapshot_policies_response_test.go | 11 + services/sfs/model_resource_pool.go | 71 ++ services/sfs/model_resource_pool_snapshot.go | 72 ++ .../model_resource_pool_snapshot_policy.go | 211 ++++ ...odel_resource_pool_snapshot_policy_test.go | 11 + services/sfs/model_resource_pool_space.go | 72 ++ services/sfs/model_schedule.go | 330 +++++ services/sfs/model_schedule_test.go | 11 + services/sfs/model_snapshot_policy.go | 448 +++++++ .../sfs/model_snapshot_policy_schedule.go | 325 +++++ .../model_snapshot_policy_schedule_test.go | 11 + services/sfs/model_snapshot_policy_test.go | 11 + .../sfs/model_update_resource_pool_payload.go | 59 + ...te_resource_pool_response_resource_pool.go | 71 ++ services/sfs/oas_commit | 2 +- services/sfs/v1api/api_default.go | 1103 +++++++++++++++-- services/sfs/v1api/api_default_mock.go | 124 ++ .../sfs/v1api/model_create_lock_response.go | 153 +++ .../model_create_resource_pool_payload.go | 38 + ...l_create_resource_pool_snapshot_payload.go | 53 +- .../sfs/v1api/model_get_schedule_response.go | 154 +++ .../model_get_snapshot_policy_response.go | 154 +++ .../v1api/model_list_schedules_response.go | 154 +++ .../model_list_snapshot_policies_response.go | 154 +++ services/sfs/v1api/model_resource_pool.go | 49 + .../sfs/v1api/model_resource_pool_snapshot.go | 49 + .../model_resource_pool_snapshot_policy.go | 192 +++ .../sfs/v1api/model_resource_pool_space.go | 49 + services/sfs/v1api/model_schedule.go | 269 ++++ services/sfs/v1api/model_snapshot_policy.go | 345 ++++++ .../v1api/model_snapshot_policy_schedule.go | 264 ++++ .../model_update_resource_pool_payload.go | 38 + 52 files changed, 7974 insertions(+), 150 deletions(-) create mode 100644 services/sfs/model_create_lock_response.go create mode 100644 services/sfs/model_create_lock_response_test.go create mode 100644 services/sfs/model_get_schedule_response.go create mode 100644 services/sfs/model_get_schedule_response_schedule.go create mode 100644 services/sfs/model_get_schedule_response_schedule_test.go create mode 100644 services/sfs/model_get_schedule_response_test.go create mode 100644 services/sfs/model_get_snapshot_policy_response.go create mode 100644 services/sfs/model_get_snapshot_policy_response_snapshot_policy.go create mode 100644 services/sfs/model_get_snapshot_policy_response_snapshot_policy_test.go create mode 100644 services/sfs/model_get_snapshot_policy_response_test.go create mode 100644 services/sfs/model_list_schedules_response.go create mode 100644 services/sfs/model_list_schedules_response_test.go create mode 100644 services/sfs/model_list_snapshot_policies_response.go create mode 100644 services/sfs/model_list_snapshot_policies_response_test.go create mode 100644 services/sfs/model_resource_pool_snapshot_policy.go create mode 100644 services/sfs/model_resource_pool_snapshot_policy_test.go create mode 100644 services/sfs/model_schedule.go create mode 100644 services/sfs/model_schedule_test.go create mode 100644 services/sfs/model_snapshot_policy.go create mode 100644 services/sfs/model_snapshot_policy_schedule.go create mode 100644 services/sfs/model_snapshot_policy_schedule_test.go create mode 100644 services/sfs/model_snapshot_policy_test.go create mode 100644 services/sfs/v1api/model_create_lock_response.go create mode 100644 services/sfs/v1api/model_get_schedule_response.go create mode 100644 services/sfs/v1api/model_get_snapshot_policy_response.go create mode 100644 services/sfs/v1api/model_list_schedules_response.go create mode 100644 services/sfs/v1api/model_list_snapshot_policies_response.go create mode 100644 services/sfs/v1api/model_resource_pool_snapshot_policy.go create mode 100644 services/sfs/v1api/model_schedule.go create mode 100644 services/sfs/v1api/model_snapshot_policy.go create mode 100644 services/sfs/v1api/model_snapshot_policy_schedule.go diff --git a/services/sfs/api_default.go b/services/sfs/api_default.go index 60f0459e6..581e21c26 100644 --- a/services/sfs/api_default.go +++ b/services/sfs/api_default.go @@ -26,6 +26,29 @@ import ( // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApi interface { + /* + CreateLock Method for CreateLock + Create Lock + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return ApiCreateLockRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + CreateLock(ctx context.Context, region string, projectId string) ApiCreateLockRequest + /* + CreateLockExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return CreateLockResponse + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + CreateLockExecute(ctx context.Context, region string, projectId string) (*CreateLockResponse, error) /* CreateResourcePool Create Resource Pool Create a Resource Pool in a project. @@ -122,6 +145,29 @@ type DefaultApi interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateShareExportPolicyExecute(ctx context.Context, projectId string, region string) (*CreateShareExportPolicyResponse, error) + /* + DeleteLock Method for DeleteLock + Delete Lock + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return ApiDeleteLockRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + DeleteLock(ctx context.Context, region string, projectId string) ApiDeleteLockRequest + /* + DeleteLockExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return map[string]interface{} + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + DeleteLockExecute(ctx context.Context, region string, projectId string) (map[string]interface{}, error) /* DeleteResourcePool Delete Resource Pool Deletes a Resource Pool in a project. @@ -278,6 +324,29 @@ type DefaultApi interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetResourcePoolSnapshotExecute(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) (*GetResourcePoolSnapshotResponse, error) + /* + GetSchedule Method for GetSchedule + Get Schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return ApiGetScheduleRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetSchedule(ctx context.Context, projectId string, id string) ApiGetScheduleRequest + /* + GetScheduleExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return GetScheduleResponse + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetScheduleExecute(ctx context.Context, projectId string, id string) (*GetScheduleResponse, error) /* GetShare Get Share Retrieves a Shares in a Resource Pool in a project. @@ -331,7 +400,30 @@ type DefaultApi interface { */ GetShareExportPolicyExecute(ctx context.Context, projectId string, region string, policyId string) (*GetShareExportPolicyResponse, error) /* - ListPerformanceClasses List Resource Pool Performance Classes + GetSnapshotPolicy Method for GetSnapshotPolicy + Get Snapshot Policy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return ApiGetSnapshotPolicyRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetSnapshotPolicy(ctx context.Context, projectId string, id string) ApiGetSnapshotPolicyRequest + /* + GetSnapshotPolicyExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return GetSnapshotPolicyResponse + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetSnapshotPolicyExecute(ctx context.Context, projectId string, id string) (*GetSnapshotPolicyResponse, error) + /* + ListPerformanceClasses List Resource Performance Classes Lists all performances classes available @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @@ -397,6 +489,27 @@ type DefaultApi interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListResourcePoolsExecute(ctx context.Context, projectId string, region string) (*ListResourcePoolsResponse, error) + /* + ListSchedules Method for ListSchedules + List Schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListSchedulesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + ListSchedules(ctx context.Context, projectId string) ApiListSchedulesRequest + /* + ListSchedulesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ListSchedulesResponse + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + ListSchedulesExecute(ctx context.Context, projectId string) (*ListSchedulesResponse, error) /* ListShareExportPolicies List Share Export Policies Lists ShareExportPolicies in a Resource Pool in a project. @@ -445,6 +558,27 @@ type DefaultApi interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListSharesExecute(ctx context.Context, projectId string, region string, resourcePoolId string) (*ListSharesResponse, error) + /* + ListSnapshotPolicies Method for ListSnapshotPolicies + List Snapshot Policies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListSnapshotPoliciesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + ListSnapshotPolicies(ctx context.Context, projectId string) ApiListSnapshotPoliciesRequest + /* + ListSnapshotPoliciesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ListSnapshotPoliciesResponse + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + ListSnapshotPoliciesExecute(ctx context.Context, projectId string) (*ListSnapshotPoliciesResponse, error) /* UpdateResourcePool Update Resource Pool Updates a Resource Pool in a project. @@ -524,6 +658,12 @@ type DefaultApi interface { UpdateShareExportPolicyExecute(ctx context.Context, projectId string, region string, policyId string) (*UpdateShareExportPolicyResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiCreateLockRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*CreateLockResponse, error) +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateResourcePoolRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -556,6 +696,12 @@ type ApiCreateShareExportPolicyRequest interface { Execute() (*CreateShareExportPolicyResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiDeleteLockRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (map[string]interface{}, error) +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiDeleteResourcePoolRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -592,6 +738,12 @@ type ApiGetResourcePoolSnapshotRequest interface { Execute() (*GetResourcePoolSnapshotResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiGetScheduleRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*GetScheduleResponse, error) +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetShareRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -604,6 +756,12 @@ type ApiGetShareExportPolicyRequest interface { Execute() (*GetShareExportPolicyResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiGetSnapshotPolicyRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*GetSnapshotPolicyResponse, error) +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListPerformanceClassesRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -622,6 +780,12 @@ type ApiListResourcePoolsRequest interface { Execute() (*ListResourcePoolsResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiListSchedulesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*ListSchedulesResponse, error) +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListShareExportPoliciesRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -634,6 +798,14 @@ type ApiListSharesRequest interface { Execute() (*ListSharesResponse, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiListSnapshotPoliciesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Immutable(immutable bool) ApiListSnapshotPoliciesRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*ListSnapshotPoliciesResponse, error) +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiUpdateResourcePoolRequest interface { // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -662,6 +834,143 @@ type ApiUpdateShareExportPolicyRequest interface { // 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 CreateLockRequest struct { + ctx context.Context + apiService *DefaultApiService + region string + projectId string +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateLockRequest) Execute() (*CreateLockResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateLockResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateLock") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/regions/{region}/project/{projectId}/locks" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + 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 := 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 := 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{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + var v Status + err = 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 + } + + err = 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 +} + +/* +CreateLock: Method for CreateLock + +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 region + @param projectId + @return ApiCreateLockRequest +*/ +func (a *APIClient) CreateLock(ctx context.Context, region string, projectId string) ApiCreateLockRequest { + return CreateLockRequest{ + apiService: a.defaultApi, + ctx: ctx, + region: region, + projectId: projectId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) CreateLockExecute(ctx context.Context, region string, projectId string) (*CreateLockResponse, error) { + r := CreateLockRequest{ + apiService: a.defaultApi, + ctx: ctx, + region: region, + projectId: projectId, + } + return r.Execute() +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateResourcePoolRequest struct { ctx context.Context @@ -1365,16 +1674,15 @@ func (a *APIClient) CreateShareExportPolicyExecute(ctx context.Context, projectI } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DeleteResourcePoolRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - region string - resourcePoolId string +type DeleteLockRequest struct { + ctx context.Context + apiService *DefaultApiService + region string + projectId string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r DeleteResourcePoolRequest) Execute() (map[string]interface{}, error) { +func (r DeleteLockRequest) Execute() (map[string]interface{}, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -1386,15 +1694,14 @@ func (r DeleteResourcePoolRequest) Execute() (map[string]interface{}, error) { if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteResourcePool") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteLock") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v1/regions/{region}/project/{projectId}/locks" localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1410,7 +1717,7 @@ func (r DeleteResourcePoolRequest) Execute() (map[string]interface{}, error) { } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1449,11 +1756,150 @@ func (r DeleteResourcePoolRequest) Execute() (map[string]interface{}, error) { Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ValidationError - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() + var v Status + err = 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 + } + + err = 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 +} + +/* +DeleteLock: Method for DeleteLock + +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 region + @param projectId + @return ApiDeleteLockRequest +*/ +func (a *APIClient) DeleteLock(ctx context.Context, region string, projectId string) ApiDeleteLockRequest { + return DeleteLockRequest{ + apiService: a.defaultApi, + ctx: ctx, + region: region, + projectId: projectId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) DeleteLockExecute(ctx context.Context, region string, projectId string) (map[string]interface{}, error) { + r := DeleteLockRequest{ + apiService: a.defaultApi, + ctx: ctx, + region: region, + projectId: projectId, + } + return r.Execute() +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DeleteResourcePoolRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + region string + resourcePoolId string +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r DeleteResourcePoolRequest) Execute() (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteResourcePool") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(ParameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"resourcePoolId"+"}", url.PathEscape(ParameterValueToString(r.resourcePoolId, "resourcePoolId")), -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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError + err = 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) @@ -2375,6 +2821,143 @@ func (a *APIClient) GetResourcePoolSnapshotExecute(ctx context.Context, projectI return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + id string +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r GetScheduleRequest) Execute() (*GetScheduleResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetScheduleResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/schedules/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -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 := 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 := 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{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + var v Status + err = 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 + } + + err = 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 +} + +/* +GetSchedule: Method for GetSchedule + +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 + @param id + @return ApiGetScheduleRequest +*/ +func (a *APIClient) GetSchedule(ctx context.Context, projectId string, id string) ApiGetScheduleRequest { + return GetScheduleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) GetScheduleExecute(ctx context.Context, projectId string, id string) (*GetScheduleResponse, error) { + r := GetScheduleRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + id: id, + } + return r.Execute() +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GetShareRequest struct { ctx context.Context @@ -2713,30 +3296,34 @@ func (a *APIClient) GetShareExportPolicyExecute(ctx context.Context, projectId s } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListPerformanceClassesRequest struct { +type GetSnapshotPolicyRequest struct { ctx context.Context apiService *DefaultApiService + projectId string + id string } // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListPerformanceClassesRequest) Execute() (*ListPerformanceClassesResponse, error) { +func (r GetSnapshotPolicyRequest) Execute() (*GetSnapshotPolicyResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListPerformanceClassesResponse + localVarReturnValue *GetSnapshotPolicyResponse ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPerformanceClasses") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetSnapshotPolicy") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/resourcePoolPerformanceClasses" + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshotPolicies/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(ParameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2752,7 +3339,7 @@ func (r ListPerformanceClassesRequest) Execute() (*ListPerformanceClassesRespons } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -2791,8 +3378,141 @@ func (r ListPerformanceClassesRequest) Execute() (*ListPerformanceClassesRespons Body: localVarBody, ErrorMessage: localVarHTTPResponse.Status, } - if localVarHTTPResponse.StatusCode == 400 { - var v ValidationError + var v Status + err = 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 + } + + err = 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 +} + +/* +GetSnapshotPolicy: Method for GetSnapshotPolicy + +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 + @param id + @return ApiGetSnapshotPolicyRequest +*/ +func (a *APIClient) GetSnapshotPolicy(ctx context.Context, projectId string, id string) ApiGetSnapshotPolicyRequest { + return GetSnapshotPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) GetSnapshotPolicyExecute(ctx context.Context, projectId string, id string) (*GetSnapshotPolicyResponse, error) { + r := GetSnapshotPolicyRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + id: id, + } + return r.Execute() +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListPerformanceClassesRequest struct { + ctx context.Context + apiService *DefaultApiService +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListPerformanceClassesRequest) Execute() (*ListPerformanceClassesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListPerformanceClassesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListPerformanceClasses") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/resourcePoolPerformanceClasses" + + 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", "application/problem+json", "text/plain"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := 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 := 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{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v ValidationError err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -2840,7 +3560,7 @@ func (r ListPerformanceClassesRequest) Execute() (*ListPerformanceClassesRespons } /* -ListPerformanceClasses: List Resource Pool Performance Classes +ListPerformanceClasses: List Resource Performance Classes Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @@ -3190,6 +3910,138 @@ func (a *APIClient) ListResourcePoolsExecute(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 ListSchedulesRequest 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 ListSchedulesRequest) Execute() (*ListSchedulesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListSchedulesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSchedules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/schedules" + 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 := 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 := 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{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + var v Status + err = 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 + } + + err = 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 +} + +/* +ListSchedules: Method for ListSchedules + +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 + @return ApiListSchedulesRequest +*/ +func (a *APIClient) ListSchedules(ctx context.Context, projectId string) ApiListSchedulesRequest { + return ListSchedulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) ListSchedulesExecute(ctx context.Context, projectId string) (*ListSchedulesResponse, error) { + r := ListSchedulesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListShareExportPoliciesRequest struct { ctx context.Context @@ -3517,6 +4369,148 @@ func (a *APIClient) ListSharesExecute(ctx context.Context, projectId string, reg return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSnapshotPoliciesRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + immutable *bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListSnapshotPoliciesRequest) Immutable(immutable bool) ApiListSnapshotPoliciesRequest { + r.immutable = &immutable + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListSnapshotPoliciesRequest) Execute() (*ListSnapshotPoliciesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListSnapshotPoliciesResponse + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListSnapshotPolicies") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshotPolicies" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.immutable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "immutable", r.immutable, "") + } + // 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 := 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 := 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{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + var v Status + err = 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 + } + + err = 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 +} + +/* +ListSnapshotPolicies: Method for ListSnapshotPolicies + +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 + @return ApiListSnapshotPoliciesRequest +*/ +func (a *APIClient) ListSnapshotPolicies(ctx context.Context, projectId string) ApiListSnapshotPoliciesRequest { + return ListSnapshotPoliciesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) ListSnapshotPoliciesExecute(ctx context.Context, projectId string) (*ListSnapshotPoliciesResponse, error) { + r := ListSnapshotPoliciesRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type UpdateResourcePoolRequest struct { ctx context.Context diff --git a/services/sfs/model_create_lock_response.go b/services/sfs/model_create_lock_response.go new file mode 100644 index 000000000..fba4aa3c2 --- /dev/null +++ b/services/sfs/model_create_lock_response.go @@ -0,0 +1,151 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" +) + +// checks if the CreateLockResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateLockResponse{} + +/* + types and functions for lockId +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateLockResponseGetLockIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateLockResponseGetLockIdAttributeTypeOk(arg CreateLockResponseGetLockIdAttributeType) (ret CreateLockResponseGetLockIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateLockResponseGetLockIdAttributeType(arg *CreateLockResponseGetLockIdAttributeType, val CreateLockResponseGetLockIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateLockResponseGetLockIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateLockResponseGetLockIdRetType = string + +// CreateLockResponse struct for CreateLockResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateLockResponse struct { + LockId CreateLockResponseGetLockIdAttributeType `json:"lockId,omitempty"` +} + +// NewCreateLockResponse instantiates a new CreateLockResponse 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 NewCreateLockResponse() *CreateLockResponse { + this := CreateLockResponse{} + return &this +} + +// NewCreateLockResponseWithDefaults instantiates a new CreateLockResponse 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 NewCreateLockResponseWithDefaults() *CreateLockResponse { + this := CreateLockResponse{} + return &this +} + +// GetLockId returns the LockId 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 *CreateLockResponse) GetLockId() (res CreateLockResponseGetLockIdRetType) { + res, _ = o.GetLockIdOk() + return +} + +// GetLockIdOk returns a tuple with the LockId 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 *CreateLockResponse) GetLockIdOk() (ret CreateLockResponseGetLockIdRetType, ok bool) { + return getCreateLockResponseGetLockIdAttributeTypeOk(o.LockId) +} + +// HasLockId 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 *CreateLockResponse) HasLockId() bool { + _, ok := o.GetLockIdOk() + return ok +} + +// SetLockId gets a reference to the given string and assigns it to the LockId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateLockResponse) SetLockId(v CreateLockResponseGetLockIdRetType) { + setCreateLockResponseGetLockIdAttributeType(&o.LockId, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateLockResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateLockResponseGetLockIdAttributeTypeOk(o.LockId); ok { + toSerialize["LockId"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateLockResponse struct { + value *CreateLockResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateLockResponse) Get() *CreateLockResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateLockResponse) Set(val *CreateLockResponse) { + 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 NullableCreateLockResponse) 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 *NullableCreateLockResponse) 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 NewNullableCreateLockResponse(val *CreateLockResponse) *NullableCreateLockResponse { + return &NullableCreateLockResponse{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 NullableCreateLockResponse) 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 *NullableCreateLockResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_create_lock_response_test.go b/services/sfs/model_create_lock_response_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_create_lock_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_create_resource_pool_payload.go b/services/sfs/model_create_resource_pool_payload.go index f0249425b..d59d0f3a9 100644 --- a/services/sfs/model_create_resource_pool_payload.go +++ b/services/sfs/model_create_resource_pool_payload.go @@ -180,6 +180,33 @@ func setCreateResourcePoolPayloadGetSizeGigabytesAttributeType(arg *CreateResour *arg = &val } +/* + types and functions for snapshotPolicyId +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolPayloadGetSnapshotPolicyIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateResourcePoolPayloadGetSnapshotPolicyIdAttributeTypeOk(arg CreateResourcePoolPayloadGetSnapshotPolicyIdAttributeType) (ret CreateResourcePoolPayloadGetSnapshotPolicyIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateResourcePoolPayloadGetSnapshotPolicyIdAttributeType(arg *CreateResourcePoolPayloadGetSnapshotPolicyIdAttributeType, val CreateResourcePoolPayloadGetSnapshotPolicyIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolPayloadGetSnapshotPolicyIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolPayloadGetSnapshotPolicyIdRetType = string + /* types and functions for snapshotsAreVisible */ @@ -228,6 +255,8 @@ type CreateResourcePoolPayload struct { // Can be cast to int32 without loss of precision. // REQUIRED SizeGigabytes CreateResourcePoolPayloadGetSizeGigabytesAttributeType `json:"sizeGigabytes" required:"true"` + // (optional) Id of the Snapshot Policy to use + SnapshotPolicyId CreateResourcePoolPayloadGetSnapshotPolicyIdAttributeType `json:"snapshotPolicyId,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible CreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` } @@ -386,6 +415,33 @@ func (o *CreateResourcePoolPayload) SetSizeGigabytes(v CreateResourcePoolPayload setCreateResourcePoolPayloadGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) } +// GetSnapshotPolicyId returns the SnapshotPolicyId 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 *CreateResourcePoolPayload) GetSnapshotPolicyId() (res CreateResourcePoolPayloadGetSnapshotPolicyIdRetType) { + res, _ = o.GetSnapshotPolicyIdOk() + return +} + +// GetSnapshotPolicyIdOk returns a tuple with the SnapshotPolicyId 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 *CreateResourcePoolPayload) GetSnapshotPolicyIdOk() (ret CreateResourcePoolPayloadGetSnapshotPolicyIdRetType, ok bool) { + return getCreateResourcePoolPayloadGetSnapshotPolicyIdAttributeTypeOk(o.SnapshotPolicyId) +} + +// HasSnapshotPolicyId 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 *CreateResourcePoolPayload) HasSnapshotPolicyId() bool { + _, ok := o.GetSnapshotPolicyIdOk() + return ok +} + +// SetSnapshotPolicyId gets a reference to the given string and assigns it to the SnapshotPolicyId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolPayload) SetSnapshotPolicyId(v CreateResourcePoolPayloadGetSnapshotPolicyIdRetType) { + setCreateResourcePoolPayloadGetSnapshotPolicyIdAttributeType(&o.SnapshotPolicyId, v) +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible 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 *CreateResourcePoolPayload) GetSnapshotsAreVisible() (res CreateResourcePoolPayloadgetSnapshotsAreVisibleRetType) { @@ -434,6 +490,9 @@ func (o CreateResourcePoolPayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateResourcePoolPayloadGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { toSerialize["SizeGigabytes"] = val } + if val, ok := getCreateResourcePoolPayloadGetSnapshotPolicyIdAttributeTypeOk(o.SnapshotPolicyId); ok { + toSerialize["SnapshotPolicyId"] = val + } if val, ok := getCreateResourcePoolPayloadgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { toSerialize["SnapshotsAreVisible"] = val } diff --git a/services/sfs/model_create_resource_pool_response_resource_pool.go b/services/sfs/model_create_resource_pool_response_resource_pool.go index 04b98cee9..8ca165818 100644 --- a/services/sfs/model_create_resource_pool_response_resource_pool.go +++ b/services/sfs/model_create_resource_pool_response_resource_pool.go @@ -316,6 +316,33 @@ func setCreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(ar *arg = &val } +/* + types and functions for snapshotPolicy +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolResponseResourcePoolGetSnapshotPolicyArgType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(arg CreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType) (ret CreateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType(arg *CreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType, val CreateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + *arg = val +} + /* types and functions for snapshotsAreVisible */ @@ -420,6 +447,7 @@ type CreateResourcePoolResponseResourcePool struct { PerformanceClassDowngradableAt CreateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType `json:"performanceClassDowngradableAt,omitempty"` // Time when the size can be reduced again. SizeReducibleAt CreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType `json:"sizeReducibleAt,omitempty"` + SnapshotPolicy CreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType `json:"snapshotPolicy,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` Space CreateResourcePoolResponseResourcePoolGetSpaceAttributeType `json:"space,omitempty"` @@ -745,6 +773,46 @@ func (o *CreateResourcePoolResponseResourcePool) SetSizeReducibleAt(v CreateReso setCreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(&o.SizeReducibleAt, v) } +// GetSnapshotPolicy returns the SnapshotPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolResponseResourcePool) GetSnapshotPolicy() (res CreateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + res, _ = o.GetSnapshotPolicyOk() + return +} + +// GetSnapshotPolicyOk returns a tuple with the SnapshotPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolResponseResourcePool) GetSnapshotPolicyOk() (ret CreateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType, ok bool) { + return getCreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy) +} + +// HasSnapshotPolicy 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 *CreateResourcePoolResponseResourcePool) HasSnapshotPolicy() bool { + _, ok := o.GetSnapshotPolicyOk() + return ok +} + +// SetSnapshotPolicy gets a reference to the given ResourcePoolSnapshotPolicy and assigns it to the SnapshotPolicy field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolResponseResourcePool) SetSnapshotPolicy(v CreateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + setCreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType(&o.SnapshotPolicy, v) +} + +// SetSnapshotPolicyNil sets the value for SnapshotPolicy to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolResponseResourcePool) SetSnapshotPolicyNil() { + o.SnapshotPolicy = nil +} + +// UnsetSnapshotPolicy ensures that no value is present for SnapshotPolicy, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolResponseResourcePool) UnsetSnapshotPolicy() { + o.SnapshotPolicy = nil +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible 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 *CreateResourcePoolResponseResourcePool) GetSnapshotsAreVisible() (res CreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { @@ -862,6 +930,9 @@ func (o CreateResourcePoolResponseResourcePool) ToMap() (map[string]interface{}, if val, ok := getCreateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt); ok { toSerialize["SizeReducibleAt"] = val } + if val, ok := getCreateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy); ok { + toSerialize["SnapshotPolicy"] = val + } if val, ok := getCreateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { toSerialize["SnapshotsAreVisible"] = val } diff --git a/services/sfs/model_create_resource_pool_snapshot_payload.go b/services/sfs/model_create_resource_pool_snapshot_payload.go index 0cf7f7210..9bb5d92c3 100644 --- a/services/sfs/model_create_resource_pool_snapshot_payload.go +++ b/services/sfs/model_create_resource_pool_snapshot_payload.go @@ -76,6 +76,33 @@ type CreateResourcePoolSnapshotPayloadGetNameArgType = string // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateResourcePoolSnapshotPayloadGetNameRetType = string +/* + types and functions for snaplockRetentionHours +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursArgType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursRetType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeTypeOk(arg CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeType) (ret CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeType(arg *CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeType, val CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursRetType) { + *arg = val +} + // CreateResourcePoolSnapshotPayload struct for CreateResourcePoolSnapshotPayload // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateResourcePoolSnapshotPayload struct { @@ -83,6 +110,8 @@ type CreateResourcePoolSnapshotPayload struct { Comment CreateResourcePoolSnapshotPayloadGetCommentAttributeType `json:"comment,omitempty"` // Name of the Resource Pool Snapshot Name CreateResourcePoolSnapshotPayloadGetNameAttributeType `json:"name,omitempty"` + // (optional) Time in hours after which snaplock on the snapshot expires + SnaplockRetentionHours CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeType `json:"snaplockRetentionHours,omitempty"` } // NewCreateResourcePoolSnapshotPayload instantiates a new CreateResourcePoolSnapshotPayload object @@ -171,6 +200,46 @@ func (o *CreateResourcePoolSnapshotPayload) SetName(v CreateResourcePoolSnapshot setCreateResourcePoolSnapshotPayloadGetNameAttributeType(&o.Name, v) } +// GetSnaplockRetentionHours returns the SnaplockRetentionHours field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotPayload) GetSnaplockRetentionHours() (res CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursRetType) { + res, _ = o.GetSnaplockRetentionHoursOk() + return +} + +// GetSnaplockRetentionHoursOk returns a tuple with the SnaplockRetentionHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotPayload) GetSnaplockRetentionHoursOk() (ret CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursRetType, ok bool) { + return getCreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeTypeOk(o.SnaplockRetentionHours) +} + +// HasSnaplockRetentionHours 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 *CreateResourcePoolSnapshotPayload) HasSnaplockRetentionHours() bool { + _, ok := o.GetSnaplockRetentionHoursOk() + return ok +} + +// SetSnaplockRetentionHours gets a reference to the given int64 and assigns it to the SnaplockRetentionHours field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotPayload) SetSnaplockRetentionHours(v CreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursRetType) { + setCreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeType(&o.SnaplockRetentionHours, v) +} + +// SetSnaplockRetentionHoursNil sets the value for SnaplockRetentionHours to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotPayload) SetSnaplockRetentionHoursNil() { + o.SnaplockRetentionHours = nil +} + +// UnsetSnaplockRetentionHours ensures that no value is present for SnaplockRetentionHours, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotPayload) UnsetSnaplockRetentionHours() { + o.SnaplockRetentionHours = nil +} + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateResourcePoolSnapshotPayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} @@ -180,6 +249,9 @@ func (o CreateResourcePoolSnapshotPayload) ToMap() (map[string]interface{}, erro if val, ok := getCreateResourcePoolSnapshotPayloadGetNameAttributeTypeOk(o.Name); ok { toSerialize["Name"] = val } + if val, ok := getCreateResourcePoolSnapshotPayloadGetSnaplockRetentionHoursAttributeTypeOk(o.SnaplockRetentionHours); ok { + toSerialize["SnaplockRetentionHours"] = val + } return toSerialize, nil } diff --git a/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot.go b/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot.go index d4cfc2c65..ca0790db5 100644 --- a/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot.go +++ b/services/sfs/model_create_resource_pool_snapshot_response_resource_pool_snapshot.go @@ -158,6 +158,33 @@ func setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAt *arg = &val } +/* + types and functions for snaplockExpiryTime +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeArgType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(arg CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType) (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType(arg *CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType, val CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + *arg = val +} + /* types and functions for snapshotName */ @@ -199,6 +226,8 @@ type CreateResourcePoolSnapshotResponseResourcePoolSnapshot struct { // Reflects the actual storage footprint in the backend at snapshot time in Gibibytes (e.g. how much storage from the Resource Pool does it use). // Can be cast to int32 without loss of precision. SizeGigabytes CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // Represents the snaplock expiry time if snaplock is enabled for the resource pool + SnaplockExpiryTime CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType `json:"snaplockExpiryTime,omitempty"` // Name of the Resource Pool Snapshot SnapshotName CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType `json:"snapshotName,omitempty"` } @@ -370,6 +399,46 @@ func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetSizeGigabyte setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) } +// GetSnaplockExpiryTime returns the SnaplockExpiryTime field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnaplockExpiryTime() (res CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + res, _ = o.GetSnaplockExpiryTimeOk() + return +} + +// GetSnaplockExpiryTimeOk returns a tuple with the SnaplockExpiryTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnaplockExpiryTimeOk() (ret CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType, ok bool) { + return getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(o.SnaplockExpiryTime) +} + +// HasSnaplockExpiryTime 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 *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) HasSnaplockExpiryTime() bool { + _, ok := o.GetSnaplockExpiryTimeOk() + return ok +} + +// SetSnaplockExpiryTime gets a reference to the given time.Time and assigns it to the SnaplockExpiryTime field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetSnaplockExpiryTime(v CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + setCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType(&o.SnaplockExpiryTime, v) +} + +// SetSnaplockExpiryTimeNil sets the value for SnaplockExpiryTime to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) SetSnaplockExpiryTimeNil() { + o.SnaplockExpiryTime = nil +} + +// UnsetSnaplockExpiryTime ensures that no value is present for SnaplockExpiryTime, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) UnsetSnaplockExpiryTime() { + o.SnaplockExpiryTime = nil +} + // GetSnapshotName returns the SnapshotName 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 *CreateResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnapshotName() (res CreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType) { @@ -415,6 +484,9 @@ func (o CreateResourcePoolSnapshotResponseResourcePoolSnapshot) ToMap() (map[str if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { toSerialize["SizeGigabytes"] = val } + if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(o.SnaplockExpiryTime); ok { + toSerialize["SnaplockExpiryTime"] = val + } if val, ok := getCreateResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName); ok { toSerialize["SnapshotName"] = val } diff --git a/services/sfs/model_get_resource_pool_response_resource_pool.go b/services/sfs/model_get_resource_pool_response_resource_pool.go index 135ae9efb..2aa8aaa3f 100644 --- a/services/sfs/model_get_resource_pool_response_resource_pool.go +++ b/services/sfs/model_get_resource_pool_response_resource_pool.go @@ -316,6 +316,33 @@ func setGetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(arg * *arg = &val } +/* + types and functions for snapshotPolicy +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetResourcePoolResponseResourcePoolGetSnapshotPolicyArgType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetResourcePoolResponseResourcePoolGetSnapshotPolicyRetType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(arg GetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType) (ret GetResourcePoolResponseResourcePoolGetSnapshotPolicyRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType(arg *GetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType, val GetResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + *arg = val +} + /* types and functions for snapshotsAreVisible */ @@ -420,6 +447,7 @@ type GetResourcePoolResponseResourcePool struct { PerformanceClassDowngradableAt GetResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType `json:"performanceClassDowngradableAt,omitempty"` // Time when the size can be reduced again. SizeReducibleAt GetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType `json:"sizeReducibleAt,omitempty"` + SnapshotPolicy GetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType `json:"snapshotPolicy,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` Space GetResourcePoolResponseResourcePoolGetSpaceAttributeType `json:"space,omitempty"` @@ -745,6 +773,46 @@ func (o *GetResourcePoolResponseResourcePool) SetSizeReducibleAt(v GetResourcePo setGetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(&o.SizeReducibleAt, v) } +// GetSnapshotPolicy returns the SnapshotPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolResponseResourcePool) GetSnapshotPolicy() (res GetResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + res, _ = o.GetSnapshotPolicyOk() + return +} + +// GetSnapshotPolicyOk returns a tuple with the SnapshotPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolResponseResourcePool) GetSnapshotPolicyOk() (ret GetResourcePoolResponseResourcePoolGetSnapshotPolicyRetType, ok bool) { + return getGetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy) +} + +// HasSnapshotPolicy 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 *GetResourcePoolResponseResourcePool) HasSnapshotPolicy() bool { + _, ok := o.GetSnapshotPolicyOk() + return ok +} + +// SetSnapshotPolicy gets a reference to the given ResourcePoolSnapshotPolicy and assigns it to the SnapshotPolicy field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolResponseResourcePool) SetSnapshotPolicy(v GetResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + setGetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType(&o.SnapshotPolicy, v) +} + +// SetSnapshotPolicyNil sets the value for SnapshotPolicy to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolResponseResourcePool) SetSnapshotPolicyNil() { + o.SnapshotPolicy = nil +} + +// UnsetSnapshotPolicy ensures that no value is present for SnapshotPolicy, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolResponseResourcePool) UnsetSnapshotPolicy() { + o.SnapshotPolicy = nil +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible 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 *GetResourcePoolResponseResourcePool) GetSnapshotsAreVisible() (res GetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { @@ -862,6 +930,9 @@ func (o GetResourcePoolResponseResourcePool) ToMap() (map[string]interface{}, er if val, ok := getGetResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt); ok { toSerialize["SizeReducibleAt"] = val } + if val, ok := getGetResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy); ok { + toSerialize["SnapshotPolicy"] = val + } if val, ok := getGetResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { toSerialize["SnapshotsAreVisible"] = val } diff --git a/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot.go b/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot.go index ed731e92b..ecf42365c 100644 --- a/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot.go +++ b/services/sfs/model_get_resource_pool_snapshot_response_resource_pool_snapshot.go @@ -158,6 +158,33 @@ func setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttri *arg = &val } +/* + types and functions for snaplockExpiryTime +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeArgType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(arg GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType) (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType(arg *GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType, val GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + *arg = val +} + /* types and functions for snapshotName */ @@ -199,6 +226,8 @@ type GetResourcePoolSnapshotResponseResourcePoolSnapshot struct { // Reflects the actual storage footprint in the backend at snapshot time in Gibibytes (e.g. how much storage from the Resource Pool does it use). // Can be cast to int32 without loss of precision. SizeGigabytes GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // Represents the snaplock expiry time if snaplock is enabled for the resource pool + SnaplockExpiryTime GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType `json:"snaplockExpiryTime,omitempty"` // Name of the Resource Pool Snapshot SnapshotName GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeType `json:"snapshotName,omitempty"` } @@ -370,6 +399,46 @@ func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetSizeGigabytes(v setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) } +// GetSnaplockExpiryTime returns the SnaplockExpiryTime field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnaplockExpiryTime() (res GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + res, _ = o.GetSnaplockExpiryTimeOk() + return +} + +// GetSnaplockExpiryTimeOk returns a tuple with the SnaplockExpiryTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnaplockExpiryTimeOk() (ret GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType, ok bool) { + return getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(o.SnaplockExpiryTime) +} + +// HasSnaplockExpiryTime 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 *GetResourcePoolSnapshotResponseResourcePoolSnapshot) HasSnaplockExpiryTime() bool { + _, ok := o.GetSnaplockExpiryTimeOk() + return ok +} + +// SetSnaplockExpiryTime gets a reference to the given time.Time and assigns it to the SnaplockExpiryTime field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetSnaplockExpiryTime(v GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + setGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType(&o.SnaplockExpiryTime, v) +} + +// SetSnaplockExpiryTimeNil sets the value for SnaplockExpiryTime to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) SetSnaplockExpiryTimeNil() { + o.SnaplockExpiryTime = nil +} + +// UnsetSnaplockExpiryTime ensures that no value is present for SnaplockExpiryTime, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetResourcePoolSnapshotResponseResourcePoolSnapshot) UnsetSnaplockExpiryTime() { + o.SnaplockExpiryTime = nil +} + // GetSnapshotName returns the SnapshotName 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 *GetResourcePoolSnapshotResponseResourcePoolSnapshot) GetSnapshotName() (res GetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameRetType) { @@ -415,6 +484,9 @@ func (o GetResourcePoolSnapshotResponseResourcePoolSnapshot) ToMap() (map[string if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { toSerialize["SizeGigabytes"] = val } + if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(o.SnaplockExpiryTime); ok { + toSerialize["SnaplockExpiryTime"] = val + } if val, ok := getGetResourcePoolSnapshotResponseResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName); ok { toSerialize["SnapshotName"] = val } diff --git a/services/sfs/model_get_schedule_response.go b/services/sfs/model_get_schedule_response.go new file mode 100644 index 000000000..9e75d7ba2 --- /dev/null +++ b/services/sfs/model_get_schedule_response.go @@ -0,0 +1,151 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" +) + +// checks if the GetScheduleResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetScheduleResponse{} + +/* + types and functions for schedule +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseGetScheduleAttributeType = *GetScheduleResponseSchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseGetScheduleArgType = GetScheduleResponseSchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseGetScheduleRetType = GetScheduleResponseSchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetScheduleResponseGetScheduleAttributeTypeOk(arg GetScheduleResponseGetScheduleAttributeType) (ret GetScheduleResponseGetScheduleRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetScheduleResponseGetScheduleAttributeType(arg *GetScheduleResponseGetScheduleAttributeType, val GetScheduleResponseGetScheduleRetType) { + *arg = &val +} + +// GetScheduleResponse struct for GetScheduleResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponse struct { + Schedule GetScheduleResponseGetScheduleAttributeType `json:"schedule,omitempty"` +} + +// NewGetScheduleResponse instantiates a new GetScheduleResponse 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 NewGetScheduleResponse() *GetScheduleResponse { + this := GetScheduleResponse{} + return &this +} + +// NewGetScheduleResponseWithDefaults instantiates a new GetScheduleResponse 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 NewGetScheduleResponseWithDefaults() *GetScheduleResponse { + this := GetScheduleResponse{} + return &this +} + +// GetSchedule returns the Schedule 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 *GetScheduleResponse) GetSchedule() (res GetScheduleResponseGetScheduleRetType) { + res, _ = o.GetScheduleOk() + return +} + +// GetScheduleOk returns a tuple with the Schedule 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 *GetScheduleResponse) GetScheduleOk() (ret GetScheduleResponseGetScheduleRetType, ok bool) { + return getGetScheduleResponseGetScheduleAttributeTypeOk(o.Schedule) +} + +// HasSchedule 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 *GetScheduleResponse) HasSchedule() bool { + _, ok := o.GetScheduleOk() + return ok +} + +// SetSchedule gets a reference to the given GetScheduleResponseSchedule and assigns it to the Schedule field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetScheduleResponse) SetSchedule(v GetScheduleResponseGetScheduleRetType) { + setGetScheduleResponseGetScheduleAttributeType(&o.Schedule, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o GetScheduleResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetScheduleResponseGetScheduleAttributeTypeOk(o.Schedule); ok { + toSerialize["Schedule"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableGetScheduleResponse struct { + value *GetScheduleResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableGetScheduleResponse) Get() *GetScheduleResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableGetScheduleResponse) Set(val *GetScheduleResponse) { + 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 NullableGetScheduleResponse) 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 *NullableGetScheduleResponse) 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 NewNullableGetScheduleResponse(val *GetScheduleResponse) *NullableGetScheduleResponse { + return &NullableGetScheduleResponse{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 NullableGetScheduleResponse) 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 *NullableGetScheduleResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_schedule_response_schedule.go b/services/sfs/model_get_schedule_response_schedule.go new file mode 100644 index 000000000..ee4d83fdd --- /dev/null +++ b/services/sfs/model_get_schedule_response_schedule.go @@ -0,0 +1,330 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" + "time" +) + +// checks if the GetScheduleResponseSchedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetScheduleResponseSchedule{} + +/* + types and functions for createdAt +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetCreatedAtRetType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetScheduleResponseScheduleGetCreatedAtAttributeTypeOk(arg GetScheduleResponseScheduleGetCreatedAtAttributeType) (ret GetScheduleResponseScheduleGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetScheduleResponseScheduleGetCreatedAtAttributeType(arg *GetScheduleResponseScheduleGetCreatedAtAttributeType, val GetScheduleResponseScheduleGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetScheduleResponseScheduleGetIdAttributeTypeOk(arg GetScheduleResponseScheduleGetIdAttributeType) (ret GetScheduleResponseScheduleGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetScheduleResponseScheduleGetIdAttributeType(arg *GetScheduleResponseScheduleGetIdAttributeType, val GetScheduleResponseScheduleGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetIdRetType = string + +/* + types and functions for interval +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetIntervalAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetScheduleResponseScheduleGetIntervalAttributeTypeOk(arg GetScheduleResponseScheduleGetIntervalAttributeType) (ret GetScheduleResponseScheduleGetIntervalRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetScheduleResponseScheduleGetIntervalAttributeType(arg *GetScheduleResponseScheduleGetIntervalAttributeType, val GetScheduleResponseScheduleGetIntervalRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetIntervalArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetIntervalRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetScheduleResponseScheduleGetNameAttributeTypeOk(arg GetScheduleResponseScheduleGetNameAttributeType) (ret GetScheduleResponseScheduleGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetScheduleResponseScheduleGetNameAttributeType(arg *GetScheduleResponseScheduleGetNameAttributeType, val GetScheduleResponseScheduleGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseScheduleGetNameRetType = string + +// GetScheduleResponseSchedule Schedule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetScheduleResponseSchedule struct { + // created at timestamp + CreatedAt GetScheduleResponseScheduleGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Schedule + Id GetScheduleResponseScheduleGetIdAttributeType `json:"id,omitempty"` + // Interval of the Schedule (follows the cron schedule expression in Unix-like systems) + Interval GetScheduleResponseScheduleGetIntervalAttributeType `json:"interval,omitempty"` + // Name of the Schedule + Name GetScheduleResponseScheduleGetNameAttributeType `json:"name,omitempty"` +} + +// NewGetScheduleResponseSchedule instantiates a new GetScheduleResponseSchedule 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 NewGetScheduleResponseSchedule() *GetScheduleResponseSchedule { + this := GetScheduleResponseSchedule{} + return &this +} + +// NewGetScheduleResponseScheduleWithDefaults instantiates a new GetScheduleResponseSchedule 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 NewGetScheduleResponseScheduleWithDefaults() *GetScheduleResponseSchedule { + this := GetScheduleResponseSchedule{} + return &this +} + +// GetCreatedAt returns the CreatedAt 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 *GetScheduleResponseSchedule) GetCreatedAt() (res GetScheduleResponseScheduleGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetScheduleResponseSchedule) GetCreatedAtOk() (ret GetScheduleResponseScheduleGetCreatedAtRetType, ok bool) { + return getGetScheduleResponseScheduleGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt 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 *GetScheduleResponseSchedule) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetScheduleResponseSchedule) SetCreatedAt(v GetScheduleResponseScheduleGetCreatedAtRetType) { + setGetScheduleResponseScheduleGetCreatedAtAttributeType(&o.CreatedAt, 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 *GetScheduleResponseSchedule) GetId() (res GetScheduleResponseScheduleGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetScheduleResponseSchedule) GetIdOk() (ret GetScheduleResponseScheduleGetIdRetType, ok bool) { + return getGetScheduleResponseScheduleGetIdAttributeTypeOk(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 *GetScheduleResponseSchedule) 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 *GetScheduleResponseSchedule) SetId(v GetScheduleResponseScheduleGetIdRetType) { + setGetScheduleResponseScheduleGetIdAttributeType(&o.Id, v) +} + +// GetInterval returns the Interval 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 *GetScheduleResponseSchedule) GetInterval() (res GetScheduleResponseScheduleGetIntervalRetType) { + res, _ = o.GetIntervalOk() + return +} + +// GetIntervalOk returns a tuple with the Interval 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 *GetScheduleResponseSchedule) GetIntervalOk() (ret GetScheduleResponseScheduleGetIntervalRetType, ok bool) { + return getGetScheduleResponseScheduleGetIntervalAttributeTypeOk(o.Interval) +} + +// HasInterval 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 *GetScheduleResponseSchedule) HasInterval() bool { + _, ok := o.GetIntervalOk() + return ok +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetScheduleResponseSchedule) SetInterval(v GetScheduleResponseScheduleGetIntervalRetType) { + setGetScheduleResponseScheduleGetIntervalAttributeType(&o.Interval, 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 *GetScheduleResponseSchedule) GetName() (res GetScheduleResponseScheduleGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetScheduleResponseSchedule) GetNameOk() (ret GetScheduleResponseScheduleGetNameRetType, ok bool) { + return getGetScheduleResponseScheduleGetNameAttributeTypeOk(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 *GetScheduleResponseSchedule) 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 *GetScheduleResponseSchedule) SetName(v GetScheduleResponseScheduleGetNameRetType) { + setGetScheduleResponseScheduleGetNameAttributeType(&o.Name, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o GetScheduleResponseSchedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetScheduleResponseScheduleGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getGetScheduleResponseScheduleGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getGetScheduleResponseScheduleGetIntervalAttributeTypeOk(o.Interval); ok { + toSerialize["Interval"] = val + } + if val, ok := getGetScheduleResponseScheduleGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableGetScheduleResponseSchedule struct { + value *GetScheduleResponseSchedule + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableGetScheduleResponseSchedule) Get() *GetScheduleResponseSchedule { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableGetScheduleResponseSchedule) Set(val *GetScheduleResponseSchedule) { + 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 NullableGetScheduleResponseSchedule) 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 *NullableGetScheduleResponseSchedule) 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 NewNullableGetScheduleResponseSchedule(val *GetScheduleResponseSchedule) *NullableGetScheduleResponseSchedule { + return &NullableGetScheduleResponseSchedule{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 NullableGetScheduleResponseSchedule) 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 *NullableGetScheduleResponseSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_schedule_response_schedule_test.go b/services/sfs/model_get_schedule_response_schedule_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_get_schedule_response_schedule_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_schedule_response_test.go b/services/sfs/model_get_schedule_response_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_get_schedule_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_snapshot_policy_response.go b/services/sfs/model_get_snapshot_policy_response.go new file mode 100644 index 000000000..ec93f0278 --- /dev/null +++ b/services/sfs/model_get_snapshot_policy_response.go @@ -0,0 +1,151 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" +) + +// checks if the GetSnapshotPolicyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSnapshotPolicyResponse{} + +/* + types and functions for snapshotPolicy +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseGetSnapshotPolicyAttributeType = *GetSnapshotPolicyResponseSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseGetSnapshotPolicyArgType = GetSnapshotPolicyResponseSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseGetSnapshotPolicyRetType = GetSnapshotPolicyResponseSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetSnapshotPolicyResponseGetSnapshotPolicyAttributeTypeOk(arg GetSnapshotPolicyResponseGetSnapshotPolicyAttributeType) (ret GetSnapshotPolicyResponseGetSnapshotPolicyRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetSnapshotPolicyResponseGetSnapshotPolicyAttributeType(arg *GetSnapshotPolicyResponseGetSnapshotPolicyAttributeType, val GetSnapshotPolicyResponseGetSnapshotPolicyRetType) { + *arg = &val +} + +// GetSnapshotPolicyResponse struct for GetSnapshotPolicyResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponse struct { + SnapshotPolicy GetSnapshotPolicyResponseGetSnapshotPolicyAttributeType `json:"snapshotPolicy,omitempty"` +} + +// NewGetSnapshotPolicyResponse instantiates a new GetSnapshotPolicyResponse 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 NewGetSnapshotPolicyResponse() *GetSnapshotPolicyResponse { + this := GetSnapshotPolicyResponse{} + return &this +} + +// NewGetSnapshotPolicyResponseWithDefaults instantiates a new GetSnapshotPolicyResponse 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 NewGetSnapshotPolicyResponseWithDefaults() *GetSnapshotPolicyResponse { + this := GetSnapshotPolicyResponse{} + return &this +} + +// GetSnapshotPolicy returns the SnapshotPolicy 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 *GetSnapshotPolicyResponse) GetSnapshotPolicy() (res GetSnapshotPolicyResponseGetSnapshotPolicyRetType) { + res, _ = o.GetSnapshotPolicyOk() + return +} + +// GetSnapshotPolicyOk returns a tuple with the SnapshotPolicy 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 *GetSnapshotPolicyResponse) GetSnapshotPolicyOk() (ret GetSnapshotPolicyResponseGetSnapshotPolicyRetType, ok bool) { + return getGetSnapshotPolicyResponseGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy) +} + +// HasSnapshotPolicy 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 *GetSnapshotPolicyResponse) HasSnapshotPolicy() bool { + _, ok := o.GetSnapshotPolicyOk() + return ok +} + +// SetSnapshotPolicy gets a reference to the given GetSnapshotPolicyResponseSnapshotPolicy and assigns it to the SnapshotPolicy field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetSnapshotPolicyResponse) SetSnapshotPolicy(v GetSnapshotPolicyResponseGetSnapshotPolicyRetType) { + setGetSnapshotPolicyResponseGetSnapshotPolicyAttributeType(&o.SnapshotPolicy, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o GetSnapshotPolicyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetSnapshotPolicyResponseGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy); ok { + toSerialize["SnapshotPolicy"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableGetSnapshotPolicyResponse struct { + value *GetSnapshotPolicyResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableGetSnapshotPolicyResponse) Get() *GetSnapshotPolicyResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableGetSnapshotPolicyResponse) Set(val *GetSnapshotPolicyResponse) { + 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 NullableGetSnapshotPolicyResponse) 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 *NullableGetSnapshotPolicyResponse) 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 NewNullableGetSnapshotPolicyResponse(val *GetSnapshotPolicyResponse) *NullableGetSnapshotPolicyResponse { + return &NullableGetSnapshotPolicyResponse{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 NullableGetSnapshotPolicyResponse) 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 *NullableGetSnapshotPolicyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_snapshot_policy_response_snapshot_policy.go b/services/sfs/model_get_snapshot_policy_response_snapshot_policy.go new file mode 100644 index 000000000..85f67caac --- /dev/null +++ b/services/sfs/model_get_snapshot_policy_response_snapshot_policy.go @@ -0,0 +1,448 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" + "time" +) + +// checks if the GetSnapshotPolicyResponseSnapshotPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSnapshotPolicyResponseSnapshotPolicy{} + +/* + types and functions for comment +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeTypeOk(arg GetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeType) (ret GetSnapshotPolicyResponseSnapshotPolicyGetCommentRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeType(arg *GetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeType, val GetSnapshotPolicyResponseSnapshotPolicyGetCommentRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetCommentArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetCommentRetType = string + +/* + types and functions for createdAt +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtRetType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeTypeOk(arg GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeType) (ret GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeType(arg *GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeType, val GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for enabled +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicygetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicygetEnabledRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeTypeOk(arg GetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeType) (ret GetSnapshotPolicyResponseSnapshotPolicygetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeType(arg *GetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeType, val GetSnapshotPolicyResponseSnapshotPolicygetEnabledRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeTypeOk(arg GetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeType) (ret GetSnapshotPolicyResponseSnapshotPolicyGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeType(arg *GetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeType, val GetSnapshotPolicyResponseSnapshotPolicyGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeTypeOk(arg GetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeType) (ret GetSnapshotPolicyResponseSnapshotPolicyGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeType(arg *GetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeType, val GetSnapshotPolicyResponseSnapshotPolicyGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetNameRetType = string + +/* + types and functions for schedules +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeType = *[]SnapshotPolicySchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesArgType = []SnapshotPolicySchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesRetType = []SnapshotPolicySchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getGetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeTypeOk(arg GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeType) (ret GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setGetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeType(arg *GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeType, val GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesRetType) { + *arg = &val +} + +// GetSnapshotPolicyResponseSnapshotPolicy Snapshot Policy +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetSnapshotPolicyResponseSnapshotPolicy struct { + // Comment of the Snapshot Policy + Comment GetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeType `json:"comment,omitempty"` + // created at timestamp + CreatedAt GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // Wether the Snapshot Policy is enabled + Enabled GetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeType `json:"enabled,omitempty"` + // ID of the Snapshot Policy + Id GetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeType `json:"id,omitempty"` + // Name of the Snapshot Policy + Name GetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeType `json:"name,omitempty"` + // associated schedules + Schedules GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeType `json:"schedules,omitempty"` +} + +// NewGetSnapshotPolicyResponseSnapshotPolicy instantiates a new GetSnapshotPolicyResponseSnapshotPolicy 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 NewGetSnapshotPolicyResponseSnapshotPolicy() *GetSnapshotPolicyResponseSnapshotPolicy { + this := GetSnapshotPolicyResponseSnapshotPolicy{} + return &this +} + +// NewGetSnapshotPolicyResponseSnapshotPolicyWithDefaults instantiates a new GetSnapshotPolicyResponseSnapshotPolicy 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 NewGetSnapshotPolicyResponseSnapshotPolicyWithDefaults() *GetSnapshotPolicyResponseSnapshotPolicy { + this := GetSnapshotPolicyResponseSnapshotPolicy{} + return &this +} + +// GetComment returns the Comment 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 *GetSnapshotPolicyResponseSnapshotPolicy) GetComment() (res GetSnapshotPolicyResponseSnapshotPolicyGetCommentRetType) { + res, _ = o.GetCommentOk() + return +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetSnapshotPolicyResponseSnapshotPolicy) GetCommentOk() (ret GetSnapshotPolicyResponseSnapshotPolicyGetCommentRetType, ok bool) { + return getGetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeTypeOk(o.Comment) +} + +// HasComment 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 *GetSnapshotPolicyResponseSnapshotPolicy) HasComment() bool { + _, ok := o.GetCommentOk() + return ok +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetSnapshotPolicyResponseSnapshotPolicy) SetComment(v GetSnapshotPolicyResponseSnapshotPolicyGetCommentRetType) { + setGetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeType(&o.Comment, v) +} + +// GetCreatedAt returns the CreatedAt 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 *GetSnapshotPolicyResponseSnapshotPolicy) GetCreatedAt() (res GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetSnapshotPolicyResponseSnapshotPolicy) GetCreatedAtOk() (ret GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtRetType, ok bool) { + return getGetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt 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 *GetSnapshotPolicyResponseSnapshotPolicy) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetSnapshotPolicyResponseSnapshotPolicy) SetCreatedAt(v GetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtRetType) { + setGetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeType(&o.CreatedAt, 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 *GetSnapshotPolicyResponseSnapshotPolicy) GetEnabled() (res GetSnapshotPolicyResponseSnapshotPolicygetEnabledRetType) { + res, _ = o.GetEnabledOk() + return +} + +// 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 *GetSnapshotPolicyResponseSnapshotPolicy) GetEnabledOk() (ret GetSnapshotPolicyResponseSnapshotPolicygetEnabledRetType, ok bool) { + return getGetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeTypeOk(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 *GetSnapshotPolicyResponseSnapshotPolicy) 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 *GetSnapshotPolicyResponseSnapshotPolicy) SetEnabled(v GetSnapshotPolicyResponseSnapshotPolicygetEnabledRetType) { + setGetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeType(&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 *GetSnapshotPolicyResponseSnapshotPolicy) GetId() (res GetSnapshotPolicyResponseSnapshotPolicyGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetSnapshotPolicyResponseSnapshotPolicy) GetIdOk() (ret GetSnapshotPolicyResponseSnapshotPolicyGetIdRetType, ok bool) { + return getGetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeTypeOk(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 *GetSnapshotPolicyResponseSnapshotPolicy) 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 *GetSnapshotPolicyResponseSnapshotPolicy) SetId(v GetSnapshotPolicyResponseSnapshotPolicyGetIdRetType) { + setGetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeType(&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 *GetSnapshotPolicyResponseSnapshotPolicy) GetName() (res GetSnapshotPolicyResponseSnapshotPolicyGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetSnapshotPolicyResponseSnapshotPolicy) GetNameOk() (ret GetSnapshotPolicyResponseSnapshotPolicyGetNameRetType, ok bool) { + return getGetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeTypeOk(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 *GetSnapshotPolicyResponseSnapshotPolicy) 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 *GetSnapshotPolicyResponseSnapshotPolicy) SetName(v GetSnapshotPolicyResponseSnapshotPolicyGetNameRetType) { + setGetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeType(&o.Name, v) +} + +// GetSchedules returns the Schedules 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 *GetSnapshotPolicyResponseSnapshotPolicy) GetSchedules() (res GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesRetType) { + res, _ = o.GetSchedulesOk() + return +} + +// GetSchedulesOk returns a tuple with the Schedules 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 *GetSnapshotPolicyResponseSnapshotPolicy) GetSchedulesOk() (ret GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesRetType, ok bool) { + return getGetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeTypeOk(o.Schedules) +} + +// HasSchedules 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 *GetSnapshotPolicyResponseSnapshotPolicy) HasSchedules() bool { + _, ok := o.GetSchedulesOk() + return ok +} + +// SetSchedules gets a reference to the given []SnapshotPolicySchedule and assigns it to the Schedules field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *GetSnapshotPolicyResponseSnapshotPolicy) SetSchedules(v GetSnapshotPolicyResponseSnapshotPolicyGetSchedulesRetType) { + setGetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeType(&o.Schedules, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o GetSnapshotPolicyResponseSnapshotPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getGetSnapshotPolicyResponseSnapshotPolicyGetCommentAttributeTypeOk(o.Comment); ok { + toSerialize["Comment"] = val + } + if val, ok := getGetSnapshotPolicyResponseSnapshotPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getGetSnapshotPolicyResponseSnapshotPolicygetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + if val, ok := getGetSnapshotPolicyResponseSnapshotPolicyGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getGetSnapshotPolicyResponseSnapshotPolicyGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getGetSnapshotPolicyResponseSnapshotPolicyGetSchedulesAttributeTypeOk(o.Schedules); ok { + toSerialize["Schedules"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableGetSnapshotPolicyResponseSnapshotPolicy struct { + value *GetSnapshotPolicyResponseSnapshotPolicy + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableGetSnapshotPolicyResponseSnapshotPolicy) Get() *GetSnapshotPolicyResponseSnapshotPolicy { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableGetSnapshotPolicyResponseSnapshotPolicy) Set(val *GetSnapshotPolicyResponseSnapshotPolicy) { + 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 NullableGetSnapshotPolicyResponseSnapshotPolicy) 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 *NullableGetSnapshotPolicyResponseSnapshotPolicy) 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 NewNullableGetSnapshotPolicyResponseSnapshotPolicy(val *GetSnapshotPolicyResponseSnapshotPolicy) *NullableGetSnapshotPolicyResponseSnapshotPolicy { + return &NullableGetSnapshotPolicyResponseSnapshotPolicy{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 NullableGetSnapshotPolicyResponseSnapshotPolicy) 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 *NullableGetSnapshotPolicyResponseSnapshotPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_get_snapshot_policy_response_snapshot_policy_test.go b/services/sfs/model_get_snapshot_policy_response_snapshot_policy_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_get_snapshot_policy_response_snapshot_policy_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_get_snapshot_policy_response_test.go b/services/sfs/model_get_snapshot_policy_response_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_get_snapshot_policy_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_list_schedules_response.go b/services/sfs/model_list_schedules_response.go new file mode 100644 index 000000000..93134e958 --- /dev/null +++ b/services/sfs/model_list_schedules_response.go @@ -0,0 +1,152 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" +) + +// checks if the ListSchedulesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListSchedulesResponse{} + +/* + types and functions for schedules +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSchedulesResponseGetSchedulesAttributeType = *[]Schedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSchedulesResponseGetSchedulesArgType = []Schedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSchedulesResponseGetSchedulesRetType = []Schedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListSchedulesResponseGetSchedulesAttributeTypeOk(arg ListSchedulesResponseGetSchedulesAttributeType) (ret ListSchedulesResponseGetSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setListSchedulesResponseGetSchedulesAttributeType(arg *ListSchedulesResponseGetSchedulesAttributeType, val ListSchedulesResponseGetSchedulesRetType) { + *arg = &val +} + +// ListSchedulesResponse struct for ListSchedulesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSchedulesResponse struct { + // List of Schedules + Schedules ListSchedulesResponseGetSchedulesAttributeType `json:"schedules,omitempty"` +} + +// NewListSchedulesResponse instantiates a new ListSchedulesResponse 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 NewListSchedulesResponse() *ListSchedulesResponse { + this := ListSchedulesResponse{} + return &this +} + +// NewListSchedulesResponseWithDefaults instantiates a new ListSchedulesResponse 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 NewListSchedulesResponseWithDefaults() *ListSchedulesResponse { + this := ListSchedulesResponse{} + return &this +} + +// GetSchedules returns the Schedules 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 *ListSchedulesResponse) GetSchedules() (res ListSchedulesResponseGetSchedulesRetType) { + res, _ = o.GetSchedulesOk() + return +} + +// GetSchedulesOk returns a tuple with the Schedules 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 *ListSchedulesResponse) GetSchedulesOk() (ret ListSchedulesResponseGetSchedulesRetType, ok bool) { + return getListSchedulesResponseGetSchedulesAttributeTypeOk(o.Schedules) +} + +// HasSchedules 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 *ListSchedulesResponse) HasSchedules() bool { + _, ok := o.GetSchedulesOk() + return ok +} + +// SetSchedules gets a reference to the given []Schedule and assigns it to the Schedules field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListSchedulesResponse) SetSchedules(v ListSchedulesResponseGetSchedulesRetType) { + setListSchedulesResponseGetSchedulesAttributeType(&o.Schedules, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ListSchedulesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListSchedulesResponseGetSchedulesAttributeTypeOk(o.Schedules); ok { + toSerialize["Schedules"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableListSchedulesResponse struct { + value *ListSchedulesResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableListSchedulesResponse) Get() *ListSchedulesResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableListSchedulesResponse) Set(val *ListSchedulesResponse) { + 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 NullableListSchedulesResponse) 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 *NullableListSchedulesResponse) 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 NewNullableListSchedulesResponse(val *ListSchedulesResponse) *NullableListSchedulesResponse { + return &NullableListSchedulesResponse{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 NullableListSchedulesResponse) 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 *NullableListSchedulesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_list_schedules_response_test.go b/services/sfs/model_list_schedules_response_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_list_schedules_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_list_snapshot_policies_response.go b/services/sfs/model_list_snapshot_policies_response.go new file mode 100644 index 000000000..f12ae66b0 --- /dev/null +++ b/services/sfs/model_list_snapshot_policies_response.go @@ -0,0 +1,152 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" +) + +// checks if the ListSnapshotPoliciesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListSnapshotPoliciesResponse{} + +/* + types and functions for snapshotPolicies +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeType = *[]SnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSnapshotPoliciesResponseGetSnapshotPoliciesArgType = []SnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSnapshotPoliciesResponseGetSnapshotPoliciesRetType = []SnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeTypeOk(arg ListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeType) (ret ListSnapshotPoliciesResponseGetSnapshotPoliciesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeType(arg *ListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeType, val ListSnapshotPoliciesResponseGetSnapshotPoliciesRetType) { + *arg = &val +} + +// ListSnapshotPoliciesResponse struct for ListSnapshotPoliciesResponse +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListSnapshotPoliciesResponse struct { + // List of Snapshot Policies + SnapshotPolicies ListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeType `json:"snapshotPolicies,omitempty"` +} + +// NewListSnapshotPoliciesResponse instantiates a new ListSnapshotPoliciesResponse 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 NewListSnapshotPoliciesResponse() *ListSnapshotPoliciesResponse { + this := ListSnapshotPoliciesResponse{} + return &this +} + +// NewListSnapshotPoliciesResponseWithDefaults instantiates a new ListSnapshotPoliciesResponse 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 NewListSnapshotPoliciesResponseWithDefaults() *ListSnapshotPoliciesResponse { + this := ListSnapshotPoliciesResponse{} + return &this +} + +// GetSnapshotPolicies returns the SnapshotPolicies 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 *ListSnapshotPoliciesResponse) GetSnapshotPolicies() (res ListSnapshotPoliciesResponseGetSnapshotPoliciesRetType) { + res, _ = o.GetSnapshotPoliciesOk() + return +} + +// GetSnapshotPoliciesOk returns a tuple with the SnapshotPolicies 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 *ListSnapshotPoliciesResponse) GetSnapshotPoliciesOk() (ret ListSnapshotPoliciesResponseGetSnapshotPoliciesRetType, ok bool) { + return getListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeTypeOk(o.SnapshotPolicies) +} + +// HasSnapshotPolicies 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 *ListSnapshotPoliciesResponse) HasSnapshotPolicies() bool { + _, ok := o.GetSnapshotPoliciesOk() + return ok +} + +// SetSnapshotPolicies gets a reference to the given []SnapshotPolicy and assigns it to the SnapshotPolicies field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ListSnapshotPoliciesResponse) SetSnapshotPolicies(v ListSnapshotPoliciesResponseGetSnapshotPoliciesRetType) { + setListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeType(&o.SnapshotPolicies, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ListSnapshotPoliciesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getListSnapshotPoliciesResponseGetSnapshotPoliciesAttributeTypeOk(o.SnapshotPolicies); ok { + toSerialize["SnapshotPolicies"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableListSnapshotPoliciesResponse struct { + value *ListSnapshotPoliciesResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableListSnapshotPoliciesResponse) Get() *ListSnapshotPoliciesResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableListSnapshotPoliciesResponse) Set(val *ListSnapshotPoliciesResponse) { + 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 NullableListSnapshotPoliciesResponse) 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 *NullableListSnapshotPoliciesResponse) 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 NewNullableListSnapshotPoliciesResponse(val *ListSnapshotPoliciesResponse) *NullableListSnapshotPoliciesResponse { + return &NullableListSnapshotPoliciesResponse{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 NullableListSnapshotPoliciesResponse) 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 *NullableListSnapshotPoliciesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_list_snapshot_policies_response_test.go b/services/sfs/model_list_snapshot_policies_response_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_list_snapshot_policies_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_resource_pool.go b/services/sfs/model_resource_pool.go index 02fe0591a..b8a01e7c4 100644 --- a/services/sfs/model_resource_pool.go +++ b/services/sfs/model_resource_pool.go @@ -316,6 +316,33 @@ func setResourcePoolGetSizeReducibleAtAttributeType(arg *ResourcePoolGetSizeRedu *arg = &val } +/* + types and functions for snapshotPolicy +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolGetSnapshotPolicyAttributeType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolGetSnapshotPolicyArgType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolGetSnapshotPolicyRetType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getResourcePoolGetSnapshotPolicyAttributeTypeOk(arg ResourcePoolGetSnapshotPolicyAttributeType) (ret ResourcePoolGetSnapshotPolicyRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setResourcePoolGetSnapshotPolicyAttributeType(arg *ResourcePoolGetSnapshotPolicyAttributeType, val ResourcePoolGetSnapshotPolicyRetType) { + *arg = val +} + /* types and functions for snapshotsAreVisible */ @@ -420,6 +447,7 @@ type ResourcePool struct { PerformanceClassDowngradableAt ResourcePoolGetPerformanceClassDowngradableAtAttributeType `json:"performanceClassDowngradableAt,omitempty"` // Time when the size can be reduced again. SizeReducibleAt ResourcePoolGetSizeReducibleAtAttributeType `json:"sizeReducibleAt,omitempty"` + SnapshotPolicy ResourcePoolGetSnapshotPolicyAttributeType `json:"snapshotPolicy,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible ResourcePoolgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` Space ResourcePoolGetSpaceAttributeType `json:"space,omitempty"` @@ -745,6 +773,46 @@ func (o *ResourcePool) SetSizeReducibleAt(v ResourcePoolGetSizeReducibleAtRetTyp setResourcePoolGetSizeReducibleAtAttributeType(&o.SizeReducibleAt, v) } +// GetSnapshotPolicy returns the SnapshotPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePool) GetSnapshotPolicy() (res ResourcePoolGetSnapshotPolicyRetType) { + res, _ = o.GetSnapshotPolicyOk() + return +} + +// GetSnapshotPolicyOk returns a tuple with the SnapshotPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePool) GetSnapshotPolicyOk() (ret ResourcePoolGetSnapshotPolicyRetType, ok bool) { + return getResourcePoolGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy) +} + +// HasSnapshotPolicy 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 *ResourcePool) HasSnapshotPolicy() bool { + _, ok := o.GetSnapshotPolicyOk() + return ok +} + +// SetSnapshotPolicy gets a reference to the given ResourcePoolSnapshotPolicy and assigns it to the SnapshotPolicy field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePool) SetSnapshotPolicy(v ResourcePoolGetSnapshotPolicyRetType) { + setResourcePoolGetSnapshotPolicyAttributeType(&o.SnapshotPolicy, v) +} + +// SetSnapshotPolicyNil sets the value for SnapshotPolicy to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePool) SetSnapshotPolicyNil() { + o.SnapshotPolicy = nil +} + +// UnsetSnapshotPolicy ensures that no value is present for SnapshotPolicy, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePool) UnsetSnapshotPolicy() { + o.SnapshotPolicy = nil +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible 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 *ResourcePool) GetSnapshotsAreVisible() (res ResourcePoolgetSnapshotsAreVisibleRetType) { @@ -862,6 +930,9 @@ func (o ResourcePool) ToMap() (map[string]interface{}, error) { if val, ok := getResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt); ok { toSerialize["SizeReducibleAt"] = val } + if val, ok := getResourcePoolGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy); ok { + toSerialize["SnapshotPolicy"] = val + } if val, ok := getResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { toSerialize["SnapshotsAreVisible"] = val } diff --git a/services/sfs/model_resource_pool_snapshot.go b/services/sfs/model_resource_pool_snapshot.go index 76533f323..76885d756 100644 --- a/services/sfs/model_resource_pool_snapshot.go +++ b/services/sfs/model_resource_pool_snapshot.go @@ -158,6 +158,33 @@ func setResourcePoolSnapshotGetSizeGigabytesAttributeType(arg *ResourcePoolSnaps *arg = &val } +/* + types and functions for snaplockExpiryTime +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotGetSnaplockExpiryTimeArgType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotGetSnaplockExpiryTimeRetType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(arg ResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType) (ret ResourcePoolSnapshotGetSnaplockExpiryTimeRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType(arg *ResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType, val ResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + *arg = val +} + /* types and functions for snapshotName */ @@ -199,6 +226,8 @@ type ResourcePoolSnapshot struct { // Reflects the actual storage footprint in the backend at snapshot time in Gibibytes (e.g. how much storage from the Resource Pool does it use). // Can be cast to int32 without loss of precision. SizeGigabytes ResourcePoolSnapshotGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // Represents the snaplock expiry time if snaplock is enabled for the resource pool + SnaplockExpiryTime ResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType `json:"snaplockExpiryTime,omitempty"` // Name of the Resource Pool Snapshot SnapshotName ResourcePoolSnapshotGetSnapshotNameAttributeType `json:"snapshotName,omitempty"` } @@ -370,6 +399,46 @@ func (o *ResourcePoolSnapshot) SetSizeGigabytes(v ResourcePoolSnapshotGetSizeGig setResourcePoolSnapshotGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) } +// GetSnaplockExpiryTime returns the SnaplockExpiryTime field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSnapshot) GetSnaplockExpiryTime() (res ResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + res, _ = o.GetSnaplockExpiryTimeOk() + return +} + +// GetSnaplockExpiryTimeOk returns a tuple with the SnaplockExpiryTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSnapshot) GetSnaplockExpiryTimeOk() (ret ResourcePoolSnapshotGetSnaplockExpiryTimeRetType, ok bool) { + return getResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(o.SnaplockExpiryTime) +} + +// HasSnaplockExpiryTime 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 *ResourcePoolSnapshot) HasSnaplockExpiryTime() bool { + _, ok := o.GetSnaplockExpiryTimeOk() + return ok +} + +// SetSnaplockExpiryTime gets a reference to the given time.Time and assigns it to the SnaplockExpiryTime field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSnapshot) SetSnaplockExpiryTime(v ResourcePoolSnapshotGetSnaplockExpiryTimeRetType) { + setResourcePoolSnapshotGetSnaplockExpiryTimeAttributeType(&o.SnaplockExpiryTime, v) +} + +// SetSnaplockExpiryTimeNil sets the value for SnaplockExpiryTime to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSnapshot) SetSnaplockExpiryTimeNil() { + o.SnaplockExpiryTime = nil +} + +// UnsetSnaplockExpiryTime ensures that no value is present for SnaplockExpiryTime, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSnapshot) UnsetSnaplockExpiryTime() { + o.SnaplockExpiryTime = nil +} + // GetSnapshotName returns the SnapshotName 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 *ResourcePoolSnapshot) GetSnapshotName() (res ResourcePoolSnapshotGetSnapshotNameRetType) { @@ -415,6 +484,9 @@ func (o ResourcePoolSnapshot) ToMap() (map[string]interface{}, error) { if val, ok := getResourcePoolSnapshotGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { toSerialize["SizeGigabytes"] = val } + if val, ok := getResourcePoolSnapshotGetSnaplockExpiryTimeAttributeTypeOk(o.SnaplockExpiryTime); ok { + toSerialize["SnaplockExpiryTime"] = val + } if val, ok := getResourcePoolSnapshotGetSnapshotNameAttributeTypeOk(o.SnapshotName); ok { toSerialize["SnapshotName"] = val } diff --git a/services/sfs/model_resource_pool_snapshot_policy.go b/services/sfs/model_resource_pool_snapshot_policy.go new file mode 100644 index 000000000..ed9299c58 --- /dev/null +++ b/services/sfs/model_resource_pool_snapshot_policy.go @@ -0,0 +1,211 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" +) + +// checks if the ResourcePoolSnapshotPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourcePoolSnapshotPolicy{} + +/* + types and functions for id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotPolicyGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getResourcePoolSnapshotPolicyGetIdAttributeTypeOk(arg ResourcePoolSnapshotPolicyGetIdAttributeType) (ret ResourcePoolSnapshotPolicyGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setResourcePoolSnapshotPolicyGetIdAttributeType(arg *ResourcePoolSnapshotPolicyGetIdAttributeType, val ResourcePoolSnapshotPolicyGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotPolicyGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotPolicyGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotPolicyGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getResourcePoolSnapshotPolicyGetNameAttributeTypeOk(arg ResourcePoolSnapshotPolicyGetNameAttributeType) (ret ResourcePoolSnapshotPolicyGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setResourcePoolSnapshotPolicyGetNameAttributeType(arg *ResourcePoolSnapshotPolicyGetNameAttributeType, val ResourcePoolSnapshotPolicyGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotPolicyGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotPolicyGetNameRetType = string + +// ResourcePoolSnapshotPolicy (optional) Snapshot Policy +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSnapshotPolicy struct { + // ID of the Snapshot Policy + Id ResourcePoolSnapshotPolicyGetIdAttributeType `json:"id,omitempty"` + // Name of the Snapshot Policy + Name ResourcePoolSnapshotPolicyGetNameAttributeType `json:"name,omitempty"` +} + +// NewResourcePoolSnapshotPolicy instantiates a new ResourcePoolSnapshotPolicy 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 NewResourcePoolSnapshotPolicy() *ResourcePoolSnapshotPolicy { + this := ResourcePoolSnapshotPolicy{} + return &this +} + +// NewResourcePoolSnapshotPolicyWithDefaults instantiates a new ResourcePoolSnapshotPolicy 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 NewResourcePoolSnapshotPolicyWithDefaults() *ResourcePoolSnapshotPolicy { + this := ResourcePoolSnapshotPolicy{} + 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 *ResourcePoolSnapshotPolicy) GetId() (res ResourcePoolSnapshotPolicyGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSnapshotPolicy) GetIdOk() (ret ResourcePoolSnapshotPolicyGetIdRetType, ok bool) { + return getResourcePoolSnapshotPolicyGetIdAttributeTypeOk(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 *ResourcePoolSnapshotPolicy) 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 *ResourcePoolSnapshotPolicy) SetId(v ResourcePoolSnapshotPolicyGetIdRetType) { + setResourcePoolSnapshotPolicyGetIdAttributeType(&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 *ResourcePoolSnapshotPolicy) GetName() (res ResourcePoolSnapshotPolicyGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSnapshotPolicy) GetNameOk() (ret ResourcePoolSnapshotPolicyGetNameRetType, ok bool) { + return getResourcePoolSnapshotPolicyGetNameAttributeTypeOk(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 *ResourcePoolSnapshotPolicy) 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 *ResourcePoolSnapshotPolicy) SetName(v ResourcePoolSnapshotPolicyGetNameRetType) { + setResourcePoolSnapshotPolicyGetNameAttributeType(&o.Name, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ResourcePoolSnapshotPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getResourcePoolSnapshotPolicyGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getResourcePoolSnapshotPolicyGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableResourcePoolSnapshotPolicy struct { + value *ResourcePoolSnapshotPolicy + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableResourcePoolSnapshotPolicy) Get() *ResourcePoolSnapshotPolicy { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableResourcePoolSnapshotPolicy) Set(val *ResourcePoolSnapshotPolicy) { + 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 NullableResourcePoolSnapshotPolicy) 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 *NullableResourcePoolSnapshotPolicy) 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 NewNullableResourcePoolSnapshotPolicy(val *ResourcePoolSnapshotPolicy) *NullableResourcePoolSnapshotPolicy { + return &NullableResourcePoolSnapshotPolicy{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 NullableResourcePoolSnapshotPolicy) 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 *NullableResourcePoolSnapshotPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_resource_pool_snapshot_policy_test.go b/services/sfs/model_resource_pool_snapshot_policy_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_resource_pool_snapshot_policy_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_resource_pool_space.go b/services/sfs/model_resource_pool_space.go index 6a7edbecb..93f689a6c 100644 --- a/services/sfs/model_resource_pool_space.go +++ b/services/sfs/model_resource_pool_space.go @@ -72,6 +72,33 @@ func setResourcePoolSpaceGetSizeGigabytesAttributeType(arg *ResourcePoolSpaceGet *arg = &val } +/* + types and functions for usedBySnapshotsGigabytes +*/ + +// isDouble +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeType = *float64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSpaceGetUsedBySnapshotsGigabytesArgType = *float64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ResourcePoolSpaceGetUsedBySnapshotsGigabytesRetType = *float64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeTypeOk(arg ResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeType) (ret ResourcePoolSpaceGetUsedBySnapshotsGigabytesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeType(arg *ResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeType, val ResourcePoolSpaceGetUsedBySnapshotsGigabytesRetType) { + *arg = val +} + /* types and functions for usedGigabytes */ @@ -107,6 +134,8 @@ type ResourcePoolSpace struct { // Size of the Resource Pool in Gibibytes. // Can be cast to int32 without loss of precision. SizeGigabytes ResourcePoolSpaceGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // Used space by snapshots (only available when retrieving a single Resource Pool by ID) + UsedBySnapshotsGigabytes ResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeType `json:"usedBySnapshotsGigabytes,omitempty"` // Used space of the Resource Pool (only available when retrieving a single Resource Pool by ID) UsedGigabytes ResourcePoolSpaceGetUsedGigabytesAttributeType `json:"usedGigabytes,omitempty"` } @@ -197,6 +226,46 @@ func (o *ResourcePoolSpace) SetSizeGigabytes(v ResourcePoolSpaceGetSizeGigabytes setResourcePoolSpaceGetSizeGigabytesAttributeType(&o.SizeGigabytes, v) } +// GetUsedBySnapshotsGigabytes returns the UsedBySnapshotsGigabytes field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSpace) GetUsedBySnapshotsGigabytes() (res ResourcePoolSpaceGetUsedBySnapshotsGigabytesRetType) { + res, _ = o.GetUsedBySnapshotsGigabytesOk() + return +} + +// GetUsedBySnapshotsGigabytesOk returns a tuple with the UsedBySnapshotsGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSpace) GetUsedBySnapshotsGigabytesOk() (ret ResourcePoolSpaceGetUsedBySnapshotsGigabytesRetType, ok bool) { + return getResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeTypeOk(o.UsedBySnapshotsGigabytes) +} + +// HasUsedBySnapshotsGigabytes 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 *ResourcePoolSpace) HasUsedBySnapshotsGigabytes() bool { + _, ok := o.GetUsedBySnapshotsGigabytesOk() + return ok +} + +// SetUsedBySnapshotsGigabytes gets a reference to the given float64 and assigns it to the UsedBySnapshotsGigabytes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSpace) SetUsedBySnapshotsGigabytes(v ResourcePoolSpaceGetUsedBySnapshotsGigabytesRetType) { + setResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeType(&o.UsedBySnapshotsGigabytes, v) +} + +// SetUsedBySnapshotsGigabytesNil sets the value for UsedBySnapshotsGigabytes to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSpace) SetUsedBySnapshotsGigabytesNil() { + o.UsedBySnapshotsGigabytes = nil +} + +// UnsetUsedBySnapshotsGigabytes ensures that no value is present for UsedBySnapshotsGigabytes, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ResourcePoolSpace) UnsetUsedBySnapshotsGigabytes() { + o.UsedBySnapshotsGigabytes = nil +} + // GetUsedGigabytes returns the UsedGigabytes field value if set, zero value otherwise (both if not set or set to explicit null). // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ResourcePoolSpace) GetUsedGigabytes() (res ResourcePoolSpaceGetUsedGigabytesRetType) { @@ -246,6 +315,9 @@ func (o ResourcePoolSpace) ToMap() (map[string]interface{}, error) { if val, ok := getResourcePoolSpaceGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { toSerialize["SizeGigabytes"] = val } + if val, ok := getResourcePoolSpaceGetUsedBySnapshotsGigabytesAttributeTypeOk(o.UsedBySnapshotsGigabytes); ok { + toSerialize["UsedBySnapshotsGigabytes"] = val + } if val, ok := getResourcePoolSpaceGetUsedGigabytesAttributeTypeOk(o.UsedGigabytes); ok { toSerialize["UsedGigabytes"] = val } diff --git a/services/sfs/model_schedule.go b/services/sfs/model_schedule.go new file mode 100644 index 000000000..4e8e3fcb7 --- /dev/null +++ b/services/sfs/model_schedule.go @@ -0,0 +1,330 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" + "time" +) + +// checks if the Schedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schedule{} + +/* + types and functions for createdAt +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetCreatedAtRetType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getScheduleGetCreatedAtAttributeTypeOk(arg ScheduleGetCreatedAtAttributeType) (ret ScheduleGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setScheduleGetCreatedAtAttributeType(arg *ScheduleGetCreatedAtAttributeType, val ScheduleGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getScheduleGetIdAttributeTypeOk(arg ScheduleGetIdAttributeType) (ret ScheduleGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setScheduleGetIdAttributeType(arg *ScheduleGetIdAttributeType, val ScheduleGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetIdRetType = string + +/* + types and functions for interval +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetIntervalAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getScheduleGetIntervalAttributeTypeOk(arg ScheduleGetIntervalAttributeType) (ret ScheduleGetIntervalRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setScheduleGetIntervalAttributeType(arg *ScheduleGetIntervalAttributeType, val ScheduleGetIntervalRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetIntervalArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetIntervalRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getScheduleGetNameAttributeTypeOk(arg ScheduleGetNameAttributeType) (ret ScheduleGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setScheduleGetNameAttributeType(arg *ScheduleGetNameAttributeType, val ScheduleGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ScheduleGetNameRetType = string + +// Schedule struct for Schedule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type Schedule struct { + // created at timestamp + CreatedAt ScheduleGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // ID of the Schedule + Id ScheduleGetIdAttributeType `json:"id,omitempty"` + // Interval of the Schedule (follows the cron schedule expression in Unix-like systems) + Interval ScheduleGetIntervalAttributeType `json:"interval,omitempty"` + // Name of the Schedule + Name ScheduleGetNameAttributeType `json:"name,omitempty"` +} + +// NewSchedule instantiates a new Schedule 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 NewSchedule() *Schedule { + this := Schedule{} + return &this +} + +// NewScheduleWithDefaults instantiates a new Schedule 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 NewScheduleWithDefaults() *Schedule { + this := Schedule{} + return &this +} + +// GetCreatedAt returns the CreatedAt 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 *Schedule) GetCreatedAt() (res ScheduleGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Schedule) GetCreatedAtOk() (ret ScheduleGetCreatedAtRetType, ok bool) { + return getScheduleGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt 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 *Schedule) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Schedule) SetCreatedAt(v ScheduleGetCreatedAtRetType) { + setScheduleGetCreatedAtAttributeType(&o.CreatedAt, 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 *Schedule) GetId() (res ScheduleGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Schedule) GetIdOk() (ret ScheduleGetIdRetType, ok bool) { + return getScheduleGetIdAttributeTypeOk(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 *Schedule) 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 *Schedule) SetId(v ScheduleGetIdRetType) { + setScheduleGetIdAttributeType(&o.Id, v) +} + +// GetInterval returns the Interval 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 *Schedule) GetInterval() (res ScheduleGetIntervalRetType) { + res, _ = o.GetIntervalOk() + return +} + +// GetIntervalOk returns a tuple with the Interval 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 *Schedule) GetIntervalOk() (ret ScheduleGetIntervalRetType, ok bool) { + return getScheduleGetIntervalAttributeTypeOk(o.Interval) +} + +// HasInterval 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 *Schedule) HasInterval() bool { + _, ok := o.GetIntervalOk() + return ok +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Schedule) SetInterval(v ScheduleGetIntervalRetType) { + setScheduleGetIntervalAttributeType(&o.Interval, 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 *Schedule) GetName() (res ScheduleGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Schedule) GetNameOk() (ret ScheduleGetNameRetType, ok bool) { + return getScheduleGetNameAttributeTypeOk(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 *Schedule) 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 *Schedule) SetName(v ScheduleGetNameRetType) { + setScheduleGetNameAttributeType(&o.Name, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o Schedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getScheduleGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getScheduleGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getScheduleGetIntervalAttributeTypeOk(o.Interval); ok { + toSerialize["Interval"] = val + } + if val, ok := getScheduleGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableSchedule struct { + value *Schedule + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableSchedule) Get() *Schedule { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableSchedule) Set(val *Schedule) { + 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 NullableSchedule) 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 *NullableSchedule) 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 NewNullableSchedule(val *Schedule) *NullableSchedule { + return &NullableSchedule{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 NullableSchedule) 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 *NullableSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_schedule_test.go b/services/sfs/model_schedule_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_schedule_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_snapshot_policy.go b/services/sfs/model_snapshot_policy.go new file mode 100644 index 000000000..e7340d18a --- /dev/null +++ b/services/sfs/model_snapshot_policy.go @@ -0,0 +1,448 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" + "time" +) + +// checks if the SnapshotPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotPolicy{} + +/* + types and functions for comment +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetCommentAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyGetCommentAttributeTypeOk(arg SnapshotPolicyGetCommentAttributeType) (ret SnapshotPolicyGetCommentRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyGetCommentAttributeType(arg *SnapshotPolicyGetCommentAttributeType, val SnapshotPolicyGetCommentRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetCommentArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetCommentRetType = string + +/* + types and functions for createdAt +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetCreatedAtRetType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyGetCreatedAtAttributeTypeOk(arg SnapshotPolicyGetCreatedAtAttributeType) (ret SnapshotPolicyGetCreatedAtRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyGetCreatedAtAttributeType(arg *SnapshotPolicyGetCreatedAtAttributeType, val SnapshotPolicyGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for enabled +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicygetEnabledAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicygetEnabledArgType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicygetEnabledRetType = bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicygetEnabledAttributeTypeOk(arg SnapshotPolicygetEnabledAttributeType) (ret SnapshotPolicygetEnabledRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicygetEnabledAttributeType(arg *SnapshotPolicygetEnabledAttributeType, val SnapshotPolicygetEnabledRetType) { + *arg = &val +} + +/* + types and functions for id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyGetIdAttributeTypeOk(arg SnapshotPolicyGetIdAttributeType) (ret SnapshotPolicyGetIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyGetIdAttributeType(arg *SnapshotPolicyGetIdAttributeType, val SnapshotPolicyGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyGetNameAttributeTypeOk(arg SnapshotPolicyGetNameAttributeType) (ret SnapshotPolicyGetNameRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyGetNameAttributeType(arg *SnapshotPolicyGetNameAttributeType, val SnapshotPolicyGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetNameRetType = string + +/* + types and functions for schedules +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetSchedulesAttributeType = *[]SnapshotPolicySchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetSchedulesArgType = []SnapshotPolicySchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyGetSchedulesRetType = []SnapshotPolicySchedule + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyGetSchedulesAttributeTypeOk(arg SnapshotPolicyGetSchedulesAttributeType) (ret SnapshotPolicyGetSchedulesRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyGetSchedulesAttributeType(arg *SnapshotPolicyGetSchedulesAttributeType, val SnapshotPolicyGetSchedulesRetType) { + *arg = &val +} + +// SnapshotPolicy struct for SnapshotPolicy +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicy struct { + // Comment of the Snapshot Policy + Comment SnapshotPolicyGetCommentAttributeType `json:"comment,omitempty"` + // created at timestamp + CreatedAt SnapshotPolicyGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // Wether the Snapshot Policy is enabled + Enabled SnapshotPolicygetEnabledAttributeType `json:"enabled,omitempty"` + // ID of the Snapshot Policy + Id SnapshotPolicyGetIdAttributeType `json:"id,omitempty"` + // Name of the Snapshot Policy + Name SnapshotPolicyGetNameAttributeType `json:"name,omitempty"` + // associated schedules + Schedules SnapshotPolicyGetSchedulesAttributeType `json:"schedules,omitempty"` +} + +// NewSnapshotPolicy instantiates a new SnapshotPolicy 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 NewSnapshotPolicy() *SnapshotPolicy { + this := SnapshotPolicy{} + return &this +} + +// NewSnapshotPolicyWithDefaults instantiates a new SnapshotPolicy 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 NewSnapshotPolicyWithDefaults() *SnapshotPolicy { + this := SnapshotPolicy{} + return &this +} + +// GetComment returns the Comment 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 *SnapshotPolicy) GetComment() (res SnapshotPolicyGetCommentRetType) { + res, _ = o.GetCommentOk() + return +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicy) GetCommentOk() (ret SnapshotPolicyGetCommentRetType, ok bool) { + return getSnapshotPolicyGetCommentAttributeTypeOk(o.Comment) +} + +// HasComment 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 *SnapshotPolicy) HasComment() bool { + _, ok := o.GetCommentOk() + return ok +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicy) SetComment(v SnapshotPolicyGetCommentRetType) { + setSnapshotPolicyGetCommentAttributeType(&o.Comment, v) +} + +// GetCreatedAt returns the CreatedAt 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 *SnapshotPolicy) GetCreatedAt() (res SnapshotPolicyGetCreatedAtRetType) { + res, _ = o.GetCreatedAtOk() + return +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicy) GetCreatedAtOk() (ret SnapshotPolicyGetCreatedAtRetType, ok bool) { + return getSnapshotPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// HasCreatedAt 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 *SnapshotPolicy) HasCreatedAt() bool { + _, ok := o.GetCreatedAtOk() + return ok +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicy) SetCreatedAt(v SnapshotPolicyGetCreatedAtRetType) { + setSnapshotPolicyGetCreatedAtAttributeType(&o.CreatedAt, 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 *SnapshotPolicy) GetEnabled() (res SnapshotPolicygetEnabledRetType) { + res, _ = o.GetEnabledOk() + return +} + +// 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 *SnapshotPolicy) GetEnabledOk() (ret SnapshotPolicygetEnabledRetType, ok bool) { + return getSnapshotPolicygetEnabledAttributeTypeOk(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 *SnapshotPolicy) 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 *SnapshotPolicy) SetEnabled(v SnapshotPolicygetEnabledRetType) { + setSnapshotPolicygetEnabledAttributeType(&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 *SnapshotPolicy) GetId() (res SnapshotPolicyGetIdRetType) { + res, _ = o.GetIdOk() + return +} + +// GetIdOk returns a tuple with the Id field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicy) GetIdOk() (ret SnapshotPolicyGetIdRetType, ok bool) { + return getSnapshotPolicyGetIdAttributeTypeOk(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 *SnapshotPolicy) 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 *SnapshotPolicy) SetId(v SnapshotPolicyGetIdRetType) { + setSnapshotPolicyGetIdAttributeType(&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 *SnapshotPolicy) GetName() (res SnapshotPolicyGetNameRetType) { + res, _ = o.GetNameOk() + return +} + +// GetNameOk returns a tuple with the Name field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicy) GetNameOk() (ret SnapshotPolicyGetNameRetType, ok bool) { + return getSnapshotPolicyGetNameAttributeTypeOk(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 *SnapshotPolicy) 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 *SnapshotPolicy) SetName(v SnapshotPolicyGetNameRetType) { + setSnapshotPolicyGetNameAttributeType(&o.Name, v) +} + +// GetSchedules returns the Schedules 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 *SnapshotPolicy) GetSchedules() (res SnapshotPolicyGetSchedulesRetType) { + res, _ = o.GetSchedulesOk() + return +} + +// GetSchedulesOk returns a tuple with the Schedules 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 *SnapshotPolicy) GetSchedulesOk() (ret SnapshotPolicyGetSchedulesRetType, ok bool) { + return getSnapshotPolicyGetSchedulesAttributeTypeOk(o.Schedules) +} + +// HasSchedules 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 *SnapshotPolicy) HasSchedules() bool { + _, ok := o.GetSchedulesOk() + return ok +} + +// SetSchedules gets a reference to the given []SnapshotPolicySchedule and assigns it to the Schedules field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicy) SetSchedules(v SnapshotPolicyGetSchedulesRetType) { + setSnapshotPolicyGetSchedulesAttributeType(&o.Schedules, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o SnapshotPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getSnapshotPolicyGetCommentAttributeTypeOk(o.Comment); ok { + toSerialize["Comment"] = val + } + if val, ok := getSnapshotPolicyGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getSnapshotPolicygetEnabledAttributeTypeOk(o.Enabled); ok { + toSerialize["Enabled"] = val + } + if val, ok := getSnapshotPolicyGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getSnapshotPolicyGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getSnapshotPolicyGetSchedulesAttributeTypeOk(o.Schedules); ok { + toSerialize["Schedules"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableSnapshotPolicy struct { + value *SnapshotPolicy + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableSnapshotPolicy) Get() *SnapshotPolicy { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableSnapshotPolicy) Set(val *SnapshotPolicy) { + 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 NullableSnapshotPolicy) 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 *NullableSnapshotPolicy) 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 NewNullableSnapshotPolicy(val *SnapshotPolicy) *NullableSnapshotPolicy { + return &NullableSnapshotPolicy{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 NullableSnapshotPolicy) 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 *NullableSnapshotPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_snapshot_policy_schedule.go b/services/sfs/model_snapshot_policy_schedule.go new file mode 100644 index 000000000..a7375508f --- /dev/null +++ b/services/sfs/model_snapshot_policy_schedule.go @@ -0,0 +1,325 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.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 sfs + +import ( + "encoding/json" +) + +// checks if the SnapshotPolicySchedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotPolicySchedule{} + +/* + types and functions for count +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetCountAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetCountArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetCountRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyScheduleGetCountAttributeTypeOk(arg SnapshotPolicyScheduleGetCountAttributeType) (ret SnapshotPolicyScheduleGetCountRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyScheduleGetCountAttributeType(arg *SnapshotPolicyScheduleGetCountAttributeType, val SnapshotPolicyScheduleGetCountRetType) { + *arg = &val +} + +/* + types and functions for prefix +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetPrefixAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyScheduleGetPrefixAttributeTypeOk(arg SnapshotPolicyScheduleGetPrefixAttributeType) (ret SnapshotPolicyScheduleGetPrefixRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyScheduleGetPrefixAttributeType(arg *SnapshotPolicyScheduleGetPrefixAttributeType, val SnapshotPolicyScheduleGetPrefixRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetPrefixArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetPrefixRetType = string + +/* + types and functions for retentionPeriod +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetRetentionPeriodAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyScheduleGetRetentionPeriodAttributeTypeOk(arg SnapshotPolicyScheduleGetRetentionPeriodAttributeType) (ret SnapshotPolicyScheduleGetRetentionPeriodRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyScheduleGetRetentionPeriodAttributeType(arg *SnapshotPolicyScheduleGetRetentionPeriodAttributeType, val SnapshotPolicyScheduleGetRetentionPeriodRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetRetentionPeriodArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetRetentionPeriodRetType = string + +/* + types and functions for scheduleId +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetScheduleIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getSnapshotPolicyScheduleGetScheduleIdAttributeTypeOk(arg SnapshotPolicyScheduleGetScheduleIdAttributeType) (ret SnapshotPolicyScheduleGetScheduleIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setSnapshotPolicyScheduleGetScheduleIdAttributeType(arg *SnapshotPolicyScheduleGetScheduleIdAttributeType, val SnapshotPolicyScheduleGetScheduleIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetScheduleIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicyScheduleGetScheduleIdRetType = string + +// SnapshotPolicySchedule struct for SnapshotPolicySchedule +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type SnapshotPolicySchedule struct { + Count SnapshotPolicyScheduleGetCountAttributeType `json:"count,omitempty"` + Prefix SnapshotPolicyScheduleGetPrefixAttributeType `json:"prefix,omitempty"` + RetentionPeriod SnapshotPolicyScheduleGetRetentionPeriodAttributeType `json:"retentionPeriod,omitempty"` + ScheduleId SnapshotPolicyScheduleGetScheduleIdAttributeType `json:"scheduleId,omitempty"` +} + +// NewSnapshotPolicySchedule instantiates a new SnapshotPolicySchedule 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 NewSnapshotPolicySchedule() *SnapshotPolicySchedule { + this := SnapshotPolicySchedule{} + return &this +} + +// NewSnapshotPolicyScheduleWithDefaults instantiates a new SnapshotPolicySchedule 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 NewSnapshotPolicyScheduleWithDefaults() *SnapshotPolicySchedule { + this := SnapshotPolicySchedule{} + return &this +} + +// GetCount returns the Count 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 *SnapshotPolicySchedule) GetCount() (res SnapshotPolicyScheduleGetCountRetType) { + res, _ = o.GetCountOk() + return +} + +// GetCountOk returns a tuple with the Count 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 *SnapshotPolicySchedule) GetCountOk() (ret SnapshotPolicyScheduleGetCountRetType, ok bool) { + return getSnapshotPolicyScheduleGetCountAttributeTypeOk(o.Count) +} + +// HasCount 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 *SnapshotPolicySchedule) HasCount() bool { + _, ok := o.GetCountOk() + return ok +} + +// SetCount gets a reference to the given int64 and assigns it to the Count field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicySchedule) SetCount(v SnapshotPolicyScheduleGetCountRetType) { + setSnapshotPolicyScheduleGetCountAttributeType(&o.Count, v) +} + +// GetPrefix returns the Prefix 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 *SnapshotPolicySchedule) GetPrefix() (res SnapshotPolicyScheduleGetPrefixRetType) { + res, _ = o.GetPrefixOk() + return +} + +// GetPrefixOk returns a tuple with the Prefix 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 *SnapshotPolicySchedule) GetPrefixOk() (ret SnapshotPolicyScheduleGetPrefixRetType, ok bool) { + return getSnapshotPolicyScheduleGetPrefixAttributeTypeOk(o.Prefix) +} + +// HasPrefix 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 *SnapshotPolicySchedule) HasPrefix() bool { + _, ok := o.GetPrefixOk() + return ok +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicySchedule) SetPrefix(v SnapshotPolicyScheduleGetPrefixRetType) { + setSnapshotPolicyScheduleGetPrefixAttributeType(&o.Prefix, 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 *SnapshotPolicySchedule) GetRetentionPeriod() (res SnapshotPolicyScheduleGetRetentionPeriodRetType) { + res, _ = o.GetRetentionPeriodOk() + return +} + +// 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 *SnapshotPolicySchedule) GetRetentionPeriodOk() (ret SnapshotPolicyScheduleGetRetentionPeriodRetType, ok bool) { + return getSnapshotPolicyScheduleGetRetentionPeriodAttributeTypeOk(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 *SnapshotPolicySchedule) HasRetentionPeriod() bool { + _, ok := o.GetRetentionPeriodOk() + return ok +} + +// SetRetentionPeriod gets a reference to the given string 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 *SnapshotPolicySchedule) SetRetentionPeriod(v SnapshotPolicyScheduleGetRetentionPeriodRetType) { + setSnapshotPolicyScheduleGetRetentionPeriodAttributeType(&o.RetentionPeriod, v) +} + +// GetScheduleId returns the ScheduleId 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 *SnapshotPolicySchedule) GetScheduleId() (res SnapshotPolicyScheduleGetScheduleIdRetType) { + res, _ = o.GetScheduleIdOk() + return +} + +// GetScheduleIdOk returns a tuple with the ScheduleId 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 *SnapshotPolicySchedule) GetScheduleIdOk() (ret SnapshotPolicyScheduleGetScheduleIdRetType, ok bool) { + return getSnapshotPolicyScheduleGetScheduleIdAttributeTypeOk(o.ScheduleId) +} + +// HasScheduleId 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 *SnapshotPolicySchedule) HasScheduleId() bool { + _, ok := o.GetScheduleIdOk() + return ok +} + +// SetScheduleId gets a reference to the given string and assigns it to the ScheduleId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *SnapshotPolicySchedule) SetScheduleId(v SnapshotPolicyScheduleGetScheduleIdRetType) { + setSnapshotPolicyScheduleGetScheduleIdAttributeType(&o.ScheduleId, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o SnapshotPolicySchedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getSnapshotPolicyScheduleGetCountAttributeTypeOk(o.Count); ok { + toSerialize["Count"] = val + } + if val, ok := getSnapshotPolicyScheduleGetPrefixAttributeTypeOk(o.Prefix); ok { + toSerialize["Prefix"] = val + } + if val, ok := getSnapshotPolicyScheduleGetRetentionPeriodAttributeTypeOk(o.RetentionPeriod); ok { + toSerialize["RetentionPeriod"] = val + } + if val, ok := getSnapshotPolicyScheduleGetScheduleIdAttributeTypeOk(o.ScheduleId); ok { + toSerialize["ScheduleId"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableSnapshotPolicySchedule struct { + value *SnapshotPolicySchedule + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableSnapshotPolicySchedule) Get() *SnapshotPolicySchedule { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableSnapshotPolicySchedule) Set(val *SnapshotPolicySchedule) { + 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 NullableSnapshotPolicySchedule) 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 *NullableSnapshotPolicySchedule) 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 NewNullableSnapshotPolicySchedule(val *SnapshotPolicySchedule) *NullableSnapshotPolicySchedule { + return &NullableSnapshotPolicySchedule{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 NullableSnapshotPolicySchedule) 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 *NullableSnapshotPolicySchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/model_snapshot_policy_schedule_test.go b/services/sfs/model_snapshot_policy_schedule_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_snapshot_policy_schedule_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_snapshot_policy_test.go b/services/sfs/model_snapshot_policy_test.go new file mode 100644 index 000000000..cddb93322 --- /dev/null +++ b/services/sfs/model_snapshot_policy_test.go @@ -0,0 +1,11 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package sfs diff --git a/services/sfs/model_update_resource_pool_payload.go b/services/sfs/model_update_resource_pool_payload.go index 4d1102e2f..e9df30f92 100644 --- a/services/sfs/model_update_resource_pool_payload.go +++ b/services/sfs/model_update_resource_pool_payload.go @@ -126,6 +126,33 @@ func setUpdateResourcePoolPayloadGetSizeGigabytesAttributeType(arg *UpdateResour *arg = val } +/* + types and functions for snapshotPolicyId +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeTypeOk(arg UpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeType) (ret UpdateResourcePoolPayloadGetSnapshotPolicyIdRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setUpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeType(arg *UpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeType, val UpdateResourcePoolPayloadGetSnapshotPolicyIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateResourcePoolPayloadGetSnapshotPolicyIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateResourcePoolPayloadGetSnapshotPolicyIdRetType = string + /* types and functions for snapshotsAreVisible */ @@ -165,6 +192,8 @@ type UpdateResourcePoolPayload struct { // (optional) Size of the Resource Pool (unit: gigabytes) // Can be cast to int32 without loss of precision. SizeGigabytes UpdateResourcePoolPayloadGetSizeGigabytesAttributeType `json:"sizeGigabytes,omitempty"` + // (optional) Id of the Snapshot Policy to use If not set, the Snapshot Policy is not updated If set to an empty string, the Snapshot Policy is removed + SnapshotPolicyId UpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeType `json:"snapshotPolicyId,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible UpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` } @@ -309,6 +338,33 @@ func (o *UpdateResourcePoolPayload) UnsetSizeGigabytes() { o.SizeGigabytes = nil } +// GetSnapshotPolicyId returns the SnapshotPolicyId 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 *UpdateResourcePoolPayload) GetSnapshotPolicyId() (res UpdateResourcePoolPayloadGetSnapshotPolicyIdRetType) { + res, _ = o.GetSnapshotPolicyIdOk() + return +} + +// GetSnapshotPolicyIdOk returns a tuple with the SnapshotPolicyId 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 *UpdateResourcePoolPayload) GetSnapshotPolicyIdOk() (ret UpdateResourcePoolPayloadGetSnapshotPolicyIdRetType, ok bool) { + return getUpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeTypeOk(o.SnapshotPolicyId) +} + +// HasSnapshotPolicyId 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 *UpdateResourcePoolPayload) HasSnapshotPolicyId() bool { + _, ok := o.GetSnapshotPolicyIdOk() + return ok +} + +// SetSnapshotPolicyId gets a reference to the given string and assigns it to the SnapshotPolicyId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateResourcePoolPayload) SetSnapshotPolicyId(v UpdateResourcePoolPayloadGetSnapshotPolicyIdRetType) { + setUpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeType(&o.SnapshotPolicyId, v) +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible 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 *UpdateResourcePoolPayload) GetSnapshotsAreVisible() (res UpdateResourcePoolPayloadgetSnapshotsAreVisibleRetType) { @@ -351,6 +407,9 @@ func (o UpdateResourcePoolPayload) ToMap() (map[string]interface{}, error) { if val, ok := getUpdateResourcePoolPayloadGetSizeGigabytesAttributeTypeOk(o.SizeGigabytes); ok { toSerialize["SizeGigabytes"] = val } + if val, ok := getUpdateResourcePoolPayloadGetSnapshotPolicyIdAttributeTypeOk(o.SnapshotPolicyId); ok { + toSerialize["SnapshotPolicyId"] = val + } if val, ok := getUpdateResourcePoolPayloadgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { toSerialize["SnapshotsAreVisible"] = val } diff --git a/services/sfs/model_update_resource_pool_response_resource_pool.go b/services/sfs/model_update_resource_pool_response_resource_pool.go index f5d970ec2..19b365b67 100644 --- a/services/sfs/model_update_resource_pool_response_resource_pool.go +++ b/services/sfs/model_update_resource_pool_response_resource_pool.go @@ -316,6 +316,33 @@ func setUpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(ar *arg = &val } +/* + types and functions for snapshotPolicy +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyArgType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType = *NullableResourcePoolSnapshotPolicy + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(arg UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType) (ret UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setUpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType(arg *UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType, val UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + *arg = val +} + /* types and functions for snapshotsAreVisible */ @@ -420,6 +447,7 @@ type UpdateResourcePoolResponseResourcePool struct { PerformanceClassDowngradableAt UpdateResourcePoolResponseResourcePoolGetPerformanceClassDowngradableAtAttributeType `json:"performanceClassDowngradableAt,omitempty"` // Time when the size can be reduced again. SizeReducibleAt UpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType `json:"sizeReducibleAt,omitempty"` + SnapshotPolicy UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType `json:"snapshotPolicy,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeType `json:"snapshotsAreVisible,omitempty"` Space UpdateResourcePoolResponseResourcePoolGetSpaceAttributeType `json:"space,omitempty"` @@ -745,6 +773,46 @@ func (o *UpdateResourcePoolResponseResourcePool) SetSizeReducibleAt(v UpdateReso setUpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeType(&o.SizeReducibleAt, v) } +// GetSnapshotPolicy returns the SnapshotPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateResourcePoolResponseResourcePool) GetSnapshotPolicy() (res UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + res, _ = o.GetSnapshotPolicyOk() + return +} + +// GetSnapshotPolicyOk returns a tuple with the SnapshotPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateResourcePoolResponseResourcePool) GetSnapshotPolicyOk() (ret UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType, ok bool) { + return getUpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy) +} + +// HasSnapshotPolicy 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 *UpdateResourcePoolResponseResourcePool) HasSnapshotPolicy() bool { + _, ok := o.GetSnapshotPolicyOk() + return ok +} + +// SetSnapshotPolicy gets a reference to the given ResourcePoolSnapshotPolicy and assigns it to the SnapshotPolicy field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateResourcePoolResponseResourcePool) SetSnapshotPolicy(v UpdateResourcePoolResponseResourcePoolGetSnapshotPolicyRetType) { + setUpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeType(&o.SnapshotPolicy, v) +} + +// SetSnapshotPolicyNil sets the value for SnapshotPolicy to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateResourcePoolResponseResourcePool) SetSnapshotPolicyNil() { + o.SnapshotPolicy = nil +} + +// UnsetSnapshotPolicy ensures that no value is present for SnapshotPolicy, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UpdateResourcePoolResponseResourcePool) UnsetSnapshotPolicy() { + o.SnapshotPolicy = nil +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible 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 *UpdateResourcePoolResponseResourcePool) GetSnapshotsAreVisible() (res UpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleRetType) { @@ -862,6 +930,9 @@ func (o UpdateResourcePoolResponseResourcePool) ToMap() (map[string]interface{}, if val, ok := getUpdateResourcePoolResponseResourcePoolGetSizeReducibleAtAttributeTypeOk(o.SizeReducibleAt); ok { toSerialize["SizeReducibleAt"] = val } + if val, ok := getUpdateResourcePoolResponseResourcePoolGetSnapshotPolicyAttributeTypeOk(o.SnapshotPolicy); ok { + toSerialize["SnapshotPolicy"] = val + } if val, ok := getUpdateResourcePoolResponseResourcePoolgetSnapshotsAreVisibleAttributeTypeOk(o.SnapshotsAreVisible); ok { toSerialize["SnapshotsAreVisible"] = val } diff --git a/services/sfs/oas_commit b/services/sfs/oas_commit index e3713dde3..234be7ccd 100644 --- a/services/sfs/oas_commit +++ b/services/sfs/oas_commit @@ -1 +1 @@ -0e64886dd0847341800d7191ed193b75413be998 +739851cba4a57dde8b44ba05f3e3460fc549fde4 diff --git a/services/sfs/v1api/api_default.go b/services/sfs/v1api/api_default.go index 39fc33fc4..d9205f3e9 100644 --- a/services/sfs/v1api/api_default.go +++ b/services/sfs/v1api/api_default.go @@ -23,6 +23,22 @@ import ( type DefaultAPI interface { + /* + CreateLock Method for CreateLock + + Create Lock + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return ApiCreateLockRequest + */ + CreateLock(ctx context.Context, region string, projectId string) ApiCreateLockRequest + + // CreateLockExecute executes the request + // @return CreateLockResponse + CreateLockExecute(r ApiCreateLockRequest) (*CreateLockResponse, error) + /* CreateResourcePool Create Resource Pool @@ -89,6 +105,22 @@ type DefaultAPI interface { // @return CreateShareExportPolicyResponse CreateShareExportPolicyExecute(r ApiCreateShareExportPolicyRequest) (*CreateShareExportPolicyResponse, error) + /* + DeleteLock Method for DeleteLock + + Delete Lock + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return ApiDeleteLockRequest + */ + DeleteLock(ctx context.Context, region string, projectId string) ApiDeleteLockRequest + + // DeleteLockExecute executes the request + // @return map[string]interface{} + DeleteLockExecute(r ApiDeleteLockRequest) (map[string]interface{}, error) + /* DeleteResourcePool Delete Resource Pool @@ -194,6 +226,22 @@ type DefaultAPI interface { // @return GetResourcePoolSnapshotResponse GetResourcePoolSnapshotExecute(r ApiGetResourcePoolSnapshotRequest) (*GetResourcePoolSnapshotResponse, error) + /* + GetSchedule Method for GetSchedule + + Get Schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return ApiGetScheduleRequest + */ + GetSchedule(ctx context.Context, projectId string, id string) ApiGetScheduleRequest + + // GetScheduleExecute executes the request + // @return GetScheduleResponse + GetScheduleExecute(r ApiGetScheduleRequest) (*GetScheduleResponse, error) + /* GetShare Get Share @@ -230,7 +278,23 @@ type DefaultAPI interface { GetShareExportPolicyExecute(r ApiGetShareExportPolicyRequest) (*GetShareExportPolicyResponse, error) /* - ListPerformanceClasses List Resource Pool Performance Classes + GetSnapshotPolicy Method for GetSnapshotPolicy + + Get Snapshot Policy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return ApiGetSnapshotPolicyRequest + */ + GetSnapshotPolicy(ctx context.Context, projectId string, id string) ApiGetSnapshotPolicyRequest + + // GetSnapshotPolicyExecute executes the request + // @return GetSnapshotPolicyResponse + GetSnapshotPolicyExecute(r ApiGetSnapshotPolicyRequest) (*GetSnapshotPolicyResponse, error) + + /* + ListPerformanceClasses List Resource Performance Classes Lists all performances classes available @@ -276,6 +340,21 @@ type DefaultAPI interface { // @return ListResourcePoolsResponse ListResourcePoolsExecute(r ApiListResourcePoolsRequest) (*ListResourcePoolsResponse, error) + /* + ListSchedules Method for ListSchedules + + List Schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListSchedulesRequest + */ + ListSchedules(ctx context.Context, projectId string) ApiListSchedulesRequest + + // ListSchedulesExecute executes the request + // @return ListSchedulesResponse + ListSchedulesExecute(r ApiListSchedulesRequest) (*ListSchedulesResponse, error) + /* ListShareExportPolicies List Share Export Policies @@ -309,6 +388,21 @@ type DefaultAPI interface { // @return ListSharesResponse ListSharesExecute(r ApiListSharesRequest) (*ListSharesResponse, error) + /* + ListSnapshotPolicies Method for ListSnapshotPolicies + + List Snapshot Policies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListSnapshotPoliciesRequest + */ + ListSnapshotPolicies(ctx context.Context, projectId string) ApiListSnapshotPoliciesRequest + + // ListSnapshotPoliciesExecute executes the request + // @return ListSnapshotPoliciesResponse + ListSnapshotPoliciesExecute(r ApiListSnapshotPoliciesRequest) (*ListSnapshotPoliciesResponse, error) + /* UpdateResourcePool Update Resource Pool @@ -365,6 +459,134 @@ type DefaultAPI interface { // DefaultAPIService DefaultAPI service type DefaultAPIService service +type ApiCreateLockRequest struct { + ctx context.Context + ApiService DefaultAPI + region string + projectId string +} + +func (r ApiCreateLockRequest) Execute() (*CreateLockResponse, error) { + return r.ApiService.CreateLockExecute(r) +} + +/* +CreateLock Method for CreateLock + +Create Lock + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param region + @param projectId + @return ApiCreateLockRequest +*/ +func (a *DefaultAPIService) CreateLock(ctx context.Context, region string, projectId string) ApiCreateLockRequest { + return ApiCreateLockRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return CreateLockResponse +func (a *DefaultAPIService) CreateLockExecute(r ApiCreateLockRequest) (*CreateLockResponse, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *CreateLockResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateLock") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/regions/{region}/project/{projectId}/locks" + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + 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, + } + var v Status + 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 + } + + 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 ApiCreateResourcePoolRequest struct { ctx context.Context ApiService DefaultAPI @@ -1033,43 +1255,40 @@ func (a *DefaultAPIService) CreateShareExportPolicyExecute(r ApiCreateShareExpor return localVarReturnValue, nil } -type ApiDeleteResourcePoolRequest struct { - ctx context.Context - ApiService DefaultAPI - projectId string - region string - resourcePoolId string +type ApiDeleteLockRequest struct { + ctx context.Context + ApiService DefaultAPI + region string + projectId string } -func (r ApiDeleteResourcePoolRequest) Execute() (map[string]interface{}, error) { - return r.ApiService.DeleteResourcePoolExecute(r) +func (r ApiDeleteLockRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteLockExecute(r) } /* -DeleteResourcePool Delete Resource Pool +DeleteLock Method for DeleteLock -Deletes a Resource Pool in a project. +Delete Lock @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId @param region - @param resourcePoolId - @return ApiDeleteResourcePoolRequest + @param projectId + @return ApiDeleteLockRequest */ -func (a *DefaultAPIService) DeleteResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiDeleteResourcePoolRequest { - return ApiDeleteResourcePoolRequest{ - ApiService: a, - ctx: ctx, - projectId: projectId, - region: region, - resourcePoolId: resourcePoolId, +func (a *DefaultAPIService) DeleteLock(ctx context.Context, region string, projectId string) ApiDeleteLockRequest { + return ApiDeleteLockRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, } } // Execute executes the request // // @return map[string]interface{} -func (a *DefaultAPIService) DeleteResourcePoolExecute(r ApiDeleteResourcePoolRequest) (map[string]interface{}, error) { +func (a *DefaultAPIService) DeleteLockExecute(r ApiDeleteLockRequest) (map[string]interface{}, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -1077,15 +1296,14 @@ func (a *DefaultAPIService) DeleteResourcePoolExecute(r ApiDeleteResourcePoolReq localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteResourcePool") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteLock") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath := localBasePath + "/v1/regions/{region}/project/{projectId}/locks" localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"resourcePoolId"+"}", url.PathEscape(parameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1101,7 +1319,7 @@ func (a *DefaultAPIService) DeleteResourcePoolExecute(r ApiDeleteResourcePoolReq } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -1140,41 +1358,15 @@ func (a *DefaultAPIService) DeleteResourcePoolExecute(r ApiDeleteResourcePoolReq ErrorMessage: localVarHTTPResponse.Status, StatusCode: localVarHTTPResponse.StatusCode, } - if localVarHTTPResponse.StatusCode == 400 { - var v ValidationError - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - 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 - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - 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 + var v Status + 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 } @@ -1191,46 +1383,43 @@ func (a *DefaultAPIService) DeleteResourcePoolExecute(r ApiDeleteResourcePoolReq return localVarReturnValue, nil } -type ApiDeleteResourcePoolSnapshotRequest struct { +type ApiDeleteResourcePoolRequest struct { ctx context.Context ApiService DefaultAPI projectId string region string resourcePoolId string - snapshotName string } -func (r ApiDeleteResourcePoolSnapshotRequest) Execute() (map[string]interface{}, error) { - return r.ApiService.DeleteResourcePoolSnapshotExecute(r) +func (r ApiDeleteResourcePoolRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteResourcePoolExecute(r) } /* -DeleteResourcePoolSnapshot Delete Resource Pool Snapshot +DeleteResourcePool Delete Resource Pool -Deletes a Snapshot from a Resource Pool in a project. +Deletes a Resource Pool in a project. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId @param region @param resourcePoolId - @param snapshotName - @return ApiDeleteResourcePoolSnapshotRequest + @return ApiDeleteResourcePoolRequest */ -func (a *DefaultAPIService) DeleteResourcePoolSnapshot(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) ApiDeleteResourcePoolSnapshotRequest { - return ApiDeleteResourcePoolSnapshotRequest{ +func (a *DefaultAPIService) DeleteResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiDeleteResourcePoolRequest { + return ApiDeleteResourcePoolRequest{ ApiService: a, ctx: ctx, projectId: projectId, region: region, resourcePoolId: resourcePoolId, - snapshotName: snapshotName, } } // Execute executes the request // // @return map[string]interface{} -func (a *DefaultAPIService) DeleteResourcePoolSnapshotExecute(r ApiDeleteResourcePoolSnapshotRequest) (map[string]interface{}, error) { +func (a *DefaultAPIService) DeleteResourcePoolExecute(r ApiDeleteResourcePoolRequest) (map[string]interface{}, error) { var ( localVarHTTPMethod = http.MethodDelete localVarPostBody interface{} @@ -1238,16 +1427,15 @@ func (a *DefaultAPIService) DeleteResourcePoolSnapshotExecute(r ApiDeleteResourc localVarReturnValue map[string]interface{} ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteResourcePoolSnapshot") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteResourcePool") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}" + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) localVarPath = strings.Replace(localVarPath, "{"+"resourcePoolId"+"}", url.PathEscape(parameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"snapshotName"+"}", url.PathEscape(parameterValueToString(r.snapshotName, "snapshotName")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1353,7 +1541,169 @@ func (a *DefaultAPIService) DeleteResourcePoolSnapshotExecute(r ApiDeleteResourc return localVarReturnValue, nil } -type ApiDeleteShareRequest struct { +type ApiDeleteResourcePoolSnapshotRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + region string + resourcePoolId string + snapshotName string +} + +func (r ApiDeleteResourcePoolSnapshotRequest) Execute() (map[string]interface{}, error) { + return r.ApiService.DeleteResourcePoolSnapshotExecute(r) +} + +/* +DeleteResourcePoolSnapshot Delete Resource Pool Snapshot + +Deletes a Snapshot from a Resource Pool in a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param region + @param resourcePoolId + @param snapshotName + @return ApiDeleteResourcePoolSnapshotRequest +*/ +func (a *DefaultAPIService) DeleteResourcePoolSnapshot(ctx context.Context, projectId string, region string, resourcePoolId string, snapshotName string) ApiDeleteResourcePoolSnapshotRequest { + return ApiDeleteResourcePoolSnapshotRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + region: region, + resourcePoolId: resourcePoolId, + snapshotName: snapshotName, + } +} + +// Execute executes the request +// +// @return map[string]interface{} +func (a *DefaultAPIService) DeleteResourcePoolSnapshotExecute(r ApiDeleteResourcePoolSnapshotRequest) (map[string]interface{}, error) { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue map[string]interface{} + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteResourcePoolSnapshot") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{region}/resourcePools/{resourcePoolId}/snapshots/{snapshotName}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"resourcePoolId"+"}", url.PathEscape(parameterValueToString(r.resourcePoolId, "resourcePoolId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"snapshotName"+"}", url.PathEscape(parameterValueToString(r.snapshotName, "snapshotName")), -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", "application/problem+json", "text/plain"} + + // 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 == 400 { + var v ValidationError + 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 + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + 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 + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + 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 + } + + 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 ApiDeleteShareRequest struct { ctx context.Context ApiService DefaultAPI projectId string @@ -1993,6 +2343,134 @@ func (a *DefaultAPIService) GetResourcePoolSnapshotExecute(r ApiGetResourcePoolS return localVarReturnValue, nil } +type ApiGetScheduleRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + id string +} + +func (r ApiGetScheduleRequest) Execute() (*GetScheduleResponse, error) { + return r.ApiService.GetScheduleExecute(r) +} + +/* +GetSchedule Method for GetSchedule + +Get Schedule + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return ApiGetScheduleRequest +*/ +func (a *DefaultAPIService) GetSchedule(ctx context.Context, projectId string, id string) ApiGetScheduleRequest { + return ApiGetScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +// Execute executes the request +// +// @return GetScheduleResponse +func (a *DefaultAPIService) GetScheduleExecute(r ApiGetScheduleRequest) (*GetScheduleResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetScheduleResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSchedule") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/schedules/{id}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -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, + } + var v Status + 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 + } + + 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 ApiGetShareRequest struct { ctx context.Context ApiService DefaultAPI @@ -2183,31 +2661,185 @@ func (a *DefaultAPIService) GetShareExportPolicy(ctx context.Context, projectId ApiService: a, ctx: ctx, projectId: projectId, - region: region, - policyId: policyId, + region: region, + policyId: policyId, + } +} + +// Execute executes the request +// +// @return GetShareExportPolicyResponse +func (a *DefaultAPIService) GetShareExportPolicyExecute(r ApiGetShareExportPolicyRequest) (*GetShareExportPolicyResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *GetShareExportPolicyResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetShareExportPolicy") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"policyId"+"}", url.PathEscape(parameterValueToString(r.policyId, "policyId")), -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", "application/problem+json", "text/plain"} + + // 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 == 400 { + var v ValidationError + 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 + } + if localVarHTTPResponse.StatusCode == 401 { + var v string + 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 + } + if localVarHTTPResponse.StatusCode == 500 { + var v Error + 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 + } + + 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 ApiGetSnapshotPolicyRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + id string +} + +func (r ApiGetSnapshotPolicyRequest) Execute() (*GetSnapshotPolicyResponse, error) { + return r.ApiService.GetSnapshotPolicyExecute(r) +} + +/* +GetSnapshotPolicy Method for GetSnapshotPolicy + +Get Snapshot Policy + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @param id + @return ApiGetSnapshotPolicyRequest +*/ +func (a *DefaultAPIService) GetSnapshotPolicy(ctx context.Context, projectId string, id string) ApiGetSnapshotPolicyRequest { + return ApiGetSnapshotPolicyRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, } } // Execute executes the request // -// @return GetShareExportPolicyResponse -func (a *DefaultAPIService) GetShareExportPolicyExecute(r ApiGetShareExportPolicyRequest) (*GetShareExportPolicyResponse, error) { +// @return GetSnapshotPolicyResponse +func (a *DefaultAPIService) GetSnapshotPolicyExecute(r ApiGetSnapshotPolicyRequest) (*GetSnapshotPolicyResponse, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *GetShareExportPolicyResponse + localVarReturnValue *GetSnapshotPolicyResponse ) - localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetShareExportPolicy") + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetSnapshotPolicy") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{region}/shareExportPolicies/{policyId}" + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshotPolicies/{id}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"region"+"}", url.PathEscape(parameterValueToString(r.region, "region")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"policyId"+"}", url.PathEscape(parameterValueToString(r.policyId, "policyId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"id"+"}", url.PathEscape(parameterValueToString(r.id, "id")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -2223,7 +2855,7 @@ func (a *DefaultAPIService) GetShareExportPolicyExecute(r ApiGetShareExportPolic } // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json", "application/problem+json", "text/plain"} + localVarHTTPHeaderAccepts := []string{"application/json"} // set Accept header localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) @@ -2262,41 +2894,15 @@ func (a *DefaultAPIService) GetShareExportPolicyExecute(r ApiGetShareExportPolic ErrorMessage: localVarHTTPResponse.Status, StatusCode: localVarHTTPResponse.StatusCode, } - if localVarHTTPResponse.StatusCode == 400 { - var v ValidationError - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - 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 - } - if localVarHTTPResponse.StatusCode == 500 { - var v Error - 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 + var v Status + 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 } @@ -2323,7 +2929,7 @@ func (r ApiListPerformanceClassesRequest) Execute() (*ListPerformanceClassesResp } /* -ListPerformanceClasses List Resource Pool Performance Classes +ListPerformanceClasses List Resource Performance Classes Lists all performances classes available @@ -2771,6 +3377,130 @@ func (a *DefaultAPIService) ListResourcePoolsExecute(r ApiListResourcePoolsReque return localVarReturnValue, nil } +type ApiListSchedulesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListSchedulesRequest) Execute() (*ListSchedulesResponse, error) { + return r.ApiService.ListSchedulesExecute(r) +} + +/* +ListSchedules Method for ListSchedules + +List Schedules + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListSchedulesRequest +*/ +func (a *DefaultAPIService) ListSchedules(ctx context.Context, projectId string) ApiListSchedulesRequest { + return ApiListSchedulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListSchedulesResponse +func (a *DefaultAPIService) ListSchedulesExecute(r ApiListSchedulesRequest) (*ListSchedulesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListSchedulesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSchedules") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/schedules" + 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, + } + var v Status + 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 + } + + 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 ApiListShareExportPoliciesRequest struct { ctx context.Context ApiService DefaultAPI @@ -3083,6 +3813,139 @@ func (a *DefaultAPIService) ListSharesExecute(r ApiListSharesRequest) (*ListShar return localVarReturnValue, nil } +type ApiListSnapshotPoliciesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + immutable *bool +} + +func (r ApiListSnapshotPoliciesRequest) Immutable(immutable bool) ApiListSnapshotPoliciesRequest { + r.immutable = &immutable + return r +} + +func (r ApiListSnapshotPoliciesRequest) Execute() (*ListSnapshotPoliciesResponse, error) { + return r.ApiService.ListSnapshotPoliciesExecute(r) +} + +/* +ListSnapshotPolicies Method for ListSnapshotPolicies + +List Snapshot Policies + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId + @return ApiListSnapshotPoliciesRequest +*/ +func (a *DefaultAPIService) ListSnapshotPolicies(ctx context.Context, projectId string) ApiListSnapshotPoliciesRequest { + return ApiListSnapshotPoliciesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListSnapshotPoliciesResponse +func (a *DefaultAPIService) ListSnapshotPoliciesExecute(r ApiListSnapshotPoliciesRequest) (*ListSnapshotPoliciesResponse, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListSnapshotPoliciesResponse + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListSnapshotPolicies") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1/projects/{projectId}/snapshotPolicies" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + + if r.immutable != nil { + parameterAddToHeaderOrQuery(localVarQueryParams, "immutable", r.immutable, "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 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, + } + var v Status + 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 + } + + 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 ApiUpdateResourcePoolRequest struct { ctx context.Context ApiService DefaultAPI diff --git a/services/sfs/v1api/api_default_mock.go b/services/sfs/v1api/api_default_mock.go index bf02d4a7d..2f979fef0 100644 --- a/services/sfs/v1api/api_default_mock.go +++ b/services/sfs/v1api/api_default_mock.go @@ -20,6 +20,8 @@ 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 { + // CreateLockExecuteMock can be populated to implement the behavior of the CreateLockExecute function of this mock + CreateLockExecuteMock *func(r ApiCreateLockRequest) (*CreateLockResponse, error) // CreateResourcePoolExecuteMock can be populated to implement the behavior of the CreateResourcePoolExecute function of this mock CreateResourcePoolExecuteMock *func(r ApiCreateResourcePoolRequest) (*CreateResourcePoolResponse, error) // CreateResourcePoolSnapshotExecuteMock can be populated to implement the behavior of the CreateResourcePoolSnapshotExecute function of this mock @@ -28,6 +30,8 @@ type DefaultAPIServiceMock struct { CreateShareExecuteMock *func(r ApiCreateShareRequest) (*CreateShareResponse, error) // CreateShareExportPolicyExecuteMock can be populated to implement the behavior of the CreateShareExportPolicyExecute function of this mock CreateShareExportPolicyExecuteMock *func(r ApiCreateShareExportPolicyRequest) (*CreateShareExportPolicyResponse, error) + // DeleteLockExecuteMock can be populated to implement the behavior of the DeleteLockExecute function of this mock + DeleteLockExecuteMock *func(r ApiDeleteLockRequest) (map[string]interface{}, error) // DeleteResourcePoolExecuteMock can be populated to implement the behavior of the DeleteResourcePoolExecute function of this mock DeleteResourcePoolExecuteMock *func(r ApiDeleteResourcePoolRequest) (map[string]interface{}, error) // DeleteResourcePoolSnapshotExecuteMock can be populated to implement the behavior of the DeleteResourcePoolSnapshotExecute function of this mock @@ -40,20 +44,28 @@ type DefaultAPIServiceMock struct { GetResourcePoolExecuteMock *func(r ApiGetResourcePoolRequest) (*GetResourcePoolResponse, error) // GetResourcePoolSnapshotExecuteMock can be populated to implement the behavior of the GetResourcePoolSnapshotExecute function of this mock GetResourcePoolSnapshotExecuteMock *func(r ApiGetResourcePoolSnapshotRequest) (*GetResourcePoolSnapshotResponse, error) + // GetScheduleExecuteMock can be populated to implement the behavior of the GetScheduleExecute function of this mock + GetScheduleExecuteMock *func(r ApiGetScheduleRequest) (*GetScheduleResponse, error) // GetShareExecuteMock can be populated to implement the behavior of the GetShareExecute function of this mock GetShareExecuteMock *func(r ApiGetShareRequest) (*GetShareResponse, error) // GetShareExportPolicyExecuteMock can be populated to implement the behavior of the GetShareExportPolicyExecute function of this mock GetShareExportPolicyExecuteMock *func(r ApiGetShareExportPolicyRequest) (*GetShareExportPolicyResponse, error) + // GetSnapshotPolicyExecuteMock can be populated to implement the behavior of the GetSnapshotPolicyExecute function of this mock + GetSnapshotPolicyExecuteMock *func(r ApiGetSnapshotPolicyRequest) (*GetSnapshotPolicyResponse, error) // ListPerformanceClassesExecuteMock can be populated to implement the behavior of the ListPerformanceClassesExecute function of this mock ListPerformanceClassesExecuteMock *func(r ApiListPerformanceClassesRequest) (*ListPerformanceClassesResponse, error) // ListResourcePoolSnapshotsExecuteMock can be populated to implement the behavior of the ListResourcePoolSnapshotsExecute function of this mock ListResourcePoolSnapshotsExecuteMock *func(r ApiListResourcePoolSnapshotsRequest) (*ListResourcePoolSnapshotsResponse, error) // ListResourcePoolsExecuteMock can be populated to implement the behavior of the ListResourcePoolsExecute function of this mock ListResourcePoolsExecuteMock *func(r ApiListResourcePoolsRequest) (*ListResourcePoolsResponse, error) + // ListSchedulesExecuteMock can be populated to implement the behavior of the ListSchedulesExecute function of this mock + ListSchedulesExecuteMock *func(r ApiListSchedulesRequest) (*ListSchedulesResponse, error) // ListShareExportPoliciesExecuteMock can be populated to implement the behavior of the ListShareExportPoliciesExecute function of this mock ListShareExportPoliciesExecuteMock *func(r ApiListShareExportPoliciesRequest) (*ListShareExportPoliciesResponse, error) // ListSharesExecuteMock can be populated to implement the behavior of the ListSharesExecute function of this mock ListSharesExecuteMock *func(r ApiListSharesRequest) (*ListSharesResponse, error) + // ListSnapshotPoliciesExecuteMock can be populated to implement the behavior of the ListSnapshotPoliciesExecute function of this mock + ListSnapshotPoliciesExecuteMock *func(r ApiListSnapshotPoliciesRequest) (*ListSnapshotPoliciesResponse, error) // UpdateResourcePoolExecuteMock can be populated to implement the behavior of the UpdateResourcePoolExecute function of this mock UpdateResourcePoolExecuteMock *func(r ApiUpdateResourcePoolRequest) (*UpdateResourcePoolResponse, error) // UpdateShareExecuteMock can be populated to implement the behavior of the UpdateShareExecute function of this mock @@ -62,6 +74,25 @@ type DefaultAPIServiceMock struct { UpdateShareExportPolicyExecuteMock *func(r ApiUpdateShareExportPolicyRequest) (*UpdateShareExportPolicyResponse, error) } +func (a DefaultAPIServiceMock) CreateLock(ctx context.Context, region string, projectId string) ApiCreateLockRequest { + return ApiCreateLockRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + } +} + +// CreateLockExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateLockExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateLockExecute(r ApiCreateLockRequest) (*CreateLockResponse, error) { + if a.CreateLockExecuteMock == nil { + var localVarReturnValue *CreateLockResponse + return localVarReturnValue, nil + } + + return (*a.CreateLockExecuteMock)(r) +} + func (a DefaultAPIServiceMock) CreateResourcePool(ctx context.Context, projectId string, region string) ApiCreateResourcePoolRequest { return ApiCreateResourcePoolRequest{ ApiService: a, @@ -140,6 +171,25 @@ func (a DefaultAPIServiceMock) CreateShareExportPolicyExecute(r ApiCreateShareEx return (*a.CreateShareExportPolicyExecuteMock)(r) } +func (a DefaultAPIServiceMock) DeleteLock(ctx context.Context, region string, projectId string) ApiDeleteLockRequest { + return ApiDeleteLockRequest{ + ApiService: a, + ctx: ctx, + region: region, + projectId: projectId, + } +} + +// DeleteLockExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteLockExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteLockExecute(r ApiDeleteLockRequest) (map[string]interface{}, error) { + if a.DeleteLockExecuteMock == nil { + var localVarReturnValue map[string]interface{} + return localVarReturnValue, nil + } + + return (*a.DeleteLockExecuteMock)(r) +} + func (a DefaultAPIServiceMock) DeleteResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiDeleteResourcePoolRequest { return ApiDeleteResourcePoolRequest{ ApiService: a, @@ -263,6 +313,25 @@ func (a DefaultAPIServiceMock) GetResourcePoolSnapshotExecute(r ApiGetResourcePo return (*a.GetResourcePoolSnapshotExecuteMock)(r) } +func (a DefaultAPIServiceMock) GetSchedule(ctx context.Context, projectId string, id string) ApiGetScheduleRequest { + return ApiGetScheduleRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +// GetScheduleExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetScheduleExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetScheduleExecute(r ApiGetScheduleRequest) (*GetScheduleResponse, error) { + if a.GetScheduleExecuteMock == nil { + var localVarReturnValue *GetScheduleResponse + return localVarReturnValue, nil + } + + return (*a.GetScheduleExecuteMock)(r) +} + func (a DefaultAPIServiceMock) GetShare(ctx context.Context, projectId string, region string, resourcePoolId string, shareId string) ApiGetShareRequest { return ApiGetShareRequest{ ApiService: a, @@ -304,6 +373,25 @@ func (a DefaultAPIServiceMock) GetShareExportPolicyExecute(r ApiGetShareExportPo return (*a.GetShareExportPolicyExecuteMock)(r) } +func (a DefaultAPIServiceMock) GetSnapshotPolicy(ctx context.Context, projectId string, id string) ApiGetSnapshotPolicyRequest { + return ApiGetSnapshotPolicyRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + id: id, + } +} + +// GetSnapshotPolicyExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetSnapshotPolicyExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetSnapshotPolicyExecute(r ApiGetSnapshotPolicyRequest) (*GetSnapshotPolicyResponse, error) { + if a.GetSnapshotPolicyExecuteMock == nil { + var localVarReturnValue *GetSnapshotPolicyResponse + return localVarReturnValue, nil + } + + return (*a.GetSnapshotPolicyExecuteMock)(r) +} + func (a DefaultAPIServiceMock) ListPerformanceClasses(ctx context.Context) ApiListPerformanceClassesRequest { return ApiListPerformanceClassesRequest{ ApiService: a, @@ -360,6 +448,24 @@ func (a DefaultAPIServiceMock) ListResourcePoolsExecute(r ApiListResourcePoolsRe return (*a.ListResourcePoolsExecuteMock)(r) } +func (a DefaultAPIServiceMock) ListSchedules(ctx context.Context, projectId string) ApiListSchedulesRequest { + return ApiListSchedulesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListSchedulesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSchedulesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSchedulesExecute(r ApiListSchedulesRequest) (*ListSchedulesResponse, error) { + if a.ListSchedulesExecuteMock == nil { + var localVarReturnValue *ListSchedulesResponse + return localVarReturnValue, nil + } + + return (*a.ListSchedulesExecuteMock)(r) +} + func (a DefaultAPIServiceMock) ListShareExportPolicies(ctx context.Context, projectId string, region string) ApiListShareExportPoliciesRequest { return ApiListShareExportPoliciesRequest{ ApiService: a, @@ -399,6 +505,24 @@ func (a DefaultAPIServiceMock) ListSharesExecute(r ApiListSharesRequest) (*ListS return (*a.ListSharesExecuteMock)(r) } +func (a DefaultAPIServiceMock) ListSnapshotPolicies(ctx context.Context, projectId string) ApiListSnapshotPoliciesRequest { + return ApiListSnapshotPoliciesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListSnapshotPoliciesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListSnapshotPoliciesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListSnapshotPoliciesExecute(r ApiListSnapshotPoliciesRequest) (*ListSnapshotPoliciesResponse, error) { + if a.ListSnapshotPoliciesExecuteMock == nil { + var localVarReturnValue *ListSnapshotPoliciesResponse + return localVarReturnValue, nil + } + + return (*a.ListSnapshotPoliciesExecuteMock)(r) +} + func (a DefaultAPIServiceMock) UpdateResourcePool(ctx context.Context, projectId string, region string, resourcePoolId string) ApiUpdateResourcePoolRequest { return ApiUpdateResourcePoolRequest{ ApiService: a, diff --git a/services/sfs/v1api/model_create_lock_response.go b/services/sfs/v1api/model_create_lock_response.go new file mode 100644 index 000000000..ad463fabf --- /dev/null +++ b/services/sfs/v1api/model_create_lock_response.go @@ -0,0 +1,153 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the CreateLockResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateLockResponse{} + +// CreateLockResponse struct for CreateLockResponse +type CreateLockResponse struct { + LockId *string `json:"lockId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _CreateLockResponse CreateLockResponse + +// NewCreateLockResponse instantiates a new CreateLockResponse 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 NewCreateLockResponse() *CreateLockResponse { + this := CreateLockResponse{} + return &this +} + +// NewCreateLockResponseWithDefaults instantiates a new CreateLockResponse 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 NewCreateLockResponseWithDefaults() *CreateLockResponse { + this := CreateLockResponse{} + return &this +} + +// GetLockId returns the LockId field value if set, zero value otherwise. +func (o *CreateLockResponse) GetLockId() string { + if o == nil || IsNil(o.LockId) { + var ret string + return ret + } + return *o.LockId +} + +// GetLockIdOk returns a tuple with the LockId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateLockResponse) GetLockIdOk() (*string, bool) { + if o == nil || IsNil(o.LockId) { + return nil, false + } + return o.LockId, true +} + +// HasLockId returns a boolean if a field has been set. +func (o *CreateLockResponse) HasLockId() bool { + if o != nil && !IsNil(o.LockId) { + return true + } + + return false +} + +// SetLockId gets a reference to the given string and assigns it to the LockId field. +func (o *CreateLockResponse) SetLockId(v string) { + o.LockId = &v +} + +func (o CreateLockResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateLockResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.LockId) { + toSerialize["lockId"] = o.LockId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *CreateLockResponse) UnmarshalJSON(data []byte) (err error) { + varCreateLockResponse := _CreateLockResponse{} + + err = json.Unmarshal(data, &varCreateLockResponse) + + if err != nil { + return err + } + + *o = CreateLockResponse(varCreateLockResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "lockId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableCreateLockResponse struct { + value *CreateLockResponse + isSet bool +} + +func (v NullableCreateLockResponse) Get() *CreateLockResponse { + return v.value +} + +func (v *NullableCreateLockResponse) Set(val *CreateLockResponse) { + v.value = val + v.isSet = true +} + +func (v NullableCreateLockResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateLockResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateLockResponse(val *CreateLockResponse) *NullableCreateLockResponse { + return &NullableCreateLockResponse{value: val, isSet: true} +} + +func (v NullableCreateLockResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateLockResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_create_resource_pool_payload.go b/services/sfs/v1api/model_create_resource_pool_payload.go index c6a518fa7..c5aa0541f 100644 --- a/services/sfs/v1api/model_create_resource_pool_payload.go +++ b/services/sfs/v1api/model_create_resource_pool_payload.go @@ -32,6 +32,8 @@ type CreateResourcePoolPayload struct { PerformanceClass string `json:"performanceClass"` // Size of the Resource Pool (unit: gibibytes) SizeGigabytes int32 `json:"sizeGigabytes"` + // (optional) Id of the Snapshot Policy to use + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible *bool `json:"snapshotsAreVisible,omitempty"` AdditionalProperties map[string]interface{} @@ -213,6 +215,38 @@ func (o *CreateResourcePoolPayload) SetSizeGigabytes(v int32) { o.SizeGigabytes = v } +// GetSnapshotPolicyId returns the SnapshotPolicyId field value if set, zero value otherwise. +func (o *CreateResourcePoolPayload) GetSnapshotPolicyId() string { + if o == nil || IsNil(o.SnapshotPolicyId) { + var ret string + return ret + } + return *o.SnapshotPolicyId +} + +// GetSnapshotPolicyIdOk returns a tuple with the SnapshotPolicyId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateResourcePoolPayload) GetSnapshotPolicyIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotPolicyId) { + return nil, false + } + return o.SnapshotPolicyId, true +} + +// HasSnapshotPolicyId returns a boolean if a field has been set. +func (o *CreateResourcePoolPayload) HasSnapshotPolicyId() bool { + if o != nil && !IsNil(o.SnapshotPolicyId) { + return true + } + + return false +} + +// SetSnapshotPolicyId gets a reference to the given string and assigns it to the SnapshotPolicyId field. +func (o *CreateResourcePoolPayload) SetSnapshotPolicyId(v string) { + o.SnapshotPolicyId = &v +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. func (o *CreateResourcePoolPayload) GetSnapshotsAreVisible() bool { if o == nil || IsNil(o.SnapshotsAreVisible) { @@ -263,6 +297,9 @@ func (o CreateResourcePoolPayload) ToMap() (map[string]interface{}, error) { toSerialize["name"] = o.Name toSerialize["performanceClass"] = o.PerformanceClass toSerialize["sizeGigabytes"] = o.SizeGigabytes + if !IsNil(o.SnapshotPolicyId) { + toSerialize["snapshotPolicyId"] = o.SnapshotPolicyId + } if !IsNil(o.SnapshotsAreVisible) { toSerialize["snapshotsAreVisible"] = o.SnapshotsAreVisible } @@ -319,6 +356,7 @@ func (o *CreateResourcePoolPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "name") delete(additionalProperties, "performanceClass") delete(additionalProperties, "sizeGigabytes") + delete(additionalProperties, "snapshotPolicyId") delete(additionalProperties, "snapshotsAreVisible") o.AdditionalProperties = additionalProperties } diff --git a/services/sfs/v1api/model_create_resource_pool_snapshot_payload.go b/services/sfs/v1api/model_create_resource_pool_snapshot_payload.go index 48296e2f1..874ab9cbc 100644 --- a/services/sfs/v1api/model_create_resource_pool_snapshot_payload.go +++ b/services/sfs/v1api/model_create_resource_pool_snapshot_payload.go @@ -22,8 +22,10 @@ type CreateResourcePoolSnapshotPayload struct { // (optional) A comment to add more information about a snapshot Comment NullableString `json:"comment,omitempty"` // Name of the Resource Pool Snapshot - Name *string `json:"name,omitempty"` - AdditionalProperties map[string]interface{} + Name *string `json:"name,omitempty"` + // (optional) Time in hours after which snaplock on the snapshot expires + SnaplockRetentionHours NullableInt32 `json:"snaplockRetentionHours,omitempty"` + AdditionalProperties map[string]interface{} } type _CreateResourcePoolSnapshotPayload CreateResourcePoolSnapshotPayload @@ -120,6 +122,49 @@ func (o *CreateResourcePoolSnapshotPayload) SetName(v string) { o.Name = &v } +// GetSnaplockRetentionHours returns the SnaplockRetentionHours field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *CreateResourcePoolSnapshotPayload) GetSnaplockRetentionHours() int32 { + if o == nil || IsNil(o.SnaplockRetentionHours.Get()) { + var ret int32 + return ret + } + return *o.SnaplockRetentionHours.Get() +} + +// GetSnaplockRetentionHoursOk returns a tuple with the SnaplockRetentionHours field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *CreateResourcePoolSnapshotPayload) GetSnaplockRetentionHoursOk() (*int32, bool) { + if o == nil { + return nil, false + } + return o.SnaplockRetentionHours.Get(), o.SnaplockRetentionHours.IsSet() +} + +// HasSnaplockRetentionHours returns a boolean if a field has been set. +func (o *CreateResourcePoolSnapshotPayload) HasSnaplockRetentionHours() bool { + if o != nil && o.SnaplockRetentionHours.IsSet() { + return true + } + + return false +} + +// SetSnaplockRetentionHours gets a reference to the given NullableInt32 and assigns it to the SnaplockRetentionHours field. +func (o *CreateResourcePoolSnapshotPayload) SetSnaplockRetentionHours(v int32) { + o.SnaplockRetentionHours.Set(&v) +} + +// SetSnaplockRetentionHoursNil sets the value for SnaplockRetentionHours to be an explicit nil +func (o *CreateResourcePoolSnapshotPayload) SetSnaplockRetentionHoursNil() { + o.SnaplockRetentionHours.Set(nil) +} + +// UnsetSnaplockRetentionHours ensures that no value is present for SnaplockRetentionHours, not even an explicit nil +func (o *CreateResourcePoolSnapshotPayload) UnsetSnaplockRetentionHours() { + o.SnaplockRetentionHours.Unset() +} + func (o CreateResourcePoolSnapshotPayload) MarshalJSON() ([]byte, error) { toSerialize, err := o.ToMap() if err != nil { @@ -136,6 +181,9 @@ func (o CreateResourcePoolSnapshotPayload) ToMap() (map[string]interface{}, erro if !IsNil(o.Name) { toSerialize["name"] = o.Name } + if o.SnaplockRetentionHours.IsSet() { + toSerialize["snaplockRetentionHours"] = o.SnaplockRetentionHours.Get() + } for key, value := range o.AdditionalProperties { toSerialize[key] = value @@ -160,6 +208,7 @@ func (o *CreateResourcePoolSnapshotPayload) UnmarshalJSON(data []byte) (err erro if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "comment") delete(additionalProperties, "name") + delete(additionalProperties, "snaplockRetentionHours") o.AdditionalProperties = additionalProperties } diff --git a/services/sfs/v1api/model_get_schedule_response.go b/services/sfs/v1api/model_get_schedule_response.go new file mode 100644 index 000000000..4dccda605 --- /dev/null +++ b/services/sfs/v1api/model_get_schedule_response.go @@ -0,0 +1,154 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetScheduleResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetScheduleResponse{} + +// GetScheduleResponse struct for GetScheduleResponse +type GetScheduleResponse struct { + // Schedule + Schedule *Schedule `json:"schedule,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetScheduleResponse GetScheduleResponse + +// NewGetScheduleResponse instantiates a new GetScheduleResponse 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 NewGetScheduleResponse() *GetScheduleResponse { + this := GetScheduleResponse{} + return &this +} + +// NewGetScheduleResponseWithDefaults instantiates a new GetScheduleResponse 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 NewGetScheduleResponseWithDefaults() *GetScheduleResponse { + this := GetScheduleResponse{} + return &this +} + +// GetSchedule returns the Schedule field value if set, zero value otherwise. +func (o *GetScheduleResponse) GetSchedule() Schedule { + if o == nil || IsNil(o.Schedule) { + var ret Schedule + return ret + } + return *o.Schedule +} + +// GetScheduleOk returns a tuple with the Schedule field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetScheduleResponse) GetScheduleOk() (*Schedule, bool) { + if o == nil || IsNil(o.Schedule) { + return nil, false + } + return o.Schedule, true +} + +// HasSchedule returns a boolean if a field has been set. +func (o *GetScheduleResponse) HasSchedule() bool { + if o != nil && !IsNil(o.Schedule) { + return true + } + + return false +} + +// SetSchedule gets a reference to the given Schedule and assigns it to the Schedule field. +func (o *GetScheduleResponse) SetSchedule(v Schedule) { + o.Schedule = &v +} + +func (o GetScheduleResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetScheduleResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Schedule) { + toSerialize["schedule"] = o.Schedule + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetScheduleResponse) UnmarshalJSON(data []byte) (err error) { + varGetScheduleResponse := _GetScheduleResponse{} + + err = json.Unmarshal(data, &varGetScheduleResponse) + + if err != nil { + return err + } + + *o = GetScheduleResponse(varGetScheduleResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "schedule") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetScheduleResponse struct { + value *GetScheduleResponse + isSet bool +} + +func (v NullableGetScheduleResponse) Get() *GetScheduleResponse { + return v.value +} + +func (v *NullableGetScheduleResponse) Set(val *GetScheduleResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetScheduleResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetScheduleResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetScheduleResponse(val *GetScheduleResponse) *NullableGetScheduleResponse { + return &NullableGetScheduleResponse{value: val, isSet: true} +} + +func (v NullableGetScheduleResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetScheduleResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_get_snapshot_policy_response.go b/services/sfs/v1api/model_get_snapshot_policy_response.go new file mode 100644 index 000000000..94a6a1a02 --- /dev/null +++ b/services/sfs/v1api/model_get_snapshot_policy_response.go @@ -0,0 +1,154 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the GetSnapshotPolicyResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GetSnapshotPolicyResponse{} + +// GetSnapshotPolicyResponse struct for GetSnapshotPolicyResponse +type GetSnapshotPolicyResponse struct { + // Snapshot Policy + SnapshotPolicy *SnapshotPolicy `json:"snapshotPolicy,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _GetSnapshotPolicyResponse GetSnapshotPolicyResponse + +// NewGetSnapshotPolicyResponse instantiates a new GetSnapshotPolicyResponse 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 NewGetSnapshotPolicyResponse() *GetSnapshotPolicyResponse { + this := GetSnapshotPolicyResponse{} + return &this +} + +// NewGetSnapshotPolicyResponseWithDefaults instantiates a new GetSnapshotPolicyResponse 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 NewGetSnapshotPolicyResponseWithDefaults() *GetSnapshotPolicyResponse { + this := GetSnapshotPolicyResponse{} + return &this +} + +// GetSnapshotPolicy returns the SnapshotPolicy field value if set, zero value otherwise. +func (o *GetSnapshotPolicyResponse) GetSnapshotPolicy() SnapshotPolicy { + if o == nil || IsNil(o.SnapshotPolicy) { + var ret SnapshotPolicy + return ret + } + return *o.SnapshotPolicy +} + +// GetSnapshotPolicyOk returns a tuple with the SnapshotPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GetSnapshotPolicyResponse) GetSnapshotPolicyOk() (*SnapshotPolicy, bool) { + if o == nil || IsNil(o.SnapshotPolicy) { + return nil, false + } + return o.SnapshotPolicy, true +} + +// HasSnapshotPolicy returns a boolean if a field has been set. +func (o *GetSnapshotPolicyResponse) HasSnapshotPolicy() bool { + if o != nil && !IsNil(o.SnapshotPolicy) { + return true + } + + return false +} + +// SetSnapshotPolicy gets a reference to the given SnapshotPolicy and assigns it to the SnapshotPolicy field. +func (o *GetSnapshotPolicyResponse) SetSnapshotPolicy(v SnapshotPolicy) { + o.SnapshotPolicy = &v +} + +func (o GetSnapshotPolicyResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GetSnapshotPolicyResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SnapshotPolicy) { + toSerialize["snapshotPolicy"] = o.SnapshotPolicy + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *GetSnapshotPolicyResponse) UnmarshalJSON(data []byte) (err error) { + varGetSnapshotPolicyResponse := _GetSnapshotPolicyResponse{} + + err = json.Unmarshal(data, &varGetSnapshotPolicyResponse) + + if err != nil { + return err + } + + *o = GetSnapshotPolicyResponse(varGetSnapshotPolicyResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "snapshotPolicy") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableGetSnapshotPolicyResponse struct { + value *GetSnapshotPolicyResponse + isSet bool +} + +func (v NullableGetSnapshotPolicyResponse) Get() *GetSnapshotPolicyResponse { + return v.value +} + +func (v *NullableGetSnapshotPolicyResponse) Set(val *GetSnapshotPolicyResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGetSnapshotPolicyResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGetSnapshotPolicyResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGetSnapshotPolicyResponse(val *GetSnapshotPolicyResponse) *NullableGetSnapshotPolicyResponse { + return &NullableGetSnapshotPolicyResponse{value: val, isSet: true} +} + +func (v NullableGetSnapshotPolicyResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGetSnapshotPolicyResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_list_schedules_response.go b/services/sfs/v1api/model_list_schedules_response.go new file mode 100644 index 000000000..e47e9135b --- /dev/null +++ b/services/sfs/v1api/model_list_schedules_response.go @@ -0,0 +1,154 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListSchedulesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListSchedulesResponse{} + +// ListSchedulesResponse struct for ListSchedulesResponse +type ListSchedulesResponse struct { + // List of Schedules + Schedules []Schedule `json:"schedules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ListSchedulesResponse ListSchedulesResponse + +// NewListSchedulesResponse instantiates a new ListSchedulesResponse 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 NewListSchedulesResponse() *ListSchedulesResponse { + this := ListSchedulesResponse{} + return &this +} + +// NewListSchedulesResponseWithDefaults instantiates a new ListSchedulesResponse 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 NewListSchedulesResponseWithDefaults() *ListSchedulesResponse { + this := ListSchedulesResponse{} + return &this +} + +// GetSchedules returns the Schedules field value if set, zero value otherwise. +func (o *ListSchedulesResponse) GetSchedules() []Schedule { + if o == nil || IsNil(o.Schedules) { + var ret []Schedule + return ret + } + return o.Schedules +} + +// GetSchedulesOk returns a tuple with the Schedules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListSchedulesResponse) GetSchedulesOk() ([]Schedule, bool) { + if o == nil || IsNil(o.Schedules) { + return nil, false + } + return o.Schedules, true +} + +// HasSchedules returns a boolean if a field has been set. +func (o *ListSchedulesResponse) HasSchedules() bool { + if o != nil && !IsNil(o.Schedules) { + return true + } + + return false +} + +// SetSchedules gets a reference to the given []Schedule and assigns it to the Schedules field. +func (o *ListSchedulesResponse) SetSchedules(v []Schedule) { + o.Schedules = v +} + +func (o ListSchedulesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListSchedulesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Schedules) { + toSerialize["schedules"] = o.Schedules + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListSchedulesResponse) UnmarshalJSON(data []byte) (err error) { + varListSchedulesResponse := _ListSchedulesResponse{} + + err = json.Unmarshal(data, &varListSchedulesResponse) + + if err != nil { + return err + } + + *o = ListSchedulesResponse(varListSchedulesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "schedules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListSchedulesResponse struct { + value *ListSchedulesResponse + isSet bool +} + +func (v NullableListSchedulesResponse) Get() *ListSchedulesResponse { + return v.value +} + +func (v *NullableListSchedulesResponse) Set(val *ListSchedulesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListSchedulesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListSchedulesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListSchedulesResponse(val *ListSchedulesResponse) *NullableListSchedulesResponse { + return &NullableListSchedulesResponse{value: val, isSet: true} +} + +func (v NullableListSchedulesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListSchedulesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_list_snapshot_policies_response.go b/services/sfs/v1api/model_list_snapshot_policies_response.go new file mode 100644 index 000000000..18ed220b0 --- /dev/null +++ b/services/sfs/v1api/model_list_snapshot_policies_response.go @@ -0,0 +1,154 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ListSnapshotPoliciesResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListSnapshotPoliciesResponse{} + +// ListSnapshotPoliciesResponse struct for ListSnapshotPoliciesResponse +type ListSnapshotPoliciesResponse struct { + // List of Snapshot Policies + SnapshotPolicies []SnapshotPolicy `json:"snapshotPolicies,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ListSnapshotPoliciesResponse ListSnapshotPoliciesResponse + +// NewListSnapshotPoliciesResponse instantiates a new ListSnapshotPoliciesResponse 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 NewListSnapshotPoliciesResponse() *ListSnapshotPoliciesResponse { + this := ListSnapshotPoliciesResponse{} + return &this +} + +// NewListSnapshotPoliciesResponseWithDefaults instantiates a new ListSnapshotPoliciesResponse 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 NewListSnapshotPoliciesResponseWithDefaults() *ListSnapshotPoliciesResponse { + this := ListSnapshotPoliciesResponse{} + return &this +} + +// GetSnapshotPolicies returns the SnapshotPolicies field value if set, zero value otherwise. +func (o *ListSnapshotPoliciesResponse) GetSnapshotPolicies() []SnapshotPolicy { + if o == nil || IsNil(o.SnapshotPolicies) { + var ret []SnapshotPolicy + return ret + } + return o.SnapshotPolicies +} + +// GetSnapshotPoliciesOk returns a tuple with the SnapshotPolicies field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ListSnapshotPoliciesResponse) GetSnapshotPoliciesOk() ([]SnapshotPolicy, bool) { + if o == nil || IsNil(o.SnapshotPolicies) { + return nil, false + } + return o.SnapshotPolicies, true +} + +// HasSnapshotPolicies returns a boolean if a field has been set. +func (o *ListSnapshotPoliciesResponse) HasSnapshotPolicies() bool { + if o != nil && !IsNil(o.SnapshotPolicies) { + return true + } + + return false +} + +// SetSnapshotPolicies gets a reference to the given []SnapshotPolicy and assigns it to the SnapshotPolicies field. +func (o *ListSnapshotPoliciesResponse) SetSnapshotPolicies(v []SnapshotPolicy) { + o.SnapshotPolicies = v +} + +func (o ListSnapshotPoliciesResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListSnapshotPoliciesResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.SnapshotPolicies) { + toSerialize["snapshotPolicies"] = o.SnapshotPolicies + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ListSnapshotPoliciesResponse) UnmarshalJSON(data []byte) (err error) { + varListSnapshotPoliciesResponse := _ListSnapshotPoliciesResponse{} + + err = json.Unmarshal(data, &varListSnapshotPoliciesResponse) + + if err != nil { + return err + } + + *o = ListSnapshotPoliciesResponse(varListSnapshotPoliciesResponse) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "snapshotPolicies") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableListSnapshotPoliciesResponse struct { + value *ListSnapshotPoliciesResponse + isSet bool +} + +func (v NullableListSnapshotPoliciesResponse) Get() *ListSnapshotPoliciesResponse { + return v.value +} + +func (v *NullableListSnapshotPoliciesResponse) Set(val *ListSnapshotPoliciesResponse) { + v.value = val + v.isSet = true +} + +func (v NullableListSnapshotPoliciesResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableListSnapshotPoliciesResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListSnapshotPoliciesResponse(val *ListSnapshotPoliciesResponse) *NullableListSnapshotPoliciesResponse { + return &NullableListSnapshotPoliciesResponse{value: val, isSet: true} +} + +func (v NullableListSnapshotPoliciesResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListSnapshotPoliciesResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_resource_pool.go b/services/sfs/v1api/model_resource_pool.go index 23fa2e523..481cc2383 100644 --- a/services/sfs/v1api/model_resource_pool.go +++ b/services/sfs/v1api/model_resource_pool.go @@ -40,6 +40,8 @@ type ResourcePool struct { PerformanceClassDowngradableAt *time.Time `json:"performanceClassDowngradableAt,omitempty"` // Time when the size can be reduced again. SizeReducibleAt *time.Time `json:"sizeReducibleAt,omitempty"` + // (optional) Snapshot Policy + SnapshotPolicy NullableResourcePoolSnapshotPolicy `json:"snapshotPolicy,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible *bool `json:"snapshotsAreVisible,omitempty"` // Space information @@ -424,6 +426,49 @@ func (o *ResourcePool) SetSizeReducibleAt(v time.Time) { o.SizeReducibleAt = &v } +// GetSnapshotPolicy returns the SnapshotPolicy field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ResourcePool) GetSnapshotPolicy() ResourcePoolSnapshotPolicy { + if o == nil || IsNil(o.SnapshotPolicy.Get()) { + var ret ResourcePoolSnapshotPolicy + return ret + } + return *o.SnapshotPolicy.Get() +} + +// GetSnapshotPolicyOk returns a tuple with the SnapshotPolicy field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ResourcePool) GetSnapshotPolicyOk() (*ResourcePoolSnapshotPolicy, bool) { + if o == nil { + return nil, false + } + return o.SnapshotPolicy.Get(), o.SnapshotPolicy.IsSet() +} + +// HasSnapshotPolicy returns a boolean if a field has been set. +func (o *ResourcePool) HasSnapshotPolicy() bool { + if o != nil && o.SnapshotPolicy.IsSet() { + return true + } + + return false +} + +// SetSnapshotPolicy gets a reference to the given NullableResourcePoolSnapshotPolicy and assigns it to the SnapshotPolicy field. +func (o *ResourcePool) SetSnapshotPolicy(v ResourcePoolSnapshotPolicy) { + o.SnapshotPolicy.Set(&v) +} + +// SetSnapshotPolicyNil sets the value for SnapshotPolicy to be an explicit nil +func (o *ResourcePool) SetSnapshotPolicyNil() { + o.SnapshotPolicy.Set(nil) +} + +// UnsetSnapshotPolicy ensures that no value is present for SnapshotPolicy, not even an explicit nil +func (o *ResourcePool) UnsetSnapshotPolicy() { + o.SnapshotPolicy.Unset() +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. func (o *ResourcePool) GetSnapshotsAreVisible() bool { if o == nil || IsNil(o.SnapshotsAreVisible) { @@ -563,6 +608,9 @@ func (o ResourcePool) ToMap() (map[string]interface{}, error) { if !IsNil(o.SizeReducibleAt) { toSerialize["sizeReducibleAt"] = o.SizeReducibleAt } + if o.SnapshotPolicy.IsSet() { + toSerialize["snapshotPolicy"] = o.SnapshotPolicy.Get() + } if !IsNil(o.SnapshotsAreVisible) { toSerialize["snapshotsAreVisible"] = o.SnapshotsAreVisible } @@ -605,6 +653,7 @@ func (o *ResourcePool) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "performanceClass") delete(additionalProperties, "performanceClassDowngradableAt") delete(additionalProperties, "sizeReducibleAt") + delete(additionalProperties, "snapshotPolicy") delete(additionalProperties, "snapshotsAreVisible") delete(additionalProperties, "space") delete(additionalProperties, "state") diff --git a/services/sfs/v1api/model_resource_pool_snapshot.go b/services/sfs/v1api/model_resource_pool_snapshot.go index 1b8eebe26..b29d8f379 100644 --- a/services/sfs/v1api/model_resource_pool_snapshot.go +++ b/services/sfs/v1api/model_resource_pool_snapshot.go @@ -29,6 +29,8 @@ type ResourcePoolSnapshot struct { ResourcePoolId *string `json:"resourcePoolId,omitempty"` // Reflects the actual storage footprint in the backend at snapshot time in Gibibytes (e.g. how much storage from the Resource Pool does it use). SizeGigabytes *int32 `json:"sizeGigabytes,omitempty"` + // Represents the snaplock expiry time if snaplock is enabled for the resource pool + SnaplockExpiryTime NullableTime `json:"snaplockExpiryTime,omitempty"` // Name of the Resource Pool Snapshot SnapshotName *string `json:"snapshotName,omitempty"` AdditionalProperties map[string]interface{} @@ -224,6 +226,49 @@ func (o *ResourcePoolSnapshot) SetSizeGigabytes(v int32) { o.SizeGigabytes = &v } +// GetSnaplockExpiryTime returns the SnaplockExpiryTime field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ResourcePoolSnapshot) GetSnaplockExpiryTime() time.Time { + if o == nil || IsNil(o.SnaplockExpiryTime.Get()) { + var ret time.Time + return ret + } + return *o.SnaplockExpiryTime.Get() +} + +// GetSnaplockExpiryTimeOk returns a tuple with the SnaplockExpiryTime field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ResourcePoolSnapshot) GetSnaplockExpiryTimeOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return o.SnaplockExpiryTime.Get(), o.SnaplockExpiryTime.IsSet() +} + +// HasSnaplockExpiryTime returns a boolean if a field has been set. +func (o *ResourcePoolSnapshot) HasSnaplockExpiryTime() bool { + if o != nil && o.SnaplockExpiryTime.IsSet() { + return true + } + + return false +} + +// SetSnaplockExpiryTime gets a reference to the given NullableTime and assigns it to the SnaplockExpiryTime field. +func (o *ResourcePoolSnapshot) SetSnaplockExpiryTime(v time.Time) { + o.SnaplockExpiryTime.Set(&v) +} + +// SetSnaplockExpiryTimeNil sets the value for SnaplockExpiryTime to be an explicit nil +func (o *ResourcePoolSnapshot) SetSnaplockExpiryTimeNil() { + o.SnaplockExpiryTime.Set(nil) +} + +// UnsetSnaplockExpiryTime ensures that no value is present for SnaplockExpiryTime, not even an explicit nil +func (o *ResourcePoolSnapshot) UnsetSnaplockExpiryTime() { + o.SnaplockExpiryTime.Unset() +} + // GetSnapshotName returns the SnapshotName field value if set, zero value otherwise. func (o *ResourcePoolSnapshot) GetSnapshotName() string { if o == nil || IsNil(o.SnapshotName) { @@ -281,6 +326,9 @@ func (o ResourcePoolSnapshot) ToMap() (map[string]interface{}, error) { if !IsNil(o.SizeGigabytes) { toSerialize["sizeGigabytes"] = o.SizeGigabytes } + if o.SnaplockExpiryTime.IsSet() { + toSerialize["snaplockExpiryTime"] = o.SnaplockExpiryTime.Get() + } if !IsNil(o.SnapshotName) { toSerialize["snapshotName"] = o.SnapshotName } @@ -311,6 +359,7 @@ func (o *ResourcePoolSnapshot) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "logicalSizeGigabytes") delete(additionalProperties, "resourcePoolId") delete(additionalProperties, "sizeGigabytes") + delete(additionalProperties, "snaplockExpiryTime") delete(additionalProperties, "snapshotName") o.AdditionalProperties = additionalProperties } diff --git a/services/sfs/v1api/model_resource_pool_snapshot_policy.go b/services/sfs/v1api/model_resource_pool_snapshot_policy.go new file mode 100644 index 000000000..6230ed7f5 --- /dev/null +++ b/services/sfs/v1api/model_resource_pool_snapshot_policy.go @@ -0,0 +1,192 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the ResourcePoolSnapshotPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ResourcePoolSnapshotPolicy{} + +// ResourcePoolSnapshotPolicy struct for ResourcePoolSnapshotPolicy +type ResourcePoolSnapshotPolicy struct { + // ID of the Snapshot Policy + Id *string `json:"id,omitempty"` + // Name of the Snapshot Policy + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _ResourcePoolSnapshotPolicy ResourcePoolSnapshotPolicy + +// NewResourcePoolSnapshotPolicy instantiates a new ResourcePoolSnapshotPolicy 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 NewResourcePoolSnapshotPolicy() *ResourcePoolSnapshotPolicy { + this := ResourcePoolSnapshotPolicy{} + return &this +} + +// NewResourcePoolSnapshotPolicyWithDefaults instantiates a new ResourcePoolSnapshotPolicy 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 NewResourcePoolSnapshotPolicyWithDefaults() *ResourcePoolSnapshotPolicy { + this := ResourcePoolSnapshotPolicy{} + return &this +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *ResourcePoolSnapshotPolicy) 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 *ResourcePoolSnapshotPolicy) 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 *ResourcePoolSnapshotPolicy) 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 *ResourcePoolSnapshotPolicy) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *ResourcePoolSnapshotPolicy) 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 *ResourcePoolSnapshotPolicy) 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 *ResourcePoolSnapshotPolicy) 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 *ResourcePoolSnapshotPolicy) SetName(v string) { + o.Name = &v +} + +func (o ResourcePoolSnapshotPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ResourcePoolSnapshotPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *ResourcePoolSnapshotPolicy) UnmarshalJSON(data []byte) (err error) { + varResourcePoolSnapshotPolicy := _ResourcePoolSnapshotPolicy{} + + err = json.Unmarshal(data, &varResourcePoolSnapshotPolicy) + + if err != nil { + return err + } + + *o = ResourcePoolSnapshotPolicy(varResourcePoolSnapshotPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "id") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableResourcePoolSnapshotPolicy struct { + value *ResourcePoolSnapshotPolicy + isSet bool +} + +func (v NullableResourcePoolSnapshotPolicy) Get() *ResourcePoolSnapshotPolicy { + return v.value +} + +func (v *NullableResourcePoolSnapshotPolicy) Set(val *ResourcePoolSnapshotPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableResourcePoolSnapshotPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableResourcePoolSnapshotPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableResourcePoolSnapshotPolicy(val *ResourcePoolSnapshotPolicy) *NullableResourcePoolSnapshotPolicy { + return &NullableResourcePoolSnapshotPolicy{value: val, isSet: true} +} + +func (v NullableResourcePoolSnapshotPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableResourcePoolSnapshotPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_resource_pool_space.go b/services/sfs/v1api/model_resource_pool_space.go index 47bc9d6bc..38e0cf28e 100644 --- a/services/sfs/v1api/model_resource_pool_space.go +++ b/services/sfs/v1api/model_resource_pool_space.go @@ -23,6 +23,8 @@ type ResourcePoolSpace struct { AvailableGigabytes NullableFloat64 `json:"availableGigabytes,omitempty"` // Size of the Resource Pool in Gibibytes. SizeGigabytes *int32 `json:"sizeGigabytes,omitempty"` + // Used space by snapshots (only available when retrieving a single Resource Pool by ID) + UsedBySnapshotsGigabytes NullableFloat64 `json:"usedBySnapshotsGigabytes,omitempty"` // Used space of the Resource Pool (only available when retrieving a single Resource Pool by ID) UsedGigabytes NullableFloat64 `json:"usedGigabytes,omitempty"` AdditionalProperties map[string]interface{} @@ -122,6 +124,49 @@ func (o *ResourcePoolSpace) SetSizeGigabytes(v int32) { o.SizeGigabytes = &v } +// GetUsedBySnapshotsGigabytes returns the UsedBySnapshotsGigabytes field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *ResourcePoolSpace) GetUsedBySnapshotsGigabytes() float64 { + if o == nil || IsNil(o.UsedBySnapshotsGigabytes.Get()) { + var ret float64 + return ret + } + return *o.UsedBySnapshotsGigabytes.Get() +} + +// GetUsedBySnapshotsGigabytesOk returns a tuple with the UsedBySnapshotsGigabytes field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *ResourcePoolSpace) GetUsedBySnapshotsGigabytesOk() (*float64, bool) { + if o == nil { + return nil, false + } + return o.UsedBySnapshotsGigabytes.Get(), o.UsedBySnapshotsGigabytes.IsSet() +} + +// HasUsedBySnapshotsGigabytes returns a boolean if a field has been set. +func (o *ResourcePoolSpace) HasUsedBySnapshotsGigabytes() bool { + if o != nil && o.UsedBySnapshotsGigabytes.IsSet() { + return true + } + + return false +} + +// SetUsedBySnapshotsGigabytes gets a reference to the given NullableFloat64 and assigns it to the UsedBySnapshotsGigabytes field. +func (o *ResourcePoolSpace) SetUsedBySnapshotsGigabytes(v float64) { + o.UsedBySnapshotsGigabytes.Set(&v) +} + +// SetUsedBySnapshotsGigabytesNil sets the value for UsedBySnapshotsGigabytes to be an explicit nil +func (o *ResourcePoolSpace) SetUsedBySnapshotsGigabytesNil() { + o.UsedBySnapshotsGigabytes.Set(nil) +} + +// UnsetUsedBySnapshotsGigabytes ensures that no value is present for UsedBySnapshotsGigabytes, not even an explicit nil +func (o *ResourcePoolSpace) UnsetUsedBySnapshotsGigabytes() { + o.UsedBySnapshotsGigabytes.Unset() +} + // GetUsedGigabytes returns the UsedGigabytes field value if set, zero value otherwise (both if not set or set to explicit null). func (o *ResourcePoolSpace) GetUsedGigabytes() float64 { if o == nil || IsNil(o.UsedGigabytes.Get()) { @@ -181,6 +226,9 @@ func (o ResourcePoolSpace) ToMap() (map[string]interface{}, error) { if !IsNil(o.SizeGigabytes) { toSerialize["sizeGigabytes"] = o.SizeGigabytes } + if o.UsedBySnapshotsGigabytes.IsSet() { + toSerialize["usedBySnapshotsGigabytes"] = o.UsedBySnapshotsGigabytes.Get() + } if o.UsedGigabytes.IsSet() { toSerialize["usedGigabytes"] = o.UsedGigabytes.Get() } @@ -208,6 +256,7 @@ func (o *ResourcePoolSpace) UnmarshalJSON(data []byte) (err error) { if err = json.Unmarshal(data, &additionalProperties); err == nil { delete(additionalProperties, "availableGigabytes") delete(additionalProperties, "sizeGigabytes") + delete(additionalProperties, "usedBySnapshotsGigabytes") delete(additionalProperties, "usedGigabytes") o.AdditionalProperties = additionalProperties } diff --git a/services/sfs/v1api/model_schedule.go b/services/sfs/v1api/model_schedule.go new file mode 100644 index 000000000..d54f629c3 --- /dev/null +++ b/services/sfs/v1api/model_schedule.go @@ -0,0 +1,269 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "time" +) + +// checks if the Schedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Schedule{} + +// Schedule struct for Schedule +type Schedule struct { + // created at timestamp + CreatedAt *time.Time `json:"createdAt,omitempty"` + // ID of the Schedule + Id *string `json:"id,omitempty"` + // Interval of the Schedule (follows the cron schedule expression in Unix-like systems) + Interval *string `json:"interval,omitempty"` + // Name of the Schedule + Name *string `json:"name,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _Schedule Schedule + +// NewSchedule instantiates a new Schedule 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 NewSchedule() *Schedule { + this := Schedule{} + return &this +} + +// NewScheduleWithDefaults instantiates a new Schedule 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 NewScheduleWithDefaults() *Schedule { + this := Schedule{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *Schedule) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Schedule) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *Schedule) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *Schedule) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *Schedule) 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 *Schedule) 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 *Schedule) 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 *Schedule) SetId(v string) { + o.Id = &v +} + +// GetInterval returns the Interval field value if set, zero value otherwise. +func (o *Schedule) GetInterval() string { + if o == nil || IsNil(o.Interval) { + var ret string + return ret + } + return *o.Interval +} + +// GetIntervalOk returns a tuple with the Interval field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Schedule) GetIntervalOk() (*string, bool) { + if o == nil || IsNil(o.Interval) { + return nil, false + } + return o.Interval, true +} + +// HasInterval returns a boolean if a field has been set. +func (o *Schedule) HasInterval() bool { + if o != nil && !IsNil(o.Interval) { + return true + } + + return false +} + +// SetInterval gets a reference to the given string and assigns it to the Interval field. +func (o *Schedule) SetInterval(v string) { + o.Interval = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *Schedule) 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 *Schedule) 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 *Schedule) 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 *Schedule) SetName(v string) { + o.Name = &v +} + +func (o Schedule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Schedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + if !IsNil(o.Id) { + toSerialize["id"] = o.Id + } + if !IsNil(o.Interval) { + toSerialize["interval"] = o.Interval + } + if !IsNil(o.Name) { + toSerialize["name"] = o.Name + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *Schedule) UnmarshalJSON(data []byte) (err error) { + varSchedule := _Schedule{} + + err = json.Unmarshal(data, &varSchedule) + + if err != nil { + return err + } + + *o = Schedule(varSchedule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "createdAt") + delete(additionalProperties, "id") + delete(additionalProperties, "interval") + delete(additionalProperties, "name") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSchedule struct { + value *Schedule + isSet bool +} + +func (v NullableSchedule) Get() *Schedule { + return v.value +} + +func (v *NullableSchedule) Set(val *Schedule) { + v.value = val + v.isSet = true +} + +func (v NullableSchedule) IsSet() bool { + return v.isSet +} + +func (v *NullableSchedule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSchedule(val *Schedule) *NullableSchedule { + return &NullableSchedule{value: val, isSet: true} +} + +func (v NullableSchedule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_snapshot_policy.go b/services/sfs/v1api/model_snapshot_policy.go new file mode 100644 index 000000000..b14f32719 --- /dev/null +++ b/services/sfs/v1api/model_snapshot_policy.go @@ -0,0 +1,345 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" + "time" +) + +// checks if the SnapshotPolicy type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotPolicy{} + +// SnapshotPolicy struct for SnapshotPolicy +type SnapshotPolicy struct { + // Comment of the Snapshot Policy + Comment *string `json:"comment,omitempty"` + // created at timestamp + CreatedAt *time.Time `json:"createdAt,omitempty"` + // Wether the Snapshot Policy is enabled + Enabled *bool `json:"enabled,omitempty"` + // ID of the Snapshot Policy + Id *string `json:"id,omitempty"` + // Name of the Snapshot Policy + Name *string `json:"name,omitempty"` + // associated schedules + Schedules []SnapshotPolicySchedule `json:"schedules,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SnapshotPolicy SnapshotPolicy + +// NewSnapshotPolicy instantiates a new SnapshotPolicy 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 NewSnapshotPolicy() *SnapshotPolicy { + this := SnapshotPolicy{} + return &this +} + +// NewSnapshotPolicyWithDefaults instantiates a new SnapshotPolicy 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 NewSnapshotPolicyWithDefaults() *SnapshotPolicy { + this := SnapshotPolicy{} + return &this +} + +// GetComment returns the Comment field value if set, zero value otherwise. +func (o *SnapshotPolicy) GetComment() string { + if o == nil || IsNil(o.Comment) { + var ret string + return ret + } + return *o.Comment +} + +// GetCommentOk returns a tuple with the Comment field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SnapshotPolicy) GetCommentOk() (*string, bool) { + if o == nil || IsNil(o.Comment) { + return nil, false + } + return o.Comment, true +} + +// HasComment returns a boolean if a field has been set. +func (o *SnapshotPolicy) HasComment() bool { + if o != nil && !IsNil(o.Comment) { + return true + } + + return false +} + +// SetComment gets a reference to the given string and assigns it to the Comment field. +func (o *SnapshotPolicy) SetComment(v string) { + o.Comment = &v +} + +// GetCreatedAt returns the CreatedAt field value if set, zero value otherwise. +func (o *SnapshotPolicy) GetCreatedAt() time.Time { + if o == nil || IsNil(o.CreatedAt) { + var ret time.Time + return ret + } + return *o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SnapshotPolicy) GetCreatedAtOk() (*time.Time, bool) { + if o == nil || IsNil(o.CreatedAt) { + return nil, false + } + return o.CreatedAt, true +} + +// HasCreatedAt returns a boolean if a field has been set. +func (o *SnapshotPolicy) HasCreatedAt() bool { + if o != nil && !IsNil(o.CreatedAt) { + return true + } + + return false +} + +// SetCreatedAt gets a reference to the given time.Time and assigns it to the CreatedAt field. +func (o *SnapshotPolicy) SetCreatedAt(v time.Time) { + o.CreatedAt = &v +} + +// GetEnabled returns the Enabled field value if set, zero value otherwise. +func (o *SnapshotPolicy) 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 *SnapshotPolicy) 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 *SnapshotPolicy) 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 *SnapshotPolicy) SetEnabled(v bool) { + o.Enabled = &v +} + +// GetId returns the Id field value if set, zero value otherwise. +func (o *SnapshotPolicy) 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 *SnapshotPolicy) 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 *SnapshotPolicy) 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 *SnapshotPolicy) SetId(v string) { + o.Id = &v +} + +// GetName returns the Name field value if set, zero value otherwise. +func (o *SnapshotPolicy) 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 *SnapshotPolicy) 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 *SnapshotPolicy) 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 *SnapshotPolicy) SetName(v string) { + o.Name = &v +} + +// GetSchedules returns the Schedules field value if set, zero value otherwise. +func (o *SnapshotPolicy) GetSchedules() []SnapshotPolicySchedule { + if o == nil || IsNil(o.Schedules) { + var ret []SnapshotPolicySchedule + return ret + } + return o.Schedules +} + +// GetSchedulesOk returns a tuple with the Schedules field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SnapshotPolicy) GetSchedulesOk() ([]SnapshotPolicySchedule, bool) { + if o == nil || IsNil(o.Schedules) { + return nil, false + } + return o.Schedules, true +} + +// HasSchedules returns a boolean if a field has been set. +func (o *SnapshotPolicy) HasSchedules() bool { + if o != nil && !IsNil(o.Schedules) { + return true + } + + return false +} + +// SetSchedules gets a reference to the given []SnapshotPolicySchedule and assigns it to the Schedules field. +func (o *SnapshotPolicy) SetSchedules(v []SnapshotPolicySchedule) { + o.Schedules = v +} + +func (o SnapshotPolicy) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SnapshotPolicy) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Comment) { + toSerialize["comment"] = o.Comment + } + if !IsNil(o.CreatedAt) { + toSerialize["createdAt"] = o.CreatedAt + } + 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.Schedules) { + toSerialize["schedules"] = o.Schedules + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SnapshotPolicy) UnmarshalJSON(data []byte) (err error) { + varSnapshotPolicy := _SnapshotPolicy{} + + err = json.Unmarshal(data, &varSnapshotPolicy) + + if err != nil { + return err + } + + *o = SnapshotPolicy(varSnapshotPolicy) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "comment") + delete(additionalProperties, "createdAt") + delete(additionalProperties, "enabled") + delete(additionalProperties, "id") + delete(additionalProperties, "name") + delete(additionalProperties, "schedules") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSnapshotPolicy struct { + value *SnapshotPolicy + isSet bool +} + +func (v NullableSnapshotPolicy) Get() *SnapshotPolicy { + return v.value +} + +func (v *NullableSnapshotPolicy) Set(val *SnapshotPolicy) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotPolicy) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotPolicy) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotPolicy(val *SnapshotPolicy) *NullableSnapshotPolicy { + return &NullableSnapshotPolicy{value: val, isSet: true} +} + +func (v NullableSnapshotPolicy) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotPolicy) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_snapshot_policy_schedule.go b/services/sfs/v1api/model_snapshot_policy_schedule.go new file mode 100644 index 000000000..c5595e0d7 --- /dev/null +++ b/services/sfs/v1api/model_snapshot_policy_schedule.go @@ -0,0 +1,264 @@ +/* +STACKIT File Storage (SFS) + +API used to create and manage NFS Shares. + +API version: 1.0.0 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1api + +import ( + "encoding/json" +) + +// checks if the SnapshotPolicySchedule type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &SnapshotPolicySchedule{} + +// SnapshotPolicySchedule struct for SnapshotPolicySchedule +type SnapshotPolicySchedule struct { + Count *int32 `json:"count,omitempty"` + Prefix *string `json:"prefix,omitempty"` + RetentionPeriod *string `json:"retentionPeriod,omitempty"` + ScheduleId *string `json:"scheduleId,omitempty"` + AdditionalProperties map[string]interface{} +} + +type _SnapshotPolicySchedule SnapshotPolicySchedule + +// NewSnapshotPolicySchedule instantiates a new SnapshotPolicySchedule 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 NewSnapshotPolicySchedule() *SnapshotPolicySchedule { + this := SnapshotPolicySchedule{} + return &this +} + +// NewSnapshotPolicyScheduleWithDefaults instantiates a new SnapshotPolicySchedule 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 NewSnapshotPolicyScheduleWithDefaults() *SnapshotPolicySchedule { + this := SnapshotPolicySchedule{} + return &this +} + +// GetCount returns the Count field value if set, zero value otherwise. +func (o *SnapshotPolicySchedule) GetCount() int32 { + if o == nil || IsNil(o.Count) { + var ret int32 + return ret + } + return *o.Count +} + +// GetCountOk returns a tuple with the Count field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SnapshotPolicySchedule) GetCountOk() (*int32, bool) { + if o == nil || IsNil(o.Count) { + return nil, false + } + return o.Count, true +} + +// HasCount returns a boolean if a field has been set. +func (o *SnapshotPolicySchedule) HasCount() bool { + if o != nil && !IsNil(o.Count) { + return true + } + + return false +} + +// SetCount gets a reference to the given int32 and assigns it to the Count field. +func (o *SnapshotPolicySchedule) SetCount(v int32) { + o.Count = &v +} + +// GetPrefix returns the Prefix field value if set, zero value otherwise. +func (o *SnapshotPolicySchedule) GetPrefix() string { + if o == nil || IsNil(o.Prefix) { + var ret string + return ret + } + return *o.Prefix +} + +// GetPrefixOk returns a tuple with the Prefix field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SnapshotPolicySchedule) GetPrefixOk() (*string, bool) { + if o == nil || IsNil(o.Prefix) { + return nil, false + } + return o.Prefix, true +} + +// HasPrefix returns a boolean if a field has been set. +func (o *SnapshotPolicySchedule) HasPrefix() bool { + if o != nil && !IsNil(o.Prefix) { + return true + } + + return false +} + +// SetPrefix gets a reference to the given string and assigns it to the Prefix field. +func (o *SnapshotPolicySchedule) SetPrefix(v string) { + o.Prefix = &v +} + +// GetRetentionPeriod returns the RetentionPeriod field value if set, zero value otherwise. +func (o *SnapshotPolicySchedule) GetRetentionPeriod() string { + if o == nil || IsNil(o.RetentionPeriod) { + var ret string + 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 *SnapshotPolicySchedule) GetRetentionPeriodOk() (*string, 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 *SnapshotPolicySchedule) HasRetentionPeriod() bool { + if o != nil && !IsNil(o.RetentionPeriod) { + return true + } + + return false +} + +// SetRetentionPeriod gets a reference to the given string and assigns it to the RetentionPeriod field. +func (o *SnapshotPolicySchedule) SetRetentionPeriod(v string) { + o.RetentionPeriod = &v +} + +// GetScheduleId returns the ScheduleId field value if set, zero value otherwise. +func (o *SnapshotPolicySchedule) GetScheduleId() string { + if o == nil || IsNil(o.ScheduleId) { + var ret string + return ret + } + return *o.ScheduleId +} + +// GetScheduleIdOk returns a tuple with the ScheduleId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *SnapshotPolicySchedule) GetScheduleIdOk() (*string, bool) { + if o == nil || IsNil(o.ScheduleId) { + return nil, false + } + return o.ScheduleId, true +} + +// HasScheduleId returns a boolean if a field has been set. +func (o *SnapshotPolicySchedule) HasScheduleId() bool { + if o != nil && !IsNil(o.ScheduleId) { + return true + } + + return false +} + +// SetScheduleId gets a reference to the given string and assigns it to the ScheduleId field. +func (o *SnapshotPolicySchedule) SetScheduleId(v string) { + o.ScheduleId = &v +} + +func (o SnapshotPolicySchedule) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o SnapshotPolicySchedule) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Count) { + toSerialize["count"] = o.Count + } + if !IsNil(o.Prefix) { + toSerialize["prefix"] = o.Prefix + } + if !IsNil(o.RetentionPeriod) { + toSerialize["retentionPeriod"] = o.RetentionPeriod + } + if !IsNil(o.ScheduleId) { + toSerialize["scheduleId"] = o.ScheduleId + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + + return toSerialize, nil +} + +func (o *SnapshotPolicySchedule) UnmarshalJSON(data []byte) (err error) { + varSnapshotPolicySchedule := _SnapshotPolicySchedule{} + + err = json.Unmarshal(data, &varSnapshotPolicySchedule) + + if err != nil { + return err + } + + *o = SnapshotPolicySchedule(varSnapshotPolicySchedule) + + additionalProperties := make(map[string]interface{}) + + if err = json.Unmarshal(data, &additionalProperties); err == nil { + delete(additionalProperties, "count") + delete(additionalProperties, "prefix") + delete(additionalProperties, "retentionPeriod") + delete(additionalProperties, "scheduleId") + o.AdditionalProperties = additionalProperties + } + + return err +} + +type NullableSnapshotPolicySchedule struct { + value *SnapshotPolicySchedule + isSet bool +} + +func (v NullableSnapshotPolicySchedule) Get() *SnapshotPolicySchedule { + return v.value +} + +func (v *NullableSnapshotPolicySchedule) Set(val *SnapshotPolicySchedule) { + v.value = val + v.isSet = true +} + +func (v NullableSnapshotPolicySchedule) IsSet() bool { + return v.isSet +} + +func (v *NullableSnapshotPolicySchedule) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableSnapshotPolicySchedule(val *SnapshotPolicySchedule) *NullableSnapshotPolicySchedule { + return &NullableSnapshotPolicySchedule{value: val, isSet: true} +} + +func (v NullableSnapshotPolicySchedule) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableSnapshotPolicySchedule) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/sfs/v1api/model_update_resource_pool_payload.go b/services/sfs/v1api/model_update_resource_pool_payload.go index 52f31db67..b0a9d0288 100644 --- a/services/sfs/v1api/model_update_resource_pool_payload.go +++ b/services/sfs/v1api/model_update_resource_pool_payload.go @@ -27,6 +27,8 @@ type UpdateResourcePoolPayload struct { PerformanceClass *string `json:"performanceClass,omitempty"` // (optional) Size of the Resource Pool (unit: gigabytes) SizeGigabytes NullableInt32 `json:"sizeGigabytes,omitempty"` + // (optional) Id of the Snapshot Policy to use If not set, the Snapshot Policy is not updated If set to an empty string, the Snapshot Policy is removed + SnapshotPolicyId *string `json:"snapshotPolicyId,omitempty"` // Whether the .snapshot directory is visible when mounting the resource pool. Setting this value to false might prevent you from accessing the snapshots (e.g. for security reasons). Additionally, the access to the snapshots is always controlled by the export policy of the resource pool. That means, if snapshots are visible and the export policy allows for reading the resource pool, then it also allows reading the snapshot of all shares. SnapshotsAreVisible *bool `json:"snapshotsAreVisible,omitempty"` AdditionalProperties map[string]interface{} @@ -190,6 +192,38 @@ func (o *UpdateResourcePoolPayload) UnsetSizeGigabytes() { o.SizeGigabytes.Unset() } +// GetSnapshotPolicyId returns the SnapshotPolicyId field value if set, zero value otherwise. +func (o *UpdateResourcePoolPayload) GetSnapshotPolicyId() string { + if o == nil || IsNil(o.SnapshotPolicyId) { + var ret string + return ret + } + return *o.SnapshotPolicyId +} + +// GetSnapshotPolicyIdOk returns a tuple with the SnapshotPolicyId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UpdateResourcePoolPayload) GetSnapshotPolicyIdOk() (*string, bool) { + if o == nil || IsNil(o.SnapshotPolicyId) { + return nil, false + } + return o.SnapshotPolicyId, true +} + +// HasSnapshotPolicyId returns a boolean if a field has been set. +func (o *UpdateResourcePoolPayload) HasSnapshotPolicyId() bool { + if o != nil && !IsNil(o.SnapshotPolicyId) { + return true + } + + return false +} + +// SetSnapshotPolicyId gets a reference to the given string and assigns it to the SnapshotPolicyId field. +func (o *UpdateResourcePoolPayload) SetSnapshotPolicyId(v string) { + o.SnapshotPolicyId = &v +} + // GetSnapshotsAreVisible returns the SnapshotsAreVisible field value if set, zero value otherwise. func (o *UpdateResourcePoolPayload) GetSnapshotsAreVisible() bool { if o == nil || IsNil(o.SnapshotsAreVisible) { @@ -244,6 +278,9 @@ func (o UpdateResourcePoolPayload) ToMap() (map[string]interface{}, error) { if o.SizeGigabytes.IsSet() { toSerialize["sizeGigabytes"] = o.SizeGigabytes.Get() } + if !IsNil(o.SnapshotPolicyId) { + toSerialize["snapshotPolicyId"] = o.SnapshotPolicyId + } if !IsNil(o.SnapshotsAreVisible) { toSerialize["snapshotsAreVisible"] = o.SnapshotsAreVisible } @@ -273,6 +310,7 @@ func (o *UpdateResourcePoolPayload) UnmarshalJSON(data []byte) (err error) { delete(additionalProperties, "labels") delete(additionalProperties, "performanceClass") delete(additionalProperties, "sizeGigabytes") + delete(additionalProperties, "snapshotPolicyId") delete(additionalProperties, "snapshotsAreVisible") o.AdditionalProperties = additionalProperties }