diff --git a/services/edge/.openapi-generator/VERSION b/services/edge/.openapi-generator/VERSION deleted file mode 100644 index cd802a1ec4..0000000000 --- a/services/edge/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.6.0 \ No newline at end of file diff --git a/services/edge/api_default.go b/services/edge/api_default.go deleted file mode 100644 index 5fa9394c56..0000000000 --- a/services/edge/api_default.go +++ /dev/null @@ -1,2653 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "bytes" - "context" - "fmt" - "io" - "net/http" - "net/url" - "strings" - - "github.com/stackitcloud/stackit-sdk-go/core/config" - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" -) - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DefaultApi interface { - /* - CreateInstance Method for CreateInstance - Creates a new instance within the project. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @return ApiCreateInstanceRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest - /* - CreateInstanceExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @return Instance - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*Instance, error) - /* - DeleteInstance Method for DeleteInstance - Deletes the given instance. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return ApiDeleteInstanceRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest - /* - DeleteInstanceExecute executes the request - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error - /* - DeleteInstanceByName Method for DeleteInstanceByName - Deletes the given instance by name. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiDeleteInstanceByNameRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiDeleteInstanceByNameRequest - /* - DeleteInstanceByNameExecute executes the request - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteInstanceByNameExecute(ctx context.Context, projectId string, regionId string, displayName string) error - /* - GetInstance Method for GetInstance - Returns the details for the given instance. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return ApiGetInstanceRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest - /* - GetInstanceExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return Instance - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) - /* - GetInstanceByName Method for GetInstanceByName - Returns the details for the given instance by name. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiGetInstanceByNameRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetInstanceByNameRequest - /* - GetInstanceByNameExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return Instance - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetInstanceByNameExecute(ctx context.Context, projectId string, regionId string, displayName string) (*Instance, error) - /* - GetKubeconfigByInstanceId Method for GetKubeconfigByInstanceId - Returns the kubeconfig for the given instance. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return ApiGetKubeconfigByInstanceIdRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetKubeconfigByInstanceIdRequest - /* - GetKubeconfigByInstanceIdExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return Kubeconfig - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetKubeconfigByInstanceIdExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Kubeconfig, error) - /* - GetKubeconfigByInstanceName Method for GetKubeconfigByInstanceName - Returns the kubeconfig for the given instance. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiGetKubeconfigByInstanceNameRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetKubeconfigByInstanceNameRequest - /* - GetKubeconfigByInstanceNameExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return Kubeconfig - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetKubeconfigByInstanceNameExecute(ctx context.Context, projectId string, regionId string, displayName string) (*Kubeconfig, error) - /* - GetTokenByInstanceId Method for GetTokenByInstanceId - Returns an ServiceAccount token. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The instance UUID. - @return ApiGetTokenByInstanceIdRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetTokenByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetTokenByInstanceIdRequest - /* - GetTokenByInstanceIdExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The instance UUID. - @return Token - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetTokenByInstanceIdExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Token, error) - /* - GetTokenByInstanceName Method for GetTokenByInstanceName - Returns an ServiceAccount token. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiGetTokenByInstanceNameRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetTokenByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetTokenByInstanceNameRequest - /* - GetTokenByInstanceNameExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return Token - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetTokenByInstanceNameExecute(ctx context.Context, projectId string, regionId string, displayName string) (*Token, error) - /* - ListCompatibleKubernetesReleases Method for ListCompatibleKubernetesReleases - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return ApiListCompatibleKubernetesReleasesRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListCompatibleKubernetesReleases(ctx context.Context) ApiListCompatibleKubernetesReleasesRequest - /* - ListCompatibleKubernetesReleasesExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @return KubernetesReleaseList - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListCompatibleKubernetesReleasesExecute(ctx context.Context) (*KubernetesReleaseList, error) - /* - ListInstances Method for ListInstances - Returns a list of all instances within the project. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @return ApiListInstancesRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest - /* - ListInstancesExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @return InstanceList - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*InstanceList, error) - /* - ListPlansProject Method for ListPlansProject - List all possible plans for the project. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the plan is part of. - @return ApiListPlansProjectRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListPlansProject(ctx context.Context, projectId string) ApiListPlansProjectRequest - /* - ListPlansProjectExecute executes the request - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the plan is part of. - @return PlanList - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListPlansProjectExecute(ctx context.Context, projectId string) (*PlanList, error) - /* - UpdateInstance Method for UpdateInstance - Updates the given instance. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return ApiUpdateInstanceRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - UpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateInstanceRequest - /* - UpdateInstanceExecute executes the request - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - UpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error - /* - UpdateInstanceByName Method for UpdateInstanceByName - Updates the given instance. - - @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). - @param projectId The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiUpdateInstanceByNameRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - UpdateInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiUpdateInstanceByNameRequest - /* - UpdateInstanceByNameExecute executes the request - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - UpdateInstanceByNameExecute(ctx context.Context, projectId string, regionId string, displayName string) error -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiCreateInstanceRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*Instance, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiDeleteInstanceRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() error -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiDeleteInstanceByNameRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() error -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiGetInstanceRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*Instance, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiGetInstanceByNameRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*Instance, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiGetKubeconfigByInstanceIdRequest interface { - // Expiration of the included token in seconds - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - ExpirationSeconds(expirationSeconds int64) ApiGetKubeconfigByInstanceIdRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*Kubeconfig, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiGetKubeconfigByInstanceNameRequest interface { - // Expiration of the included token in seconds - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - ExpirationSeconds(expirationSeconds int64) ApiGetKubeconfigByInstanceNameRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*Kubeconfig, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiGetTokenByInstanceIdRequest interface { - // Expiration of the token in seconds - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - ExpirationSeconds(expirationSeconds int64) ApiGetTokenByInstanceIdRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*Token, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiGetTokenByInstanceNameRequest interface { - // Expiration of the included token in seconds - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - ExpirationSeconds(expirationSeconds int64) ApiGetTokenByInstanceNameRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*Token, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiListCompatibleKubernetesReleasesRequest interface { - // The name of the Talos release. - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - TalosVersion(talosVersion string) ApiListCompatibleKubernetesReleasesRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*KubernetesReleaseList, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiListInstancesRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*InstanceList, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiListPlansProjectRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*PlanList, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiUpdateInstanceRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() error -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiUpdateInstanceByNameRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - UpdateInstanceByNamePayload(updateInstanceByNamePayload UpdateInstanceByNamePayload) ApiUpdateInstanceByNameRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() error -} - -// DefaultApiService DefaultApi service -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DefaultApiService service - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - createInstancePayload *CreateInstancePayload -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r CreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { - r.createInstancePayload = &createInstancePayload - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r CreateInstanceRequest) Execute() (*Instance, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Instance - ) - 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.CreateInstance") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instances" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.createInstancePayload == nil { - return localVarReturnValue, fmt.Errorf("createInstancePayload is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createInstancePayload - 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 == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -CreateInstance: Method for CreateInstance - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @return ApiCreateInstanceRequest -*/ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string, regionId string) ApiCreateInstanceRequest { - return CreateInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string, regionId string) (*Instance, error) { - r := CreateInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DeleteInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r DeleteInstanceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - client, ok := a.client.(*APIClient) - if !ok { - return fmt.Errorf("could not parse client to type APIClient") - } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instances/{instanceId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.instanceId) > 16 { - return fmt.Errorf("instanceId must have less than 16 elements") - } - - // 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 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 err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - return newErr - } - - return nil -} - -/* -DeleteInstance: Method for DeleteInstance - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return ApiDeleteInstanceRequest -*/ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteInstanceRequest { - return DeleteInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { - r := DeleteInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DeleteInstanceByNameRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - displayName string -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r DeleteInstanceByNameRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - client, ok := a.client.(*APIClient) - if !ok { - return fmt.Errorf("could not parse client to type APIClient") - } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstanceByName") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instancesbyname/{displayName}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"displayName"+"}", url.PathEscape(ParameterValueToString(r.displayName, "displayName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.displayName) > 8 { - return fmt.Errorf("displayName must have less than 8 elements") - } - - // 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 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 err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - return newErr - } - - return nil -} - -/* -DeleteInstanceByName: Method for DeleteInstanceByName - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiDeleteInstanceByNameRequest -*/ -func (a *APIClient) DeleteInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiDeleteInstanceByNameRequest { - return DeleteInstanceByNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteInstanceByNameExecute(ctx context.Context, projectId string, regionId string, displayName string) error { - r := DeleteInstanceByNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetInstanceRequest) Execute() (*Instance, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Instance - ) - 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.GetInstance") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instances/{instanceId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.instanceId) > 16 { - return localVarReturnValue, fmt.Errorf("instanceId must have less than 16 elements") - } - - // 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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -GetInstance: Method for GetInstance - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return ApiGetInstanceRequest -*/ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetInstanceRequest { - return GetInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Instance, error) { - r := GetInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetInstanceByNameRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - displayName string -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetInstanceByNameRequest) Execute() (*Instance, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Instance - ) - 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.GetInstanceByName") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instancesbyname/{displayName}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"displayName"+"}", url.PathEscape(ParameterValueToString(r.displayName, "displayName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.displayName) > 8 { - return localVarReturnValue, fmt.Errorf("displayName must have less than 8 elements") - } - - // 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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -GetInstanceByName: Method for GetInstanceByName - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiGetInstanceByNameRequest -*/ -func (a *APIClient) GetInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetInstanceByNameRequest { - return GetInstanceByNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetInstanceByNameExecute(ctx context.Context, projectId string, regionId string, displayName string) (*Instance, error) { - r := GetInstanceByNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetKubeconfigByInstanceIdRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string - expirationSeconds *int64 -} - -// Expiration of the included token in seconds -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetKubeconfigByInstanceIdRequest) ExpirationSeconds(expirationSeconds int64) ApiGetKubeconfigByInstanceIdRequest { - r.expirationSeconds = &expirationSeconds - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetKubeconfigByInstanceIdRequest) Execute() (*Kubeconfig, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Kubeconfig - ) - 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.GetKubeconfigByInstanceId") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/kubeconfig" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.instanceId) > 16 { - return localVarReturnValue, fmt.Errorf("instanceId must have less than 16 elements") - } - - if r.expirationSeconds != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "expirationSeconds", r.expirationSeconds, "") - } - // 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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -GetKubeconfigByInstanceId: Method for GetKubeconfigByInstanceId - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return ApiGetKubeconfigByInstanceIdRequest -*/ -func (a *APIClient) GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetKubeconfigByInstanceIdRequest { - return GetKubeconfigByInstanceIdRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetKubeconfigByInstanceIdExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Kubeconfig, error) { - r := GetKubeconfigByInstanceIdRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetKubeconfigByInstanceNameRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - displayName string - expirationSeconds *int64 -} - -// Expiration of the included token in seconds -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetKubeconfigByInstanceNameRequest) ExpirationSeconds(expirationSeconds int64) ApiGetKubeconfigByInstanceNameRequest { - r.expirationSeconds = &expirationSeconds - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetKubeconfigByInstanceNameRequest) Execute() (*Kubeconfig, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Kubeconfig - ) - 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.GetKubeconfigByInstanceName") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instancesbyname/{displayName}/kubeconfig" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"displayName"+"}", url.PathEscape(ParameterValueToString(r.displayName, "displayName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.displayName) > 8 { - return localVarReturnValue, fmt.Errorf("displayName must have less than 8 elements") - } - - if r.expirationSeconds != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "expirationSeconds", r.expirationSeconds, "") - } - // 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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -GetKubeconfigByInstanceName: Method for GetKubeconfigByInstanceName - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiGetKubeconfigByInstanceNameRequest -*/ -func (a *APIClient) GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetKubeconfigByInstanceNameRequest { - return GetKubeconfigByInstanceNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetKubeconfigByInstanceNameExecute(ctx context.Context, projectId string, regionId string, displayName string) (*Kubeconfig, error) { - r := GetKubeconfigByInstanceNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetTokenByInstanceIdRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string - expirationSeconds *int64 -} - -// Expiration of the token in seconds -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetTokenByInstanceIdRequest) ExpirationSeconds(expirationSeconds int64) ApiGetTokenByInstanceIdRequest { - r.expirationSeconds = &expirationSeconds - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetTokenByInstanceIdRequest) Execute() (*Token, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Token - ) - 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.GetTokenByInstanceId") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/token" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.instanceId) > 16 { - return localVarReturnValue, fmt.Errorf("instanceId must have less than 16 elements") - } - - if r.expirationSeconds != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "expirationSeconds", r.expirationSeconds, "") - } - // 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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -GetTokenByInstanceId: Method for GetTokenByInstanceId - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The instance UUID. - @return ApiGetTokenByInstanceIdRequest -*/ -func (a *APIClient) GetTokenByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetTokenByInstanceIdRequest { - return GetTokenByInstanceIdRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetTokenByInstanceIdExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*Token, error) { - r := GetTokenByInstanceIdRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetTokenByInstanceNameRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - displayName string - expirationSeconds *int64 -} - -// Expiration of the included token in seconds -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetTokenByInstanceNameRequest) ExpirationSeconds(expirationSeconds int64) ApiGetTokenByInstanceNameRequest { - r.expirationSeconds = &expirationSeconds - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetTokenByInstanceNameRequest) Execute() (*Token, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *Token - ) - 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.GetTokenByInstanceName") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instancesbyname/{displayName}/token" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"displayName"+"}", url.PathEscape(ParameterValueToString(r.displayName, "displayName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.displayName) > 8 { - return localVarReturnValue, fmt.Errorf("displayName must have less than 8 elements") - } - - if r.expirationSeconds != nil { - parameterAddToHeaderOrQuery(localVarQueryParams, "expirationSeconds", r.expirationSeconds, "") - } - // 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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -GetTokenByInstanceName: Method for GetTokenByInstanceName - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiGetTokenByInstanceNameRequest -*/ -func (a *APIClient) GetTokenByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) ApiGetTokenByInstanceNameRequest { - return GetTokenByInstanceNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetTokenByInstanceNameExecute(ctx context.Context, projectId string, regionId string, displayName string) (*Token, error) { - r := GetTokenByInstanceNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListCompatibleKubernetesReleasesRequest struct { - ctx context.Context - apiService *DefaultApiService - talosVersion *string -} - -// The name of the Talos release. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListCompatibleKubernetesReleasesRequest) TalosVersion(talosVersion string) ApiListCompatibleKubernetesReleasesRequest { - r.talosVersion = &talosVersion - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListCompatibleKubernetesReleasesRequest) Execute() (*KubernetesReleaseList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *KubernetesReleaseList - ) - 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.ListCompatibleKubernetesReleases") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/listcompatiblekubernetesreleases" - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.talosVersion == nil { - return localVarReturnValue, fmt.Errorf("talosVersion is required and must be specified") - } - - parameterAddToHeaderOrQuery(localVarQueryParams, "talosVersion", r.talosVersion, "") - // 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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - 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 -} - -/* -ListCompatibleKubernetesReleases: Method for ListCompatibleKubernetesReleases -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(). - @return ApiListCompatibleKubernetesReleasesRequest -*/ -func (a *APIClient) ListCompatibleKubernetesReleases(ctx context.Context) ApiListCompatibleKubernetesReleasesRequest { - return ListCompatibleKubernetesReleasesRequest{ - apiService: a.defaultApi, - ctx: ctx, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListCompatibleKubernetesReleasesExecute(ctx context.Context) (*KubernetesReleaseList, error) { - r := ListCompatibleKubernetesReleasesRequest{ - apiService: a.defaultApi, - ctx: ctx, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListInstancesRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r ListInstancesRequest) Execute() (*InstanceList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *InstanceList - ) - 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.ListInstances") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instances" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -ListInstances: Method for ListInstances - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @return ApiListInstancesRequest -*/ -func (a *APIClient) ListInstances(ctx context.Context, projectId string, regionId string) ApiListInstancesRequest { - return ListInstancesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string, regionId string) (*InstanceList, error) { - r := ListInstancesRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ListPlansProjectRequest 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 ListPlansProjectRequest) Execute() (*PlanList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *PlanList - ) - 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.ListPlansProject") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/plans" - 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, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - 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 - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - 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 - } - 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 -} - -/* -ListPlansProject: Method for ListPlansProject - -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 The STACKIT portal project UUID the plan is part of. - @return ApiListPlansProjectRequest -*/ -func (a *APIClient) ListPlansProject(ctx context.Context, projectId string) ApiListPlansProjectRequest { - return ListPlansProjectRequest{ - 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) ListPlansProjectExecute(ctx context.Context, projectId string) (*PlanList, error) { - r := ListPlansProjectRequest{ - 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 UpdateInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string - updateInstancePayload *UpdateInstancePayload -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateInstanceRequest) UpdateInstancePayload(updateInstancePayload UpdateInstancePayload) ApiUpdateInstanceRequest { - r.updateInstancePayload = &updateInstancePayload - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateInstanceRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - client, ok := a.client.(*APIClient) - if !ok { - return fmt.Errorf("could not parse client to type APIClient") - } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstance") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instances/{instanceId}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.instanceId) > 16 { - return fmt.Errorf("instanceId must have less than 16 elements") - } - if r.updateInstancePayload == nil { - return fmt.Errorf("updateInstancePayload is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateInstancePayload - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - return newErr - } - - return nil -} - -/* -UpdateInstance: Method for UpdateInstance - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param instanceId The full ID of the instance, -. - @return ApiUpdateInstanceRequest -*/ -func (a *APIClient) UpdateInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateInstanceRequest { - return UpdateInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { - r := UpdateInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceByNameRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - displayName string - updateInstanceByNamePayload *UpdateInstanceByNamePayload -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateInstanceByNameRequest) UpdateInstanceByNamePayload(updateInstanceByNamePayload UpdateInstanceByNamePayload) ApiUpdateInstanceByNameRequest { - r.updateInstanceByNamePayload = &updateInstanceByNamePayload - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateInstanceByNameRequest) Execute() error { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - ) - a := r.apiService - client, ok := a.client.(*APIClient) - if !ok { - return fmt.Errorf("could not parse client to type APIClient") - } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.UpdateInstanceByName") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1beta1/projects/{projectId}/regions/{regionId}/instancesbyname/{displayName}" - localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"regionId"+"}", url.PathEscape(ParameterValueToString(r.regionId, "regionId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"displayName"+"}", url.PathEscape(ParameterValueToString(r.displayName, "displayName")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if strlen(r.displayName) > 8 { - return fmt.Errorf("displayName must have less than 8 elements") - } - if r.updateInstanceByNamePayload == nil { - return fmt.Errorf("updateInstanceByNamePayload is required and must be specified") - } - - // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} - - // set Content-Type header - localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) - if localVarHTTPContentType != "" { - localVarHeaderParams["Content-Type"] = localVarHTTPContentType - } - - // to determine the Accept header - localVarHTTPHeaderAccepts := []string{"application/json"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateInstanceByNamePayload - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 400 { - var v BadRequest - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedRequest - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return newErr - } - return newErr - } - - return nil -} - -/* -UpdateInstanceByName: Method for UpdateInstanceByName - -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 The STACKIT portal project UUID the instance is part of. - @param regionId The STACKIT region the instance is part of. - @param displayName The instance display name. - @return ApiUpdateInstanceByNameRequest -*/ -func (a *APIClient) UpdateInstanceByName(ctx context.Context, projectId string, regionId string, displayName string) ApiUpdateInstanceByNameRequest { - return UpdateInstanceByNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateInstanceByNameExecute(ctx context.Context, projectId string, regionId string, displayName string) error { - r := UpdateInstanceByNameRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - displayName: displayName, - } - return r.Execute() -} diff --git a/services/edge/client.go b/services/edge/client.go deleted file mode 100644 index cc0607032d..0000000000 --- a/services/edge/client.go +++ /dev/null @@ -1,635 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "bytes" - "context" - "encoding/json" - "encoding/xml" - "fmt" - "io" - "log" - "mime/multipart" - "net/http" - "net/http/httputil" - "net/url" - "os" - "path/filepath" - "reflect" - "regexp" - "strconv" - "strings" - "time" - "unicode/utf8" - - "github.com/stackitcloud/stackit-sdk-go/core/auth" - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -var ( - jsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:vnd\.[^;]+\+)?json)`) - xmlCheck = regexp.MustCompile(`(?i:(?:application|text)/xml)`) - queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) - queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") -) - -// APIClient manages communication with the STACKIT Edge Cloud API API v1beta1 -// In most cases there should be only one, shared, APIClient. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type APIClient struct { - cfg *config.Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - defaultApi *DefaultApiService -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type service struct { - client DefaultApi -} - -// NewAPIClient creates a new API client. -// Optionally receives configuration options -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { - cfg := NewConfiguration() - - for _, option := range opts { - err := option(cfg) - if err != nil { - return nil, fmt.Errorf("configuring the client: %w", err) - } - } - - err := config.ConfigureRegion(cfg) - if err != nil { - return nil, fmt.Errorf("configuring region: %w", err) - } - - if cfg.HTTPClient == nil { - cfg.HTTPClient = &http.Client{} - } - - authRoundTripper, err := auth.SetupAuth(cfg) - if err != nil { - return nil, fmt.Errorf("setting up authentication: %w", err) - } - - roundTripper := authRoundTripper - if cfg.Middleware != nil { - roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) - } - - cfg.HTTPClient.Transport = roundTripper - - c := &APIClient{} - c.cfg = cfg - c.common.client = c - c.defaultApi = (*DefaultApiService)(&c.common) - - return c, nil -} - -func atoi(in string) (int, error) { - return strconv.Atoi(in) -} - -// selectHeaderContentType select a content type from the available list. -func selectHeaderContentType(contentTypes []string) string { - if len(contentTypes) == 0 { - return "" - } - if contains(contentTypes, "application/json") { - return "application/json" - } - return contentTypes[0] // use the first content type specified in 'consumes' -} - -// selectHeaderAccept join all accept types and return -func selectHeaderAccept(accepts []string) string { - if len(accepts) == 0 { - return "" - } - - if contains(accepts, "application/json") { - return "application/json" - } - - return strings.Join(accepts, ",") -} - -// contains is a case insensitive match, finding needle in a haystack -func contains(haystack []string, needle string) bool { - for _, a := range haystack { - if strings.EqualFold(a, needle) { - return true - } - } - return false -} - -// Verify optional parameters are of the correct type. -func typeCheckParameter(obj interface{}, expected string, name string) error { - // Make sure there is an object. - if obj == nil { - return nil - } - - // Check the type is as expected. - if reflect.TypeOf(obj).String() != expected { - return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) - } - return nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func ParameterValueToString(obj interface{}, key string) string { - if reflect.TypeOf(obj).Kind() != reflect.Ptr { - return fmt.Sprintf("%v", obj) - } - var param, ok = obj.(MappedNullable) - if !ok { - return "" - } - dataMap, err := param.ToMap() - if err != nil { - return "" - } - return fmt.Sprintf("%v", dataMap[key]) -} - -// parameterAddToHeaderOrQuery adds the provided object to the request header or url query -// supporting deep object syntax -func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, collectionType string) { - var v = reflect.ValueOf(obj) - var value = "" - if v == reflect.ValueOf(nil) { - value = "null" - } else { - switch v.Kind() { - case reflect.Invalid: - value = "invalid" - - case reflect.Struct: - if t, ok := obj.(MappedNullable); ok { - dataMap, err := t.ToMap() - if err != nil { - return - } - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, collectionType) - return - } - if t, ok := obj.(time.Time); ok { - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339), collectionType) - return - } - value = v.Type().String() + " value" - case reflect.Slice: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - var lenIndValue = indValue.Len() - for i := 0; i < lenIndValue; i++ { - var arrayValue = indValue.Index(i) - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, arrayValue.Interface(), collectionType) - } - return - - case reflect.Map: - var indValue = reflect.ValueOf(obj) - if indValue == reflect.ValueOf(nil) { - return - } - iter := indValue.MapRange() - for iter.Next() { - k, v := iter.Key(), iter.Value() - parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), collectionType) - } - return - - case reflect.Interface: - fallthrough - case reflect.Ptr: - parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), collectionType) - return - - case reflect.Int, reflect.Int8, reflect.Int16, - reflect.Int32, reflect.Int64: - value = strconv.FormatInt(v.Int(), 10) - case reflect.Uint, reflect.Uint8, reflect.Uint16, - reflect.Uint32, reflect.Uint64, reflect.Uintptr: - value = strconv.FormatUint(v.Uint(), 10) - case reflect.Float32, reflect.Float64: - value = strconv.FormatFloat(v.Float(), 'g', -1, 32) - case reflect.Bool: - value = strconv.FormatBool(v.Bool()) - case reflect.String: - value = v.String() - default: - value = v.Type().String() + " value" - } - } - - switch valuesMap := headerOrQueryParams.(type) { - case url.Values: - if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { - valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) - } else { - valuesMap.Add(keyPrefix, value) - } - break - case map[string]string: - valuesMap[keyPrefix] = value - break - } -} - -// helper for converting interface{} parameters to json strings -func parameterToJson(obj interface{}) (string, error) { - jsonBuf, err := json.Marshal(obj) - if err != nil { - return "", err - } - return string(jsonBuf), err -} - -// callAPI do the request. -func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { - if c.cfg.Debug { - dump, err := httputil.DumpRequestOut(request, true) - if err != nil { - return nil, err - } - log.Printf("\n%s\n", string(dump)) - } - - resp, err := c.cfg.HTTPClient.Do(request) - if err != nil { - return resp, err - } - - if c.cfg.Debug { - dump, err := httputil.DumpResponse(resp, true) - if err != nil { - return resp, err - } - log.Printf("\n%s\n", string(dump)) - } - return resp, err -} - -// Allow modification of underlying config for alternate implementations and testing -// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (c *APIClient) GetConfig() *config.Configuration { - return c.cfg -} - -type formFile struct { - fileBytes []byte - fileName string - formFileName string -} - -// prepareRequest build the request -func (c *APIClient) prepareRequest( - ctx context.Context, - path string, method string, - postBody interface{}, - headerParams map[string]string, - queryParams url.Values, - formParams url.Values, - formFiles []formFile) (localVarRequest *http.Request, err error) { - - var body *bytes.Buffer - - // Detect postBody type and post. - if !IsNil(postBody) { - contentType := headerParams["Content-Type"] - if contentType == "" { - contentType = detectContentType(postBody) - headerParams["Content-Type"] = contentType - } - - body, err = setBody(postBody, contentType) - if err != nil { - return nil, err - } - } - - // add form parameters and file if available. - if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { - if body != nil { - return nil, fmt.Errorf("cannot specify postBody and multipart form at the same time.") - } - body = &bytes.Buffer{} - w := multipart.NewWriter(body) - - for k, v := range formParams { - for _, iv := range v { - if strings.HasPrefix(k, "@") { // file - err = addFile(w, k[1:], iv) - if err != nil { - return nil, err - } - } else { // form value - w.WriteField(k, iv) - } - } - } - for _, formFile := range formFiles { - if len(formFile.fileBytes) > 0 && formFile.fileName != "" { - w.Boundary() - part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) - if err != nil { - return nil, err - } - _, err = part.Write(formFile.fileBytes) - if err != nil { - return nil, err - } - } - } - - // Set the Boundary in the Content-Type - headerParams["Content-Type"] = w.FormDataContentType() - - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - w.Close() - } - - if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { - if body != nil { - return nil, fmt.Errorf("cannot specify postBody and x-www-form-urlencoded form at the same time.") - } - body = &bytes.Buffer{} - body.WriteString(formParams.Encode()) - // Set Content-Length - headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) - } - - // Setup path and query parameters - url, err := url.Parse(path) - if err != nil { - return nil, err - } - - // Override request host, if applicable - if c.cfg.Host != "" { - url.Host = c.cfg.Host - } - - // Override request scheme, if applicable - if c.cfg.Scheme != "" { - url.Scheme = c.cfg.Scheme - } - - // Adding Query Param - query := url.Query() - for k, v := range queryParams { - for _, iv := range v { - query.Add(k, iv) - } - } - - // Encode the parameters. - url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { - pieces := strings.Split(s, "=") - pieces[0] = queryDescape.Replace(pieces[0]) - return strings.Join(pieces, "=") - }) - - // Generate a new request - if body != nil { - localVarRequest, err = http.NewRequest(method, url.String(), body) - } else { - localVarRequest, err = http.NewRequest(method, url.String(), nil) - } - if err != nil { - return nil, err - } - - // add header parameters, if any - if len(headerParams) > 0 { - headers := http.Header{} - for h, v := range headerParams { - headers[h] = []string{v} - } - localVarRequest.Header = headers - } - - // Add the user agent to the request. - localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) - - if ctx != nil { - // add context to the request - localVarRequest = localVarRequest.WithContext(ctx) - - // Walk through any authentication. - - } - - for header, value := range c.cfg.DefaultHeader { - localVarRequest.Header.Add(header, value) - } - return localVarRequest, nil -} - -func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { - if len(b) == 0 { - return nil - } - if s, ok := v.(*string); ok { - *s = string(b) - return nil - } - if f, ok := v.(*os.File); ok { - f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = f.Write(b) - if err != nil { - return - } - _, err = f.Seek(0, io.SeekStart) - return - } - if f, ok := v.(**os.File); ok { - *f, err = os.CreateTemp("", "HttpClientFile") - if err != nil { - return - } - _, err = (*f).Write(b) - if err != nil { - return - } - _, err = (*f).Seek(0, io.SeekStart) - return - } - if xmlCheck.MatchString(contentType) { - if err = xml.Unmarshal(b, v); err != nil { - return err - } - return nil - } - if jsonCheck.MatchString(contentType) { - if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas - if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined - if err = unmarshalObj.UnmarshalJSON(b); err != nil { - return err - } - } else { - return fmt.Errorf("unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") - } - } else if err = json.Unmarshal(b, v); err != nil { // simple model - return err - } - return nil - } - return fmt.Errorf("undefined response type") -} - -// Add a file to the multipart request -func addFile(w *multipart.Writer, fieldName, path string) error { - file, err := os.Open(filepath.Clean(path)) - if err != nil { - return err - } - defer file.Close() - - part, err := w.CreateFormFile(fieldName, filepath.Base(path)) - if err != nil { - return err - } - _, err = io.Copy(part, file) - - return err -} - -// A wrapper for strict JSON decoding -func newStrictDecoder(data []byte) *json.Decoder { - dec := json.NewDecoder(bytes.NewBuffer(data)) - dec.DisallowUnknownFields() - return dec -} - -// Set request body from an interface{} -func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { - if bodyBuf == nil { - bodyBuf = &bytes.Buffer{} - } - - if reader, ok := body.(io.Reader); ok { - _, err = bodyBuf.ReadFrom(reader) - } else if fp, ok := body.(*os.File); ok { - _, err = bodyBuf.ReadFrom(fp) - } else if b, ok := body.([]byte); ok { - _, err = bodyBuf.Write(b) - } else if s, ok := body.(string); ok { - _, err = bodyBuf.WriteString(s) - } else if s, ok := body.(*string); ok { - _, err = bodyBuf.WriteString(*s) - } else if jsonCheck.MatchString(contentType) { - err = json.NewEncoder(bodyBuf).Encode(body) - } else if xmlCheck.MatchString(contentType) { - err = xml.NewEncoder(bodyBuf).Encode(body) - } - - if err != nil { - return nil, err - } - - if bodyBuf.Len() == 0 { - err = fmt.Errorf("invalid body type %s", contentType) - return nil, err - } - return bodyBuf, nil -} - -// detectContentType method is used to figure out `Request.Body` content type for request header -func detectContentType(body interface{}) string { - contentType := "text/plain; charset=utf-8" - kind := reflect.TypeOf(body).Kind() - - switch kind { - case reflect.Struct, reflect.Map, reflect.Ptr: - contentType = "application/json; charset=utf-8" - case reflect.String: - contentType = "text/plain; charset=utf-8" - default: - if b, ok := body.([]byte); ok { - contentType = http.DetectContentType(b) - } else if kind == reflect.Slice { - contentType = "application/json; charset=utf-8" - } - } - - return contentType -} - -// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go -type cacheControl map[string]string - -func parseCacheControl(headers http.Header) cacheControl { - cc := cacheControl{} - ccHeader := headers.Get("Cache-Control") - for _, part := range strings.Split(ccHeader, ",") { - part = strings.Trim(part, " ") - if part == "" { - continue - } - if strings.ContainsRune(part, '=') { - keyval := strings.Split(part, "=") - cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") - } else { - cc[part] = "" - } - } - return cc -} - -// CacheExpires helper function to determine remaining time before repeating a request. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func CacheExpires(r *http.Response) time.Time { - // Figure out when the cache expires. - var expires time.Time - now, err := time.Parse(time.RFC1123, r.Header.Get("date")) - if err != nil { - return time.Now() - } - respCacheControl := parseCacheControl(r.Header) - - if maxAge, ok := respCacheControl["max-age"]; ok { - lifetime, err := time.ParseDuration(maxAge + "s") - if err != nil { - expires = now - } else { - expires = now.Add(lifetime) - } - } else { - expiresHeader := r.Header.Get("Expires") - if expiresHeader != "" { - expires, err = time.Parse(time.RFC1123, expiresHeader) - if err != nil { - expires = now - } - } - } - return expires -} - -func strlen(s string) int { - return utf8.RuneCountInString(s) -} diff --git a/services/edge/configuration.go b/services/edge/configuration.go deleted file mode 100644 index 0bb848edbd..0000000000 --- a/services/edge/configuration.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -// NewConfiguration returns a new Configuration object -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewConfiguration() *config.Configuration { - cfg := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "stackit-sdk-go/edge", - Debug: false, - Servers: config.ServerConfigurations{ - { - URL: "https://edge.api.stackit.cloud", - Description: "No description provided", - Variables: map[string]config.ServerVariable{ - "region": { - Description: "No description provided", - DefaultValue: "global", - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - return cfg -} diff --git a/services/edge/go.mod b/services/edge/go.mod index 65b5ba09bf..31af909d1e 100644 --- a/services/edge/go.mod +++ b/services/edge/go.mod @@ -2,7 +2,7 @@ module github.com/stackitcloud/stackit-sdk-go/services/edge go 1.25 -require github.com/stackitcloud/stackit-sdk-go/core v0.27.0 +require github.com/stackitcloud/stackit-sdk-go/core v0.27.1 require ( github.com/golang-jwt/jwt/v5 v5.3.1 // indirect diff --git a/services/edge/go.sum b/services/edge/go.sum index 042f4a71a5..5bae1d1250 100644 --- a/services/edge/go.sum +++ b/services/edge/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.27.0 h1:7lc6qStcFDFf8zHP4ORPa9joybw+Sa2LtB6BVjKQ+ek= -github.com/stackitcloud/stackit-sdk-go/core v0.27.0/go.mod h1:WU1hhxnjXw2EV7CYa1nlEvNpMiRY6CvmIOaHuL3pOaA= +github.com/stackitcloud/stackit-sdk-go/core v0.27.1 h1:k7SrqqMoHjkvHbx6n6nV3Lt51itp8nNplht6vGHkPhw= +github.com/stackitcloud/stackit-sdk-go/core v0.27.1/go.mod h1:WU1hhxnjXw2EV7CYa1nlEvNpMiRY6CvmIOaHuL3pOaA= diff --git a/services/edge/model_acl.go b/services/edge/model_acl.go deleted file mode 100644 index f2bf3c8956..0000000000 --- a/services/edge/model_acl.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the Acl type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Acl{} - -/* - types and functions for ipAllowList -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AclGetIpAllowListAttributeType = *[]IpAllowListEntry - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AclGetIpAllowListArgType = []IpAllowListEntry - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AclGetIpAllowListRetType = []IpAllowListEntry - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAclGetIpAllowListAttributeTypeOk(arg AclGetIpAllowListAttributeType) (ret AclGetIpAllowListRetType, 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 setAclGetIpAllowListAttributeType(arg *AclGetIpAllowListAttributeType, val AclGetIpAllowListRetType) { - *arg = &val -} - -// Acl The ACL config for the instances API. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type Acl struct { - IpAllowList AclGetIpAllowListAttributeType `json:"ipAllowList,omitempty"` -} - -// NewAcl instantiates a new Acl 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 NewAcl() *Acl { - this := Acl{} - return &this -} - -// NewAclWithDefaults instantiates a new Acl 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 NewAclWithDefaults() *Acl { - this := Acl{} - return &this -} - -// GetIpAllowList returns the IpAllowList 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 *Acl) GetIpAllowList() (res AclGetIpAllowListRetType) { - res, _ = o.GetIpAllowListOk() - return -} - -// GetIpAllowListOk returns a tuple with the IpAllowList 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 *Acl) GetIpAllowListOk() (ret AclGetIpAllowListRetType, ok bool) { - return getAclGetIpAllowListAttributeTypeOk(o.IpAllowList) -} - -// HasIpAllowList 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 *Acl) HasIpAllowList() bool { - _, ok := o.GetIpAllowListOk() - return ok -} - -// SetIpAllowList gets a reference to the given []IpAllowListEntry and assigns it to the IpAllowList field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Acl) SetIpAllowList(v AclGetIpAllowListRetType) { - setAclGetIpAllowListAttributeType(&o.IpAllowList, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o Acl) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAclGetIpAllowListAttributeTypeOk(o.IpAllowList); ok { - toSerialize["IpAllowList"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableAcl struct { - value *Acl - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableAcl) Get() *Acl { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableAcl) Set(val *Acl) { - 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 NullableAcl) 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 *NullableAcl) 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 NewNullableAcl(val *Acl) *NullableAcl { - return &NullableAcl{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 NullableAcl) 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 *NullableAcl) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_acl_test.go b/services/edge/model_acl_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_acl_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_bad_request.go b/services/edge/model_bad_request.go deleted file mode 100644 index 5924893893..0000000000 --- a/services/edge/model_bad_request.go +++ /dev/null @@ -1,209 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the BadRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &BadRequest{} - -/* - types and functions for code -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BadRequestGetCodeAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBadRequestGetCodeAttributeTypeOk(arg BadRequestGetCodeAttributeType) (ret BadRequestGetCodeRetType, 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 setBadRequestGetCodeAttributeType(arg *BadRequestGetCodeAttributeType, val BadRequestGetCodeRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BadRequestGetCodeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BadRequestGetCodeRetType = string - -/* - types and functions for message -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BadRequestGetMessageAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getBadRequestGetMessageAttributeTypeOk(arg BadRequestGetMessageAttributeType) (ret BadRequestGetMessageRetType, 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 setBadRequestGetMessageAttributeType(arg *BadRequestGetMessageAttributeType, val BadRequestGetMessageRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BadRequestGetMessageArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BadRequestGetMessageRetType = string - -// BadRequest struct for BadRequest -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type BadRequest struct { - Code BadRequestGetCodeAttributeType `json:"code,omitempty"` - Message BadRequestGetMessageAttributeType `json:"message,omitempty"` -} - -// NewBadRequest instantiates a new BadRequest 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 NewBadRequest() *BadRequest { - this := BadRequest{} - return &this -} - -// NewBadRequestWithDefaults instantiates a new BadRequest 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 NewBadRequestWithDefaults() *BadRequest { - this := BadRequest{} - return &this -} - -// GetCode returns the Code 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 *BadRequest) GetCode() (res BadRequestGetCodeRetType) { - res, _ = o.GetCodeOk() - return -} - -// GetCodeOk returns a tuple with the Code 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 *BadRequest) GetCodeOk() (ret BadRequestGetCodeRetType, ok bool) { - return getBadRequestGetCodeAttributeTypeOk(o.Code) -} - -// HasCode 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 *BadRequest) HasCode() bool { - _, ok := o.GetCodeOk() - return ok -} - -// SetCode gets a reference to the given string and assigns it to the Code field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *BadRequest) SetCode(v BadRequestGetCodeRetType) { - setBadRequestGetCodeAttributeType(&o.Code, v) -} - -// GetMessage returns the Message 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 *BadRequest) GetMessage() (res BadRequestGetMessageRetType) { - res, _ = o.GetMessageOk() - return -} - -// GetMessageOk returns a tuple with the Message 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 *BadRequest) GetMessageOk() (ret BadRequestGetMessageRetType, ok bool) { - return getBadRequestGetMessageAttributeTypeOk(o.Message) -} - -// HasMessage 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 *BadRequest) HasMessage() bool { - _, ok := o.GetMessageOk() - return ok -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *BadRequest) SetMessage(v BadRequestGetMessageRetType) { - setBadRequestGetMessageAttributeType(&o.Message, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o BadRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getBadRequestGetCodeAttributeTypeOk(o.Code); ok { - toSerialize["Code"] = val - } - if val, ok := getBadRequestGetMessageAttributeTypeOk(o.Message); ok { - toSerialize["Message"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableBadRequest struct { - value *BadRequest - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableBadRequest) Get() *BadRequest { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableBadRequest) Set(val *BadRequest) { - 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 NullableBadRequest) 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 *NullableBadRequest) 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 NewNullableBadRequest(val *BadRequest) *NullableBadRequest { - return &NullableBadRequest{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 NullableBadRequest) 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 *NullableBadRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_bad_request_test.go b/services/edge/model_bad_request_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_bad_request_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_create_instance_payload.go b/services/edge/model_create_instance_payload.go deleted file mode 100644 index 09487f747a..0000000000 --- a/services/edge/model_create_instance_payload.go +++ /dev/null @@ -1,263 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateInstancePayload{} - -/* - types and functions for description -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateInstancePayloadGetDescriptionAttributeTypeOk(arg CreateInstancePayloadGetDescriptionAttributeType) (ret CreateInstancePayloadGetDescriptionRetType, 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 setCreateInstancePayloadGetDescriptionAttributeType(arg *CreateInstancePayloadGetDescriptionAttributeType, val CreateInstancePayloadGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetDescriptionRetType = string - -/* - types and functions for displayName -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetDisplayNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateInstancePayloadGetDisplayNameAttributeTypeOk(arg CreateInstancePayloadGetDisplayNameAttributeType) (ret CreateInstancePayloadGetDisplayNameRetType, 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 setCreateInstancePayloadGetDisplayNameAttributeType(arg *CreateInstancePayloadGetDisplayNameAttributeType, val CreateInstancePayloadGetDisplayNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetDisplayNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetDisplayNameRetType = string - -/* - types and functions for planId -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetPlanIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateInstancePayloadGetPlanIdAttributeTypeOk(arg CreateInstancePayloadGetPlanIdAttributeType) (ret CreateInstancePayloadGetPlanIdRetType, 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 setCreateInstancePayloadGetPlanIdAttributeType(arg *CreateInstancePayloadGetPlanIdAttributeType, val CreateInstancePayloadGetPlanIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetPlanIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayloadGetPlanIdRetType = string - -// CreateInstancePayload struct for CreateInstancePayload -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateInstancePayload struct { - // A user chosen description to distinguish multiple instances. - Description CreateInstancePayloadGetDescriptionAttributeType `json:"description,omitempty"` - // The displayed name to distinguish multiple instances. - // REQUIRED - DisplayName CreateInstancePayloadGetDisplayNameAttributeType `json:"displayName" required:"true"` - // Service Plan configures the size of the Instance. - // REQUIRED - PlanId CreateInstancePayloadGetPlanIdAttributeType `json:"planId" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _CreateInstancePayload CreateInstancePayload - -// NewCreateInstancePayload instantiates a new CreateInstancePayload 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 NewCreateInstancePayload(displayName CreateInstancePayloadGetDisplayNameArgType, planId CreateInstancePayloadGetPlanIdArgType) *CreateInstancePayload { - this := CreateInstancePayload{} - setCreateInstancePayloadGetDisplayNameAttributeType(&this.DisplayName, displayName) - setCreateInstancePayloadGetPlanIdAttributeType(&this.PlanId, planId) - return &this -} - -// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload 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 NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { - this := CreateInstancePayload{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetDescription() (res CreateInstancePayloadGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetDescriptionOk() (ret CreateInstancePayloadGetDescriptionRetType, ok bool) { - return getCreateInstancePayloadGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) SetDescription(v CreateInstancePayloadGetDescriptionRetType) { - setCreateInstancePayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetDisplayName returns the DisplayName field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetDisplayName() (ret CreateInstancePayloadGetDisplayNameRetType) { - ret, _ = o.GetDisplayNameOk() - return ret -} - -// GetDisplayNameOk returns a tuple with the DisplayName field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetDisplayNameOk() (ret CreateInstancePayloadGetDisplayNameRetType, ok bool) { - return getCreateInstancePayloadGetDisplayNameAttributeTypeOk(o.DisplayName) -} - -// SetDisplayName sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) SetDisplayName(v CreateInstancePayloadGetDisplayNameRetType) { - setCreateInstancePayloadGetDisplayNameAttributeType(&o.DisplayName, v) -} - -// GetPlanId returns the PlanId field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetPlanId() (ret CreateInstancePayloadGetPlanIdRetType) { - ret, _ = o.GetPlanIdOk() - return ret -} - -// GetPlanIdOk returns a tuple with the PlanId field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) GetPlanIdOk() (ret CreateInstancePayloadGetPlanIdRetType, ok bool) { - return getCreateInstancePayloadGetPlanIdAttributeTypeOk(o.PlanId) -} - -// SetPlanId sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateInstancePayload) SetPlanId(v CreateInstancePayloadGetPlanIdRetType) { - setCreateInstancePayloadGetPlanIdAttributeType(&o.PlanId, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateInstancePayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getCreateInstancePayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { - toSerialize["DisplayName"] = val - } - if val, ok := getCreateInstancePayloadGetPlanIdAttributeTypeOk(o.PlanId); ok { - toSerialize["PlanId"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableCreateInstancePayload struct { - value *CreateInstancePayload - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { - 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 NullableCreateInstancePayload) 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 *NullableCreateInstancePayload) 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 NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { - return &NullableCreateInstancePayload{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 NullableCreateInstancePayload) 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 *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_create_instance_payload_test.go b/services/edge/model_create_instance_payload_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_create_instance_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_instance.go b/services/edge/model_instance.go deleted file mode 100644 index ba18953992..0000000000 --- a/services/edge/model_instance.go +++ /dev/null @@ -1,665 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the Instance type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Instance{} - -/* - types and functions for acl -*/ - -// isModel -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetAclAttributeType = *Acl - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetAclArgType = Acl - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetAclRetType = Acl - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetAclAttributeTypeOk(arg InstanceGetAclAttributeType) (ret InstanceGetAclRetType, 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 setInstanceGetAclAttributeType(arg *InstanceGetAclAttributeType, val InstanceGetAclRetType) { - *arg = &val -} - -/* - types and functions for created -*/ - -// isDateTime -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetCreatedAttributeType = *time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetCreatedArgType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetCreatedRetType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetCreatedAttributeTypeOk(arg InstanceGetCreatedAttributeType) (ret InstanceGetCreatedRetType, 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 setInstanceGetCreatedAttributeType(arg *InstanceGetCreatedAttributeType, val InstanceGetCreatedRetType) { - *arg = &val -} - -/* - types and functions for description -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetDescriptionAttributeTypeOk(arg InstanceGetDescriptionAttributeType) (ret InstanceGetDescriptionRetType, 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 setInstanceGetDescriptionAttributeType(arg *InstanceGetDescriptionAttributeType, val InstanceGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetDescriptionRetType = string - -/* - types and functions for displayName -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetDisplayNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetDisplayNameAttributeTypeOk(arg InstanceGetDisplayNameAttributeType) (ret InstanceGetDisplayNameRetType, 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 setInstanceGetDisplayNameAttributeType(arg *InstanceGetDisplayNameAttributeType, val InstanceGetDisplayNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetDisplayNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetDisplayNameRetType = string - -/* - types and functions for frontendUrl -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetFrontendUrlAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetFrontendUrlAttributeTypeOk(arg InstanceGetFrontendUrlAttributeType) (ret InstanceGetFrontendUrlRetType, 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 setInstanceGetFrontendUrlAttributeType(arg *InstanceGetFrontendUrlAttributeType, val InstanceGetFrontendUrlRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetFrontendUrlArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetFrontendUrlRetType = string - -/* - 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 InstanceGetIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetIdAttributeTypeOk(arg InstanceGetIdAttributeType) (ret InstanceGetIdRetType, 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 setInstanceGetIdAttributeType(arg *InstanceGetIdAttributeType, val InstanceGetIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetIdRetType = string - -/* - types and functions for planId -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetPlanIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetPlanIdAttributeTypeOk(arg InstanceGetPlanIdAttributeType) (ret InstanceGetPlanIdRetType, 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 setInstanceGetPlanIdAttributeType(arg *InstanceGetPlanIdAttributeType, val InstanceGetPlanIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetPlanIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetPlanIdRetType = string - -/* - types and functions for status -*/ - -// isEnum - -// InstanceStatus The current status of the instance. -// value type for enums -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceStatus string - -// List of Status -const ( - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - INSTANCESTATUS_ERROR InstanceStatus = "error" - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - INSTANCESTATUS_RECONCILING InstanceStatus = "reconciling" - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - INSTANCESTATUS_ACTIVE InstanceStatus = "active" - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - INSTANCESTATUS_DELETING InstanceStatus = "deleting" -) - -// All allowed values of Instance enum -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -var AllowedInstanceStatusEnumValues = []InstanceStatus{ - "error", - "reconciling", - "active", - "deleting", -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *InstanceStatus) UnmarshalJSON(src []byte) error { - // use a type alias to prevent infinite recursion during unmarshal, - // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers - type TmpJson InstanceStatus - var value TmpJson - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - // Allow unmarshalling zero value for testing purposes - var zeroValue TmpJson - if value == zeroValue { - return nil - } - enumTypeValue := InstanceStatus(value) - for _, existing := range AllowedInstanceStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid Instance", value) -} - -// NewInstanceStatusFromValue returns a pointer to a valid InstanceStatus -// for the value passed as argument, or an error if the value passed is not allowed by the enum -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewInstanceStatusFromValue(v InstanceStatus) (*InstanceStatus, error) { - ev := InstanceStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for InstanceStatus: valid values are %v", v, AllowedInstanceStatusEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v InstanceStatus) IsValid() bool { - for _, existing := range AllowedInstanceStatusEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to StatusStatus value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v InstanceStatus) Ptr() *InstanceStatus { - return &v -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceStatus struct { - value *InstanceStatus - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceStatus) Get() *InstanceStatus { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceStatus) Set(val *InstanceStatus) { - 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 NullableInstanceStatus) 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 *NullableInstanceStatus) 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 NewNullableInstanceStatus(val *InstanceStatus) *NullableInstanceStatus { - return &NullableInstanceStatus{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 NullableInstanceStatus) 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 *NullableInstanceStatus) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStatusAttributeType = *InstanceStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStatusArgType = InstanceStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceGetStatusRetType = InstanceStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceGetStatusAttributeTypeOk(arg InstanceGetStatusAttributeType) (ret InstanceGetStatusRetType, 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 setInstanceGetStatusAttributeType(arg *InstanceGetStatusAttributeType, val InstanceGetStatusRetType) { - *arg = &val -} - -// Instance struct for Instance -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type Instance struct { - Acl InstanceGetAclAttributeType `json:"acl,omitempty"` - // The date and time the creation of the instance was triggered. - // REQUIRED - Created InstanceGetCreatedAttributeType `json:"created" required:"true"` - // A user chosen description to distinguish multiple instances. - Description InstanceGetDescriptionAttributeType `json:"description,omitempty"` - // The displayed name of the instance. - // REQUIRED - DisplayName InstanceGetDisplayNameAttributeType `json:"displayName" required:"true"` - // URL to the Management UI of the Instance. - // REQUIRED - FrontendUrl InstanceGetFrontendUrlAttributeType `json:"frontendUrl" required:"true"` - // A auto generated unique id which identifies the instance. - // REQUIRED - Id InstanceGetIdAttributeType `json:"id" required:"true"` - // Service Plan configures the size of the Instance. - // REQUIRED - PlanId InstanceGetPlanIdAttributeType `json:"planId" required:"true"` - // The current status of the instance. - // REQUIRED - Status InstanceGetStatusAttributeType `json:"status" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _Instance Instance - -// NewInstance instantiates a new Instance 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 NewInstance(created InstanceGetCreatedArgType, displayName InstanceGetDisplayNameArgType, frontendUrl InstanceGetFrontendUrlArgType, id InstanceGetIdArgType, planId InstanceGetPlanIdArgType, status InstanceGetStatusArgType) *Instance { - this := Instance{} - setInstanceGetCreatedAttributeType(&this.Created, created) - setInstanceGetDisplayNameAttributeType(&this.DisplayName, displayName) - setInstanceGetFrontendUrlAttributeType(&this.FrontendUrl, frontendUrl) - setInstanceGetIdAttributeType(&this.Id, id) - setInstanceGetPlanIdAttributeType(&this.PlanId, planId) - setInstanceGetStatusAttributeType(&this.Status, status) - return &this -} - -// NewInstanceWithDefaults instantiates a new Instance 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 NewInstanceWithDefaults() *Instance { - this := Instance{} - return &this -} - -// GetAcl returns the Acl 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 *Instance) GetAcl() (res InstanceGetAclRetType) { - res, _ = o.GetAclOk() - return -} - -// GetAclOk returns a tuple with the Acl 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 *Instance) GetAclOk() (ret InstanceGetAclRetType, ok bool) { - return getInstanceGetAclAttributeTypeOk(o.Acl) -} - -// HasAcl 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 *Instance) HasAcl() bool { - _, ok := o.GetAclOk() - return ok -} - -// SetAcl gets a reference to the given Acl and assigns it to the Acl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetAcl(v InstanceGetAclRetType) { - setInstanceGetAclAttributeType(&o.Acl, v) -} - -// GetCreated returns the Created field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetCreated() (ret InstanceGetCreatedRetType) { - ret, _ = o.GetCreatedOk() - return ret -} - -// GetCreatedOk returns a tuple with the Created field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetCreatedOk() (ret InstanceGetCreatedRetType, ok bool) { - return getInstanceGetCreatedAttributeTypeOk(o.Created) -} - -// SetCreated sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetCreated(v InstanceGetCreatedRetType) { - setInstanceGetCreatedAttributeType(&o.Created, v) -} - -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetDescription() (res InstanceGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetDescriptionOk() (ret InstanceGetDescriptionRetType, ok bool) { - return getInstanceGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetDescription(v InstanceGetDescriptionRetType) { - setInstanceGetDescriptionAttributeType(&o.Description, v) -} - -// GetDisplayName returns the DisplayName field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetDisplayName() (ret InstanceGetDisplayNameRetType) { - ret, _ = o.GetDisplayNameOk() - return ret -} - -// GetDisplayNameOk returns a tuple with the DisplayName field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetDisplayNameOk() (ret InstanceGetDisplayNameRetType, ok bool) { - return getInstanceGetDisplayNameAttributeTypeOk(o.DisplayName) -} - -// SetDisplayName sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetDisplayName(v InstanceGetDisplayNameRetType) { - setInstanceGetDisplayNameAttributeType(&o.DisplayName, v) -} - -// GetFrontendUrl returns the FrontendUrl field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetFrontendUrl() (ret InstanceGetFrontendUrlRetType) { - ret, _ = o.GetFrontendUrlOk() - return ret -} - -// GetFrontendUrlOk returns a tuple with the FrontendUrl field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetFrontendUrlOk() (ret InstanceGetFrontendUrlRetType, ok bool) { - return getInstanceGetFrontendUrlAttributeTypeOk(o.FrontendUrl) -} - -// SetFrontendUrl sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetFrontendUrl(v InstanceGetFrontendUrlRetType) { - setInstanceGetFrontendUrlAttributeType(&o.FrontendUrl, v) -} - -// GetId returns the Id field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetId() (ret InstanceGetIdRetType) { - ret, _ = o.GetIdOk() - return ret -} - -// GetIdOk returns a tuple with the Id field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetIdOk() (ret InstanceGetIdRetType, ok bool) { - return getInstanceGetIdAttributeTypeOk(o.Id) -} - -// SetId sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetId(v InstanceGetIdRetType) { - setInstanceGetIdAttributeType(&o.Id, v) -} - -// GetPlanId returns the PlanId field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetPlanId() (ret InstanceGetPlanIdRetType) { - ret, _ = o.GetPlanIdOk() - return ret -} - -// GetPlanIdOk returns a tuple with the PlanId field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetPlanIdOk() (ret InstanceGetPlanIdRetType, ok bool) { - return getInstanceGetPlanIdAttributeTypeOk(o.PlanId) -} - -// SetPlanId sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetPlanId(v InstanceGetPlanIdRetType) { - setInstanceGetPlanIdAttributeType(&o.PlanId, v) -} - -// GetStatus returns the Status field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetStatus() (ret InstanceGetStatusRetType) { - ret, _ = o.GetStatusOk() - return ret -} - -// GetStatusOk returns a tuple with the Status field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) GetStatusOk() (ret InstanceGetStatusRetType, ok bool) { - return getInstanceGetStatusAttributeTypeOk(o.Status) -} - -// SetStatus sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Instance) SetStatus(v InstanceGetStatusRetType) { - setInstanceGetStatusAttributeType(&o.Status, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o Instance) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getInstanceGetAclAttributeTypeOk(o.Acl); ok { - toSerialize["Acl"] = val - } - if val, ok := getInstanceGetCreatedAttributeTypeOk(o.Created); ok { - toSerialize["Created"] = val - } - if val, ok := getInstanceGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getInstanceGetDisplayNameAttributeTypeOk(o.DisplayName); ok { - toSerialize["DisplayName"] = val - } - if val, ok := getInstanceGetFrontendUrlAttributeTypeOk(o.FrontendUrl); ok { - toSerialize["FrontendUrl"] = val - } - if val, ok := getInstanceGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getInstanceGetPlanIdAttributeTypeOk(o.PlanId); ok { - toSerialize["PlanId"] = val - } - if val, ok := getInstanceGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstance struct { - value *Instance - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstance) Get() *Instance { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstance) Set(val *Instance) { - 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 NullableInstance) 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 *NullableInstance) 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 NewNullableInstance(val *Instance) *NullableInstance { - return &NullableInstance{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 NullableInstance) 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 *NullableInstance) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_instance_list.go b/services/edge/model_instance_list.go deleted file mode 100644 index 4bd23426d2..0000000000 --- a/services/edge/model_instance_list.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the InstanceList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &InstanceList{} - -/* - types and functions for instances -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListGetInstancesAttributeType = *[]Instance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListGetInstancesArgType = []Instance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceListGetInstancesRetType = []Instance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getInstanceListGetInstancesAttributeTypeOk(arg InstanceListGetInstancesAttributeType) (ret InstanceListGetInstancesRetType, 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 setInstanceListGetInstancesAttributeType(arg *InstanceListGetInstancesAttributeType, val InstanceListGetInstancesRetType) { - *arg = &val -} - -// InstanceList struct for InstanceList -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type InstanceList struct { - // REQUIRED - Instances InstanceListGetInstancesAttributeType `json:"instances" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _InstanceList InstanceList - -// NewInstanceList instantiates a new InstanceList 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 NewInstanceList(instances InstanceListGetInstancesArgType) *InstanceList { - this := InstanceList{} - setInstanceListGetInstancesAttributeType(&this.Instances, instances) - return &this -} - -// NewInstanceListWithDefaults instantiates a new InstanceList 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 NewInstanceListWithDefaults() *InstanceList { - this := InstanceList{} - return &this -} - -// GetInstances returns the Instances field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceList) GetInstances() (ret InstanceListGetInstancesRetType) { - ret, _ = o.GetInstancesOk() - return ret -} - -// GetInstancesOk returns a tuple with the Instances field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceList) GetInstancesOk() (ret InstanceListGetInstancesRetType, ok bool) { - return getInstanceListGetInstancesAttributeTypeOk(o.Instances) -} - -// SetInstances sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *InstanceList) SetInstances(v InstanceListGetInstancesRetType) { - setInstanceListGetInstancesAttributeType(&o.Instances, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o InstanceList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getInstanceListGetInstancesAttributeTypeOk(o.Instances); ok { - toSerialize["Instances"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInstanceList struct { - value *InstanceList - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInstanceList) Get() *InstanceList { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInstanceList) Set(val *InstanceList) { - 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 NullableInstanceList) 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 *NullableInstanceList) 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 NewNullableInstanceList(val *InstanceList) *NullableInstanceList { - return &NullableInstanceList{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 NullableInstanceList) 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 *NullableInstanceList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_instance_list_test.go b/services/edge/model_instance_list_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_instance_list_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_instance_test.go b/services/edge/model_instance_test.go deleted file mode 100644 index bb78554a35..0000000000 --- a/services/edge/model_instance_test.go +++ /dev/null @@ -1,72 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge - -import ( - "testing" -) - -// isEnum - -func TestInstanceStatus_UnmarshalJSON(t *testing.T) { - type args struct { - src []byte - } - tests := []struct { - name string - args args - wantErr bool - }{ - { - name: `success - possible enum value no. 1`, - args: args{ - src: []byte(`"error"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 2`, - args: args{ - src: []byte(`"reconciling"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 3`, - args: args{ - src: []byte(`"active"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 4`, - args: args{ - src: []byte(`"deleting"`), - }, - wantErr: false, - }, - { - name: "fail", - args: args{ - src: []byte("\"FOOBAR\""), - }, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := InstanceStatus("") - if err := v.UnmarshalJSON(tt.args.src); (err != nil) != tt.wantErr { - t.Errorf("UnmarshalJSON() error = %v, wantErr %v", err, tt.wantErr) - } - }) - } -} diff --git a/services/edge/model_ip_allow_list_entry.go b/services/edge/model_ip_allow_list_entry.go deleted file mode 100644 index 11c1ec313e..0000000000 --- a/services/edge/model_ip_allow_list_entry.go +++ /dev/null @@ -1,382 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" - "time" -) - -// checks if the IpAllowListEntry type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &IpAllowListEntry{} - -/* - 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 IpAllowListEntryGetCreatedAtAttributeType = *time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetCreatedAtArgType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetCreatedAtRetType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getIpAllowListEntryGetCreatedAtAttributeTypeOk(arg IpAllowListEntryGetCreatedAtAttributeType) (ret IpAllowListEntryGetCreatedAtRetType, 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 setIpAllowListEntryGetCreatedAtAttributeType(arg *IpAllowListEntryGetCreatedAtAttributeType, val IpAllowListEntryGetCreatedAtRetType) { - *arg = &val -} - -/* - types and functions for description -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getIpAllowListEntryGetDescriptionAttributeTypeOk(arg IpAllowListEntryGetDescriptionAttributeType) (ret IpAllowListEntryGetDescriptionRetType, 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 setIpAllowListEntryGetDescriptionAttributeType(arg *IpAllowListEntryGetDescriptionAttributeType, val IpAllowListEntryGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetDescriptionRetType = string - -/* - types and functions for ipRange -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetIpRangeAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getIpAllowListEntryGetIpRangeAttributeTypeOk(arg IpAllowListEntryGetIpRangeAttributeType) (ret IpAllowListEntryGetIpRangeRetType, 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 setIpAllowListEntryGetIpRangeAttributeType(arg *IpAllowListEntryGetIpRangeAttributeType, val IpAllowListEntryGetIpRangeRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetIpRangeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetIpRangeRetType = string - -/* - types and functions for updatedAt -*/ - -// isDateTime -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetUpdatedAtAttributeType = *time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetUpdatedAtArgType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetUpdatedAtRetType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getIpAllowListEntryGetUpdatedAtAttributeTypeOk(arg IpAllowListEntryGetUpdatedAtAttributeType) (ret IpAllowListEntryGetUpdatedAtRetType, 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 setIpAllowListEntryGetUpdatedAtAttributeType(arg *IpAllowListEntryGetUpdatedAtAttributeType, val IpAllowListEntryGetUpdatedAtRetType) { - *arg = &val -} - -/* - types and functions for uuid -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetUuidAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getIpAllowListEntryGetUuidAttributeTypeOk(arg IpAllowListEntryGetUuidAttributeType) (ret IpAllowListEntryGetUuidRetType, 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 setIpAllowListEntryGetUuidAttributeType(arg *IpAllowListEntryGetUuidAttributeType, val IpAllowListEntryGetUuidRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetUuidArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntryGetUuidRetType = string - -// IpAllowListEntry struct for IpAllowListEntry -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type IpAllowListEntry struct { - // ISO-8601 timestamp of when the entry was created. - CreatedAt IpAllowListEntryGetCreatedAtAttributeType `json:"createdAt,omitempty"` - // Some description of the entry. - Description IpAllowListEntryGetDescriptionAttributeType `json:"description,omitempty"` - // The IP CIDR range for the ACL entry. - // REQUIRED - IpRange IpAllowListEntryGetIpRangeAttributeType `json:"ipRange" required:"true"` - // ISO-8601 timestamp of when the entry was last updated. - UpdatedAt IpAllowListEntryGetUpdatedAtAttributeType `json:"updatedAt,omitempty"` - // The unique identifier for the ipAllowListEntry entry. This value is immutable, used to identify entries for updates, and cannot be changed after creation. - // REQUIRED - Uuid IpAllowListEntryGetUuidAttributeType `json:"uuid" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _IpAllowListEntry IpAllowListEntry - -// NewIpAllowListEntry instantiates a new IpAllowListEntry 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 NewIpAllowListEntry(ipRange IpAllowListEntryGetIpRangeArgType, uuid IpAllowListEntryGetUuidArgType) *IpAllowListEntry { - this := IpAllowListEntry{} - setIpAllowListEntryGetIpRangeAttributeType(&this.IpRange, ipRange) - setIpAllowListEntryGetUuidAttributeType(&this.Uuid, uuid) - return &this -} - -// NewIpAllowListEntryWithDefaults instantiates a new IpAllowListEntry 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 NewIpAllowListEntryWithDefaults() *IpAllowListEntry { - this := IpAllowListEntry{} - 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 *IpAllowListEntry) GetCreatedAt() (res IpAllowListEntryGetCreatedAtRetType) { - 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 *IpAllowListEntry) GetCreatedAtOk() (ret IpAllowListEntryGetCreatedAtRetType, ok bool) { - return getIpAllowListEntryGetCreatedAtAttributeTypeOk(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 *IpAllowListEntry) 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 *IpAllowListEntry) SetCreatedAt(v IpAllowListEntryGetCreatedAtRetType) { - setIpAllowListEntryGetCreatedAtAttributeType(&o.CreatedAt, v) -} - -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) GetDescription() (res IpAllowListEntryGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) GetDescriptionOk() (ret IpAllowListEntryGetDescriptionRetType, ok bool) { - return getIpAllowListEntryGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) SetDescription(v IpAllowListEntryGetDescriptionRetType) { - setIpAllowListEntryGetDescriptionAttributeType(&o.Description, v) -} - -// GetIpRange returns the IpRange field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) GetIpRange() (ret IpAllowListEntryGetIpRangeRetType) { - ret, _ = o.GetIpRangeOk() - return ret -} - -// GetIpRangeOk returns a tuple with the IpRange field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) GetIpRangeOk() (ret IpAllowListEntryGetIpRangeRetType, ok bool) { - return getIpAllowListEntryGetIpRangeAttributeTypeOk(o.IpRange) -} - -// SetIpRange sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) SetIpRange(v IpAllowListEntryGetIpRangeRetType) { - setIpAllowListEntryGetIpRangeAttributeType(&o.IpRange, v) -} - -// GetUpdatedAt returns the UpdatedAt 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 *IpAllowListEntry) GetUpdatedAt() (res IpAllowListEntryGetUpdatedAtRetType) { - res, _ = o.GetUpdatedAtOk() - return -} - -// GetUpdatedAtOk returns a tuple with the UpdatedAt field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) GetUpdatedAtOk() (ret IpAllowListEntryGetUpdatedAtRetType, ok bool) { - return getIpAllowListEntryGetUpdatedAtAttributeTypeOk(o.UpdatedAt) -} - -// HasUpdatedAt 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 *IpAllowListEntry) HasUpdatedAt() bool { - _, ok := o.GetUpdatedAtOk() - return ok -} - -// SetUpdatedAt gets a reference to the given time.Time and assigns it to the UpdatedAt field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) SetUpdatedAt(v IpAllowListEntryGetUpdatedAtRetType) { - setIpAllowListEntryGetUpdatedAtAttributeType(&o.UpdatedAt, v) -} - -// GetUuid returns the Uuid field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) GetUuid() (ret IpAllowListEntryGetUuidRetType) { - ret, _ = o.GetUuidOk() - return ret -} - -// GetUuidOk returns a tuple with the Uuid field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) GetUuidOk() (ret IpAllowListEntryGetUuidRetType, ok bool) { - return getIpAllowListEntryGetUuidAttributeTypeOk(o.Uuid) -} - -// SetUuid sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *IpAllowListEntry) SetUuid(v IpAllowListEntryGetUuidRetType) { - setIpAllowListEntryGetUuidAttributeType(&o.Uuid, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o IpAllowListEntry) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getIpAllowListEntryGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { - toSerialize["CreatedAt"] = val - } - if val, ok := getIpAllowListEntryGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getIpAllowListEntryGetIpRangeAttributeTypeOk(o.IpRange); ok { - toSerialize["IpRange"] = val - } - if val, ok := getIpAllowListEntryGetUpdatedAtAttributeTypeOk(o.UpdatedAt); ok { - toSerialize["UpdatedAt"] = val - } - if val, ok := getIpAllowListEntryGetUuidAttributeTypeOk(o.Uuid); ok { - toSerialize["Uuid"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableIpAllowListEntry struct { - value *IpAllowListEntry - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableIpAllowListEntry) Get() *IpAllowListEntry { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableIpAllowListEntry) Set(val *IpAllowListEntry) { - 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 NullableIpAllowListEntry) 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 *NullableIpAllowListEntry) 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 NewNullableIpAllowListEntry(val *IpAllowListEntry) *NullableIpAllowListEntry { - return &NullableIpAllowListEntry{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 NullableIpAllowListEntry) 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 *NullableIpAllowListEntry) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_ip_allow_list_entry_test.go b/services/edge/model_ip_allow_list_entry_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_ip_allow_list_entry_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_kubeconfig.go b/services/edge/model_kubeconfig.go deleted file mode 100644 index ed9aabb7cc..0000000000 --- a/services/edge/model_kubeconfig.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the Kubeconfig type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Kubeconfig{} - -/* - types and functions for kubeconfig -*/ - -// isFreeform -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type KubeconfigGetKubeconfigAttributeType = *map[string]interface{} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type KubeconfigGetKubeconfigArgType = map[string]interface{} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type KubeconfigGetKubeconfigRetType = map[string]interface{} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getKubeconfigGetKubeconfigAttributeTypeOk(arg KubeconfigGetKubeconfigAttributeType) (ret KubeconfigGetKubeconfigRetType, 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 setKubeconfigGetKubeconfigAttributeType(arg *KubeconfigGetKubeconfigAttributeType, val KubeconfigGetKubeconfigRetType) { - *arg = &val -} - -// Kubeconfig struct for Kubeconfig -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type Kubeconfig struct { - // The kubeconfig for the instance. - // REQUIRED - Kubeconfig KubeconfigGetKubeconfigAttributeType `json:"kubeconfig" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _Kubeconfig Kubeconfig - -// NewKubeconfig instantiates a new Kubeconfig 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 NewKubeconfig(kubeconfig KubeconfigGetKubeconfigArgType) *Kubeconfig { - this := Kubeconfig{} - setKubeconfigGetKubeconfigAttributeType(&this.Kubeconfig, kubeconfig) - return &this -} - -// NewKubeconfigWithDefaults instantiates a new Kubeconfig 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 NewKubeconfigWithDefaults() *Kubeconfig { - this := Kubeconfig{} - return &this -} - -// GetKubeconfig returns the Kubeconfig field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Kubeconfig) GetKubeconfig() (ret KubeconfigGetKubeconfigRetType) { - ret, _ = o.GetKubeconfigOk() - return ret -} - -// GetKubeconfigOk returns a tuple with the Kubeconfig field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Kubeconfig) GetKubeconfigOk() (ret KubeconfigGetKubeconfigRetType, ok bool) { - return getKubeconfigGetKubeconfigAttributeTypeOk(o.Kubeconfig) -} - -// SetKubeconfig sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Kubeconfig) SetKubeconfig(v KubeconfigGetKubeconfigRetType) { - setKubeconfigGetKubeconfigAttributeType(&o.Kubeconfig, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o Kubeconfig) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getKubeconfigGetKubeconfigAttributeTypeOk(o.Kubeconfig); ok { - toSerialize["Kubeconfig"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableKubeconfig struct { - value *Kubeconfig - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableKubeconfig) Get() *Kubeconfig { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableKubeconfig) Set(val *Kubeconfig) { - 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 NullableKubeconfig) 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 *NullableKubeconfig) 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 NewNullableKubeconfig(val *Kubeconfig) *NullableKubeconfig { - return &NullableKubeconfig{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 NullableKubeconfig) 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 *NullableKubeconfig) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_kubeconfig_test.go b/services/edge/model_kubeconfig_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_kubeconfig_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_kubernetes_release_list.go b/services/edge/model_kubernetes_release_list.go deleted file mode 100644 index 115469d89f..0000000000 --- a/services/edge/model_kubernetes_release_list.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the KubernetesReleaseList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &KubernetesReleaseList{} - -/* - types and functions for k8s_releases -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type KubernetesReleaseListGetK8sReleasesAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type KubernetesReleaseListGetK8sReleasesArgType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type KubernetesReleaseListGetK8sReleasesRetType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getKubernetesReleaseListGetK8sReleasesAttributeTypeOk(arg KubernetesReleaseListGetK8sReleasesAttributeType) (ret KubernetesReleaseListGetK8sReleasesRetType, 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 setKubernetesReleaseListGetK8sReleasesAttributeType(arg *KubernetesReleaseListGetK8sReleasesAttributeType, val KubernetesReleaseListGetK8sReleasesRetType) { - *arg = &val -} - -// KubernetesReleaseList A list of compatible Kubernetes releases. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type KubernetesReleaseList struct { - // Array of Kubernetes version strings. - // REQUIRED - K8sReleases KubernetesReleaseListGetK8sReleasesAttributeType `json:"k8s_releases" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _KubernetesReleaseList KubernetesReleaseList - -// NewKubernetesReleaseList instantiates a new KubernetesReleaseList 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 NewKubernetesReleaseList(k8sReleases KubernetesReleaseListGetK8sReleasesArgType) *KubernetesReleaseList { - this := KubernetesReleaseList{} - setKubernetesReleaseListGetK8sReleasesAttributeType(&this.K8sReleases, k8sReleases) - return &this -} - -// NewKubernetesReleaseListWithDefaults instantiates a new KubernetesReleaseList 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 NewKubernetesReleaseListWithDefaults() *KubernetesReleaseList { - this := KubernetesReleaseList{} - return &this -} - -// GetK8sReleases returns the K8sReleases field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *KubernetesReleaseList) GetK8sReleases() (ret KubernetesReleaseListGetK8sReleasesRetType) { - ret, _ = o.GetK8sReleasesOk() - return ret -} - -// GetK8sReleasesOk returns a tuple with the K8sReleases field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *KubernetesReleaseList) GetK8sReleasesOk() (ret KubernetesReleaseListGetK8sReleasesRetType, ok bool) { - return getKubernetesReleaseListGetK8sReleasesAttributeTypeOk(o.K8sReleases) -} - -// SetK8sReleases sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *KubernetesReleaseList) SetK8sReleases(v KubernetesReleaseListGetK8sReleasesRetType) { - setKubernetesReleaseListGetK8sReleasesAttributeType(&o.K8sReleases, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o KubernetesReleaseList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getKubernetesReleaseListGetK8sReleasesAttributeTypeOk(o.K8sReleases); ok { - toSerialize["K8sReleases"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableKubernetesReleaseList struct { - value *KubernetesReleaseList - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableKubernetesReleaseList) Get() *KubernetesReleaseList { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableKubernetesReleaseList) Set(val *KubernetesReleaseList) { - 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 NullableKubernetesReleaseList) 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 *NullableKubernetesReleaseList) 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 NewNullableKubernetesReleaseList(val *KubernetesReleaseList) *NullableKubernetesReleaseList { - return &NullableKubernetesReleaseList{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 NullableKubernetesReleaseList) 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 *NullableKubernetesReleaseList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_kubernetes_release_list_test.go b/services/edge/model_kubernetes_release_list_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_kubernetes_release_list_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_plan.go b/services/edge/model_plan.go deleted file mode 100644 index f4fa8d72fe..0000000000 --- a/services/edge/model_plan.go +++ /dev/null @@ -1,390 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the Plan type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Plan{} - -/* - types and functions for description -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPlanGetDescriptionAttributeTypeOk(arg PlanGetDescriptionAttributeType) (ret PlanGetDescriptionRetType, 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 setPlanGetDescriptionAttributeType(arg *PlanGetDescriptionAttributeType, val PlanGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetDescriptionRetType = string - -/* - 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 PlanGetIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPlanGetIdAttributeTypeOk(arg PlanGetIdAttributeType) (ret PlanGetIdRetType, 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 setPlanGetIdAttributeType(arg *PlanGetIdAttributeType, val PlanGetIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetIdRetType = string - -/* - types and functions for maxEdgeHosts -*/ - -// isInteger -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetMaxEdgeHostsAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetMaxEdgeHostsArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetMaxEdgeHostsRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPlanGetMaxEdgeHostsAttributeTypeOk(arg PlanGetMaxEdgeHostsAttributeType) (ret PlanGetMaxEdgeHostsRetType, 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 setPlanGetMaxEdgeHostsAttributeType(arg *PlanGetMaxEdgeHostsAttributeType, val PlanGetMaxEdgeHostsRetType) { - *arg = &val -} - -/* - types and functions for minEdgeHosts -*/ - -// isInteger -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetMinEdgeHostsAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetMinEdgeHostsArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetMinEdgeHostsRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPlanGetMinEdgeHostsAttributeTypeOk(arg PlanGetMinEdgeHostsAttributeType) (ret PlanGetMinEdgeHostsRetType, 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 setPlanGetMinEdgeHostsAttributeType(arg *PlanGetMinEdgeHostsAttributeType, val PlanGetMinEdgeHostsRetType) { - *arg = &val -} - -/* - 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 PlanGetNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPlanGetNameAttributeTypeOk(arg PlanGetNameAttributeType) (ret PlanGetNameRetType, 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 setPlanGetNameAttributeType(arg *PlanGetNameAttributeType, val PlanGetNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanGetNameRetType = string - -// Plan struct for Plan -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type Plan struct { - // Description - Description PlanGetDescriptionAttributeType `json:"description,omitempty"` - // Service Plan Identifier - Id PlanGetIdAttributeType `json:"id,omitempty"` - // Maximum number of EdgeHosts - // Can be cast to int32 without loss of precision. - MaxEdgeHosts PlanGetMaxEdgeHostsAttributeType `json:"maxEdgeHosts,omitempty"` - // Minimum number of EdgeHosts charged - // Can be cast to int32 without loss of precision. - MinEdgeHosts PlanGetMinEdgeHostsAttributeType `json:"minEdgeHosts,omitempty"` - // Service Plan Name - Name PlanGetNameAttributeType `json:"name,omitempty"` -} - -// NewPlan instantiates a new Plan 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 NewPlan() *Plan { - this := Plan{} - return &this -} - -// NewPlanWithDefaults instantiates a new Plan 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 NewPlanWithDefaults() *Plan { - this := Plan{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Plan) GetDescription() (res PlanGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Plan) GetDescriptionOk() (ret PlanGetDescriptionRetType, ok bool) { - return getPlanGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Plan) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Plan) SetDescription(v PlanGetDescriptionRetType) { - setPlanGetDescriptionAttributeType(&o.Description, 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 *Plan) GetId() (res PlanGetIdRetType) { - 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 *Plan) GetIdOk() (ret PlanGetIdRetType, ok bool) { - return getPlanGetIdAttributeTypeOk(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 *Plan) 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 *Plan) SetId(v PlanGetIdRetType) { - setPlanGetIdAttributeType(&o.Id, v) -} - -// GetMaxEdgeHosts returns the MaxEdgeHosts 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 *Plan) GetMaxEdgeHosts() (res PlanGetMaxEdgeHostsRetType) { - res, _ = o.GetMaxEdgeHostsOk() - return -} - -// GetMaxEdgeHostsOk returns a tuple with the MaxEdgeHosts 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 *Plan) GetMaxEdgeHostsOk() (ret PlanGetMaxEdgeHostsRetType, ok bool) { - return getPlanGetMaxEdgeHostsAttributeTypeOk(o.MaxEdgeHosts) -} - -// HasMaxEdgeHosts 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 *Plan) HasMaxEdgeHosts() bool { - _, ok := o.GetMaxEdgeHostsOk() - return ok -} - -// SetMaxEdgeHosts gets a reference to the given int64 and assigns it to the MaxEdgeHosts field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Plan) SetMaxEdgeHosts(v PlanGetMaxEdgeHostsRetType) { - setPlanGetMaxEdgeHostsAttributeType(&o.MaxEdgeHosts, v) -} - -// GetMinEdgeHosts returns the MinEdgeHosts 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 *Plan) GetMinEdgeHosts() (res PlanGetMinEdgeHostsRetType) { - res, _ = o.GetMinEdgeHostsOk() - return -} - -// GetMinEdgeHostsOk returns a tuple with the MinEdgeHosts 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 *Plan) GetMinEdgeHostsOk() (ret PlanGetMinEdgeHostsRetType, ok bool) { - return getPlanGetMinEdgeHostsAttributeTypeOk(o.MinEdgeHosts) -} - -// HasMinEdgeHosts 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 *Plan) HasMinEdgeHosts() bool { - _, ok := o.GetMinEdgeHostsOk() - return ok -} - -// SetMinEdgeHosts gets a reference to the given int64 and assigns it to the MinEdgeHosts field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Plan) SetMinEdgeHosts(v PlanGetMinEdgeHostsRetType) { - setPlanGetMinEdgeHostsAttributeType(&o.MinEdgeHosts, 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 *Plan) GetName() (res PlanGetNameRetType) { - 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 *Plan) GetNameOk() (ret PlanGetNameRetType, ok bool) { - return getPlanGetNameAttributeTypeOk(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 *Plan) 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 *Plan) SetName(v PlanGetNameRetType) { - setPlanGetNameAttributeType(&o.Name, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o Plan) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPlanGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getPlanGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getPlanGetMaxEdgeHostsAttributeTypeOk(o.MaxEdgeHosts); ok { - toSerialize["MaxEdgeHosts"] = val - } - if val, ok := getPlanGetMinEdgeHostsAttributeTypeOk(o.MinEdgeHosts); ok { - toSerialize["MinEdgeHosts"] = val - } - if val, ok := getPlanGetNameAttributeTypeOk(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 NullablePlan struct { - value *Plan - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePlan) Get() *Plan { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePlan) Set(val *Plan) { - 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 NullablePlan) 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 *NullablePlan) 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 NewNullablePlan(val *Plan) *NullablePlan { - return &NullablePlan{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 NullablePlan) 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 *NullablePlan) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_plan_list.go b/services/edge/model_plan_list.go deleted file mode 100644 index 0b0d7b5917..0000000000 --- a/services/edge/model_plan_list.go +++ /dev/null @@ -1,151 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the PlanList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &PlanList{} - -/* - types and functions for validPlans -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanListGetValidPlansAttributeType = *[]Plan - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanListGetValidPlansArgType = []Plan - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanListGetValidPlansRetType = []Plan - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getPlanListGetValidPlansAttributeTypeOk(arg PlanListGetValidPlansAttributeType) (ret PlanListGetValidPlansRetType, 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 setPlanListGetValidPlansAttributeType(arg *PlanListGetValidPlansAttributeType, val PlanListGetValidPlansRetType) { - *arg = &val -} - -// PlanList struct for PlanList -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type PlanList struct { - ValidPlans PlanListGetValidPlansAttributeType `json:"validPlans,omitempty"` -} - -// NewPlanList instantiates a new PlanList 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 NewPlanList() *PlanList { - this := PlanList{} - return &this -} - -// NewPlanListWithDefaults instantiates a new PlanList 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 NewPlanListWithDefaults() *PlanList { - this := PlanList{} - return &this -} - -// GetValidPlans returns the ValidPlans 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 *PlanList) GetValidPlans() (res PlanListGetValidPlansRetType) { - res, _ = o.GetValidPlansOk() - return -} - -// GetValidPlansOk returns a tuple with the ValidPlans 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 *PlanList) GetValidPlansOk() (ret PlanListGetValidPlansRetType, ok bool) { - return getPlanListGetValidPlansAttributeTypeOk(o.ValidPlans) -} - -// HasValidPlans 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 *PlanList) HasValidPlans() bool { - _, ok := o.GetValidPlansOk() - return ok -} - -// SetValidPlans gets a reference to the given []Plan and assigns it to the ValidPlans field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *PlanList) SetValidPlans(v PlanListGetValidPlansRetType) { - setPlanListGetValidPlansAttributeType(&o.ValidPlans, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o PlanList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getPlanListGetValidPlansAttributeTypeOk(o.ValidPlans); ok { - toSerialize["ValidPlans"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullablePlanList struct { - value *PlanList - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullablePlanList) Get() *PlanList { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullablePlanList) Set(val *PlanList) { - 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 NullablePlanList) 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 *NullablePlanList) 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 NewNullablePlanList(val *PlanList) *NullablePlanList { - return &NullablePlanList{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 NullablePlanList) 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 *NullablePlanList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_plan_list_test.go b/services/edge/model_plan_list_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_plan_list_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_plan_test.go b/services/edge/model_plan_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_plan_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_token.go b/services/edge/model_token.go deleted file mode 100644 index ccd1efd067..0000000000 --- a/services/edge/model_token.go +++ /dev/null @@ -1,150 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the Token type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &Token{} - -/* - types and functions for token -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type TokenGetTokenAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getTokenGetTokenAttributeTypeOk(arg TokenGetTokenAttributeType) (ret TokenGetTokenRetType, 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 setTokenGetTokenAttributeType(arg *TokenGetTokenAttributeType, val TokenGetTokenRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type TokenGetTokenArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type TokenGetTokenRetType = string - -// Token struct for Token -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type Token struct { - // The token for the instance. - // REQUIRED - Token TokenGetTokenAttributeType `json:"token" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _Token Token - -// NewToken instantiates a new Token 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 NewToken(token TokenGetTokenArgType) *Token { - this := Token{} - setTokenGetTokenAttributeType(&this.Token, token) - return &this -} - -// NewTokenWithDefaults instantiates a new Token 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 NewTokenWithDefaults() *Token { - this := Token{} - return &this -} - -// GetToken returns the Token field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Token) GetToken() (ret TokenGetTokenRetType) { - ret, _ = o.GetTokenOk() - return ret -} - -// GetTokenOk returns a tuple with the Token field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Token) GetTokenOk() (ret TokenGetTokenRetType, ok bool) { - return getTokenGetTokenAttributeTypeOk(o.Token) -} - -// SetToken sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *Token) SetToken(v TokenGetTokenRetType) { - setTokenGetTokenAttributeType(&o.Token, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o Token) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getTokenGetTokenAttributeTypeOk(o.Token); ok { - toSerialize["Token"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableToken struct { - value *Token - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableToken) Get() *Token { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableToken) Set(val *Token) { - 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 NullableToken) 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 *NullableToken) 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 NewNullableToken(val *Token) *NullableToken { - return &NullableToken{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 NullableToken) 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 *NullableToken) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_token_test.go b/services/edge/model_token_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_token_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_unauthorized_request.go b/services/edge/model_unauthorized_request.go deleted file mode 100644 index db40094d31..0000000000 --- a/services/edge/model_unauthorized_request.go +++ /dev/null @@ -1,209 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the UnauthorizedRequest type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UnauthorizedRequest{} - -/* - types and functions for code -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UnauthorizedRequestGetCodeAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUnauthorizedRequestGetCodeAttributeTypeOk(arg UnauthorizedRequestGetCodeAttributeType) (ret UnauthorizedRequestGetCodeRetType, 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 setUnauthorizedRequestGetCodeAttributeType(arg *UnauthorizedRequestGetCodeAttributeType, val UnauthorizedRequestGetCodeRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UnauthorizedRequestGetCodeArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UnauthorizedRequestGetCodeRetType = string - -/* - types and functions for message -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UnauthorizedRequestGetMessageAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUnauthorizedRequestGetMessageAttributeTypeOk(arg UnauthorizedRequestGetMessageAttributeType) (ret UnauthorizedRequestGetMessageRetType, 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 setUnauthorizedRequestGetMessageAttributeType(arg *UnauthorizedRequestGetMessageAttributeType, val UnauthorizedRequestGetMessageRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UnauthorizedRequestGetMessageArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UnauthorizedRequestGetMessageRetType = string - -// UnauthorizedRequest struct for UnauthorizedRequest -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UnauthorizedRequest struct { - Code UnauthorizedRequestGetCodeAttributeType `json:"code,omitempty"` - Message UnauthorizedRequestGetMessageAttributeType `json:"message,omitempty"` -} - -// NewUnauthorizedRequest instantiates a new UnauthorizedRequest 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 NewUnauthorizedRequest() *UnauthorizedRequest { - this := UnauthorizedRequest{} - return &this -} - -// NewUnauthorizedRequestWithDefaults instantiates a new UnauthorizedRequest 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 NewUnauthorizedRequestWithDefaults() *UnauthorizedRequest { - this := UnauthorizedRequest{} - return &this -} - -// GetCode returns the Code 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 *UnauthorizedRequest) GetCode() (res UnauthorizedRequestGetCodeRetType) { - res, _ = o.GetCodeOk() - return -} - -// GetCodeOk returns a tuple with the Code 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 *UnauthorizedRequest) GetCodeOk() (ret UnauthorizedRequestGetCodeRetType, ok bool) { - return getUnauthorizedRequestGetCodeAttributeTypeOk(o.Code) -} - -// HasCode 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 *UnauthorizedRequest) HasCode() bool { - _, ok := o.GetCodeOk() - return ok -} - -// SetCode gets a reference to the given string and assigns it to the Code field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UnauthorizedRequest) SetCode(v UnauthorizedRequestGetCodeRetType) { - setUnauthorizedRequestGetCodeAttributeType(&o.Code, v) -} - -// GetMessage returns the Message 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 *UnauthorizedRequest) GetMessage() (res UnauthorizedRequestGetMessageRetType) { - res, _ = o.GetMessageOk() - return -} - -// GetMessageOk returns a tuple with the Message 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 *UnauthorizedRequest) GetMessageOk() (ret UnauthorizedRequestGetMessageRetType, ok bool) { - return getUnauthorizedRequestGetMessageAttributeTypeOk(o.Message) -} - -// HasMessage 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 *UnauthorizedRequest) HasMessage() bool { - _, ok := o.GetMessageOk() - return ok -} - -// SetMessage gets a reference to the given string and assigns it to the Message field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UnauthorizedRequest) SetMessage(v UnauthorizedRequestGetMessageRetType) { - setUnauthorizedRequestGetMessageAttributeType(&o.Message, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o UnauthorizedRequest) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUnauthorizedRequestGetCodeAttributeTypeOk(o.Code); ok { - toSerialize["Code"] = val - } - if val, ok := getUnauthorizedRequestGetMessageAttributeTypeOk(o.Message); ok { - toSerialize["Message"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUnauthorizedRequest struct { - value *UnauthorizedRequest - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUnauthorizedRequest) Get() *UnauthorizedRequest { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUnauthorizedRequest) Set(val *UnauthorizedRequest) { - 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 NullableUnauthorizedRequest) 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 *NullableUnauthorizedRequest) 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 NewNullableUnauthorizedRequest(val *UnauthorizedRequest) *NullableUnauthorizedRequest { - return &NullableUnauthorizedRequest{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 NullableUnauthorizedRequest) 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 *NullableUnauthorizedRequest) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_unauthorized_request_test.go b/services/edge/model_unauthorized_request_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_unauthorized_request_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_update_instance_by_name_payload.go b/services/edge/model_update_instance_by_name_payload.go deleted file mode 100644 index f68a740293..0000000000 --- a/services/edge/model_update_instance_by_name_payload.go +++ /dev/null @@ -1,211 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the UpdateInstanceByNamePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateInstanceByNamePayload{} - -/* - types and functions for description -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceByNamePayloadGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateInstanceByNamePayloadGetDescriptionAttributeTypeOk(arg UpdateInstanceByNamePayloadGetDescriptionAttributeType) (ret UpdateInstanceByNamePayloadGetDescriptionRetType, 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 setUpdateInstanceByNamePayloadGetDescriptionAttributeType(arg *UpdateInstanceByNamePayloadGetDescriptionAttributeType, val UpdateInstanceByNamePayloadGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceByNamePayloadGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceByNamePayloadGetDescriptionRetType = string - -/* - types and functions for planId -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceByNamePayloadGetPlanIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateInstanceByNamePayloadGetPlanIdAttributeTypeOk(arg UpdateInstanceByNamePayloadGetPlanIdAttributeType) (ret UpdateInstanceByNamePayloadGetPlanIdRetType, 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 setUpdateInstanceByNamePayloadGetPlanIdAttributeType(arg *UpdateInstanceByNamePayloadGetPlanIdAttributeType, val UpdateInstanceByNamePayloadGetPlanIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceByNamePayloadGetPlanIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceByNamePayloadGetPlanIdRetType = string - -// UpdateInstanceByNamePayload struct for UpdateInstanceByNamePayload -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstanceByNamePayload struct { - // A user chosen description to distinguish multiple instances. - Description UpdateInstanceByNamePayloadGetDescriptionAttributeType `json:"description,omitempty"` - // Service Plan configures the size of the Instance. - PlanId UpdateInstanceByNamePayloadGetPlanIdAttributeType `json:"planId,omitempty"` -} - -// NewUpdateInstanceByNamePayload instantiates a new UpdateInstanceByNamePayload 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 NewUpdateInstanceByNamePayload() *UpdateInstanceByNamePayload { - this := UpdateInstanceByNamePayload{} - return &this -} - -// NewUpdateInstanceByNamePayloadWithDefaults instantiates a new UpdateInstanceByNamePayload 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 NewUpdateInstanceByNamePayloadWithDefaults() *UpdateInstanceByNamePayload { - this := UpdateInstanceByNamePayload{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstanceByNamePayload) GetDescription() (res UpdateInstanceByNamePayloadGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstanceByNamePayload) GetDescriptionOk() (ret UpdateInstanceByNamePayloadGetDescriptionRetType, ok bool) { - return getUpdateInstanceByNamePayloadGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstanceByNamePayload) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstanceByNamePayload) SetDescription(v UpdateInstanceByNamePayloadGetDescriptionRetType) { - setUpdateInstanceByNamePayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetPlanId returns the PlanId 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 *UpdateInstanceByNamePayload) GetPlanId() (res UpdateInstanceByNamePayloadGetPlanIdRetType) { - res, _ = o.GetPlanIdOk() - return -} - -// GetPlanIdOk returns a tuple with the PlanId 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 *UpdateInstanceByNamePayload) GetPlanIdOk() (ret UpdateInstanceByNamePayloadGetPlanIdRetType, ok bool) { - return getUpdateInstanceByNamePayloadGetPlanIdAttributeTypeOk(o.PlanId) -} - -// HasPlanId 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 *UpdateInstanceByNamePayload) HasPlanId() bool { - _, ok := o.GetPlanIdOk() - return ok -} - -// SetPlanId gets a reference to the given string and assigns it to the PlanId field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstanceByNamePayload) SetPlanId(v UpdateInstanceByNamePayloadGetPlanIdRetType) { - setUpdateInstanceByNamePayloadGetPlanIdAttributeType(&o.PlanId, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o UpdateInstanceByNamePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateInstanceByNamePayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getUpdateInstanceByNamePayloadGetPlanIdAttributeTypeOk(o.PlanId); ok { - toSerialize["PlanId"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUpdateInstanceByNamePayload struct { - value *UpdateInstanceByNamePayload - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUpdateInstanceByNamePayload) Get() *UpdateInstanceByNamePayload { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUpdateInstanceByNamePayload) Set(val *UpdateInstanceByNamePayload) { - 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 NullableUpdateInstanceByNamePayload) 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 *NullableUpdateInstanceByNamePayload) 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 NewNullableUpdateInstanceByNamePayload(val *UpdateInstanceByNamePayload) *NullableUpdateInstanceByNamePayload { - return &NullableUpdateInstanceByNamePayload{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 NullableUpdateInstanceByNamePayload) 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 *NullableUpdateInstanceByNamePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_update_instance_by_name_payload_test.go b/services/edge/model_update_instance_by_name_payload_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_update_instance_by_name_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_update_instance_payload.go b/services/edge/model_update_instance_payload.go deleted file mode 100644 index 8bdff74fbc..0000000000 --- a/services/edge/model_update_instance_payload.go +++ /dev/null @@ -1,211 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the UpdateInstancePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateInstancePayload{} - -/* - types and functions for description -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateInstancePayloadGetDescriptionAttributeTypeOk(arg UpdateInstancePayloadGetDescriptionAttributeType) (ret UpdateInstancePayloadGetDescriptionRetType, 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 setUpdateInstancePayloadGetDescriptionAttributeType(arg *UpdateInstancePayloadGetDescriptionAttributeType, val UpdateInstancePayloadGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetDescriptionRetType = string - -/* - types and functions for planId -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetPlanIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateInstancePayloadGetPlanIdAttributeTypeOk(arg UpdateInstancePayloadGetPlanIdAttributeType) (ret UpdateInstancePayloadGetPlanIdRetType, 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 setUpdateInstancePayloadGetPlanIdAttributeType(arg *UpdateInstancePayloadGetPlanIdAttributeType, val UpdateInstancePayloadGetPlanIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetPlanIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayloadGetPlanIdRetType = string - -// UpdateInstancePayload struct for UpdateInstancePayload -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateInstancePayload struct { - // A user chosen description to distinguish multiple instances. - Description UpdateInstancePayloadGetDescriptionAttributeType `json:"description,omitempty"` - // Service Plan configures the size of the Instance. - PlanId UpdateInstancePayloadGetPlanIdAttributeType `json:"planId,omitempty"` -} - -// NewUpdateInstancePayload instantiates a new UpdateInstancePayload 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 NewUpdateInstancePayload() *UpdateInstancePayload { - this := UpdateInstancePayload{} - return &this -} - -// NewUpdateInstancePayloadWithDefaults instantiates a new UpdateInstancePayload 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 NewUpdateInstancePayloadWithDefaults() *UpdateInstancePayload { - this := UpdateInstancePayload{} - return &this -} - -// GetDescription returns the Description field value if set, zero value otherwise. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetDescription() (res UpdateInstancePayloadGetDescriptionRetType) { - res, _ = o.GetDescriptionOk() - return -} - -// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) GetDescriptionOk() (ret UpdateInstancePayloadGetDescriptionRetType, ok bool) { - return getUpdateInstancePayloadGetDescriptionAttributeTypeOk(o.Description) -} - -// HasDescription returns a boolean if a field has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) HasDescription() bool { - _, ok := o.GetDescriptionOk() - return ok -} - -// SetDescription gets a reference to the given string and assigns it to the Description field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) SetDescription(v UpdateInstancePayloadGetDescriptionRetType) { - setUpdateInstancePayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetPlanId returns the PlanId 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 *UpdateInstancePayload) GetPlanId() (res UpdateInstancePayloadGetPlanIdRetType) { - res, _ = o.GetPlanIdOk() - return -} - -// GetPlanIdOk returns a tuple with the PlanId 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 *UpdateInstancePayload) GetPlanIdOk() (ret UpdateInstancePayloadGetPlanIdRetType, ok bool) { - return getUpdateInstancePayloadGetPlanIdAttributeTypeOk(o.PlanId) -} - -// HasPlanId 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 *UpdateInstancePayload) HasPlanId() bool { - _, ok := o.GetPlanIdOk() - return ok -} - -// SetPlanId gets a reference to the given string and assigns it to the PlanId field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateInstancePayload) SetPlanId(v UpdateInstancePayloadGetPlanIdRetType) { - setUpdateInstancePayloadGetPlanIdAttributeType(&o.PlanId, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o UpdateInstancePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateInstancePayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getUpdateInstancePayloadGetPlanIdAttributeTypeOk(o.PlanId); ok { - toSerialize["PlanId"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUpdateInstancePayload struct { - value *UpdateInstancePayload - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUpdateInstancePayload) Get() *UpdateInstancePayload { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUpdateInstancePayload) Set(val *UpdateInstancePayload) { - 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 NullableUpdateInstancePayload) 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 *NullableUpdateInstancePayload) 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 NewNullableUpdateInstancePayload(val *UpdateInstancePayload) *NullableUpdateInstancePayload { - return &NullableUpdateInstancePayload{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 NullableUpdateInstancePayload) 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 *NullableUpdateInstancePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_update_instance_payload_test.go b/services/edge/model_update_instance_payload_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_update_instance_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/model_user.go b/services/edge/model_user.go deleted file mode 100644 index 925434bfdc..0000000000 --- a/services/edge/model_user.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// 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 edge - -import ( - "encoding/json" -) - -// checks if the User type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &User{} - -/* - types and functions for email -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetEmailAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetEmailAttributeTypeOk(arg UserGetEmailAttributeType) (ret UserGetEmailRetType, 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 setUserGetEmailAttributeType(arg *UserGetEmailAttributeType, val UserGetEmailRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetEmailArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetEmailRetType = string - -/* - types and functions for internalId -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetInternalIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUserGetInternalIdAttributeTypeOk(arg UserGetInternalIdAttributeType) (ret UserGetInternalIdRetType, 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 setUserGetInternalIdAttributeType(arg *UserGetInternalIdAttributeType, val UserGetInternalIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetInternalIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UserGetInternalIdRetType = string - -// User struct for User -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type User struct { - // The email of the user. - // REQUIRED - Email UserGetEmailAttributeType `json:"email" required:"true"` - // The UUID of the user. - // REQUIRED - InternalId UserGetInternalIdAttributeType `json:"internalId" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _User User - -// NewUser instantiates a new User 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 NewUser(email UserGetEmailArgType, internalId UserGetInternalIdArgType) *User { - this := User{} - setUserGetEmailAttributeType(&this.Email, email) - setUserGetInternalIdAttributeType(&this.InternalId, internalId) - return &this -} - -// NewUserWithDefaults instantiates a new User 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 NewUserWithDefaults() *User { - this := User{} - return &this -} - -// GetEmail returns the Email field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetEmail() (ret UserGetEmailRetType) { - ret, _ = o.GetEmailOk() - return ret -} - -// GetEmailOk returns a tuple with the Email field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetEmailOk() (ret UserGetEmailRetType, ok bool) { - return getUserGetEmailAttributeTypeOk(o.Email) -} - -// SetEmail sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetEmail(v UserGetEmailRetType) { - setUserGetEmailAttributeType(&o.Email, v) -} - -// GetInternalId returns the InternalId field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetInternalId() (ret UserGetInternalIdRetType) { - ret, _ = o.GetInternalIdOk() - return ret -} - -// GetInternalIdOk returns a tuple with the InternalId field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) GetInternalIdOk() (ret UserGetInternalIdRetType, ok bool) { - return getUserGetInternalIdAttributeTypeOk(o.InternalId) -} - -// SetInternalId sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *User) SetInternalId(v UserGetInternalIdRetType) { - setUserGetInternalIdAttributeType(&o.InternalId, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o User) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUserGetEmailAttributeTypeOk(o.Email); ok { - toSerialize["Email"] = val - } - if val, ok := getUserGetInternalIdAttributeTypeOk(o.InternalId); ok { - toSerialize["InternalId"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUser struct { - value *User - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUser) Get() *User { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUser) Set(val *User) { - 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 NullableUser) 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 *NullableUser) 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 NewNullableUser(val *User) *NullableUser { - return &NullableUser{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 NullableUser) 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 *NullableUser) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/edge/model_user_test.go b/services/edge/model_user_test.go deleted file mode 100644 index 43efce354b..0000000000 --- a/services/edge/model_user_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge diff --git a/services/edge/oas_commit b/services/edge/oas_commit index 69bfa80b38..2ea6d59b0f 100644 --- a/services/edge/oas_commit +++ b/services/edge/oas_commit @@ -1 +1 @@ -864bdad12a54f612df8fcdb6e41dd2933e94c3af +24dbfc40a5c0e07440476abb6b64d76219f9b2c7 diff --git a/services/edge/package.go b/services/edge/package.go new file mode 100644 index 0000000000..f2c572d544 --- /dev/null +++ b/services/edge/package.go @@ -0,0 +1 @@ +package edge diff --git a/services/edge/utils.go b/services/edge/utils.go deleted file mode 100644 index 67ef5a8c41..0000000000 --- a/services/edge/utils.go +++ /dev/null @@ -1,466 +0,0 @@ -/* -STACKIT Edge Cloud API - -This API provides endpoints for managing STACKIT Edge Cloud instances. - -API version: 1beta1 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package edge - -import ( - "encoding/json" - "math/rand" - "reflect" - "time" -) - -// PtrBool is a helper routine that returns a pointer to given boolean value. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func PtrBool(v bool) *bool { return &v } - -// PtrInt is a helper routine that returns a pointer to given integer value. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func PtrInt(v int) *int { return &v } - -// PtrInt32 is a helper routine that returns a pointer to given integer value. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func PtrInt32(v int32) *int32 { return &v } - -// PtrInt64 is a helper routine that returns a pointer to given integer value. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func PtrInt64(v int64) *int64 { return &v } - -// PtrFloat32 is a helper routine that returns a pointer to given float value. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func PtrFloat32(v float32) *float32 { return &v } - -// PtrFloat64 is a helper routine that returns a pointer to given float value. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func PtrFloat64(v float64) *float64 { return &v } - -// PtrString is a helper routine that returns a pointer to given string value. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func PtrString(v string) *string { return &v } - -// PtrTime is helper routine that returns a pointer to given Time value. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func PtrTime(v time.Time) *time.Time { return &v } - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableValue[T any] struct { - value *T - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableValue[T]) Get() *T { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableValue[T]) Set(val *T) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableValue[T]) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableValue[T]) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableBool struct { - value *bool - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableBool) Get() *bool { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableBool) Set(val *bool) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableBool) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableBool) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableBool(val *bool) *NullableBool { - return &NullableBool{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableBool) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableBool) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInt struct { - value *int - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt) Get() *int { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt) Set(val *int) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInt(val *int) *NullableInt { - return &NullableInt{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInt32 struct { - value *int32 - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt32) Get() *int32 { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt32) Set(val *int32) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt32) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt32) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInt32(val *int32) *NullableInt32 { - return &NullableInt32{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableInt64 struct { - value *int64 - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt64) Get() *int64 { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt64) Set(val *int64) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt64) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt64) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableInt64(val *int64) *NullableInt64 { - return &NullableInt64{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableInt64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableInt64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableFloat32 struct { - value *float32 - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFloat32) Get() *float32 { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFloat32) Set(val *float32) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFloat32) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFloat32) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableFloat32(val *float32) *NullableFloat32 { - return &NullableFloat32{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFloat32) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFloat32) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableFloat64 struct { - value *float64 - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFloat64) Get() *float64 { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFloat64) Set(val *float64) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFloat64) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFloat64) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableFloat64(val *float64) *NullableFloat64 { - return &NullableFloat64{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableFloat64) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableFloat64) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableString struct { - value *string - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableString) Get() *string { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableString) Set(val *string) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableString) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableString) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableString(val *string) *NullableString { - return &NullableString{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableString) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableString) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableTime struct { - value *time.Time - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableTime) Get() *time.Time { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableTime) Set(val *time.Time) { - v.value = val - v.isSet = true -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableTime) IsSet() bool { - return v.isSet -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableTime) Unset() { - v.value = nil - v.isSet = false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewNullableTime(val *time.Time) *NullableTime { - return &NullableTime{value: val, isSet: true} -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableTime) MarshalJSON() ([]byte, error) { - return v.value.MarshalJSON() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableTime) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} - -// IsNil checks if an input is nil -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func IsNil(i interface{}) bool { - if i == nil { - return true - } - if t, ok := i.(interface{ IsSet() bool }); ok { - return !t.IsSet() - } - switch reflect.TypeOf(i).Kind() { - case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: - return reflect.ValueOf(i).IsNil() - case reflect.Array: - return reflect.ValueOf(i).IsZero() - } - return false -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type MappedNullable interface { - ToMap() (map[string]interface{}, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" - -// randString returns a random string with a specified length. It panics if n <= 0. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func randString(n int) string { - b := make([]byte, n) - for i := range b { - b[i] = letterRunes[rand.Intn(len(letterRunes))] - } - return string(b) -} diff --git a/services/edge/wait/deprecation.go b/services/edge/wait/deprecation.go deleted file mode 100644 index 58f184c093..0000000000 --- a/services/edge/wait/deprecation.go +++ /dev/null @@ -1,2 +0,0 @@ -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package wait diff --git a/services/edge/wait/wait.go b/services/edge/wait/wait.go deleted file mode 100644 index 8a8222633a..0000000000 --- a/services/edge/wait/wait.go +++ /dev/null @@ -1,263 +0,0 @@ -package wait - -import ( - "context" - "errors" - "fmt" - "net/http" - "time" - - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" - "github.com/stackitcloud/stackit-sdk-go/core/wait" - "github.com/stackitcloud/stackit-sdk-go/services/edge" -) - -const timeoutMinutes time.Duration = 10 - -var ( - ErrInstanceNotFound = errors.New("instance not found") - ErrInstanceStatusUndefined = errors.New("instance status undefined") - // Deprecated: ErrInstanceCreationFailed is no longer used and will be removed after 2026-11-07 - ErrInstanceCreationFailed = errors.New("instance creation failed") - // Deprecated: ErrInstanceIsBeingDeleted is no longer used and will be removed after 2026-11-07 - ErrInstanceIsBeingDeleted = errors.New("instance is being deleted") -) - -// EdgeCloudApiClient is the interface for Edge Cloud API calls which require a waiter. -type EdgeCloudApiClient interface { - GetInstanceExecute(ctx context.Context, projectId, regionId, instanceId string) (*edge.Instance, error) - GetInstanceByNameExecute(ctx context.Context, projectId, regionId, displayName string) (*edge.Instance, error) - GetTokenByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) edge.ApiGetTokenByInstanceIdRequest - GetTokenByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) edge.ApiGetTokenByInstanceNameRequest - GetKubeconfigByInstanceId(ctx context.Context, projectId string, regionId string, instanceId string) edge.ApiGetKubeconfigByInstanceIdRequest - GetKubeconfigByInstanceName(ctx context.Context, projectId string, regionId string, displayName string) edge.ApiGetKubeconfigByInstanceNameRequest -} - -// createOrUpdateInstanceWaitHandler contains the shared logic for waiting on instance creation or updates. -func createOrUpdateInstanceWaitHandler(ctx context.Context, getInstance func(ctx context.Context) (*edge.Instance, error)) *wait.AsyncActionHandler[edge.Instance] { - waitConfig := wait.WaiterHelper[edge.Instance, edge.InstanceStatus]{ - FetchInstance: func() (*edge.Instance, error) { - return getInstance(ctx) - }, - GetState: func(instance *edge.Instance) (edge.InstanceStatus, error) { - if instance == nil || instance.Status == nil { - return "", ErrInstanceNotFound - } - return *instance.Status, nil - }, - ActiveState: []edge.InstanceStatus{edge.INSTANCESTATUS_ACTIVE}, - ErrorState: []edge.InstanceStatus{edge.INSTANCESTATUS_ERROR, edge.INSTANCESTATUS_DELETING}, - } - handler := wait.New(waitConfig.Wait()) - handler.SetTimeout(timeoutMinutes * time.Minute) - return handler -} - -// CreateOrUpdateInstanceWaitHandler waits for instance creation or update by ID to complete. -func CreateOrUpdateInstanceWaitHandler(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, instanceId string) *wait.AsyncActionHandler[edge.Instance] { - return createOrUpdateInstanceWaitHandler(ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceExecute(ctx, projectId, regionId, instanceId) - }) -} - -// CreateOrUpdateInstanceByNameWaitHandler waits for instance creation or update by name to complete. -func CreateOrUpdateInstanceByNameWaitHandler(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, displayName string) *wait.AsyncActionHandler[edge.Instance] { - return createOrUpdateInstanceWaitHandler(ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceByNameExecute(ctx, projectId, regionId, displayName) - }) -} - -// deleteInstanceWaitHandler contains the shared logic for waiting on instance deletion. -func deleteInstanceWaitHandler(ctx context.Context, getInstance func(ctx context.Context) (*edge.Instance, error)) *wait.AsyncActionHandler[edge.Instance] { - waitConfig := wait.WaiterHelper[edge.Instance, edge.InstanceStatus]{ - FetchInstance: func() (*edge.Instance, error) { - return getInstance(ctx) - }, - GetState: func(_ *edge.Instance) (edge.InstanceStatus, error) { - return "", nil - }, - } - handler := wait.New(waitConfig.Wait()) - handler.SetTimeout(timeoutMinutes * time.Minute) - return handler -} - -// DeleteInstanceWaitHandler waits for instance deletion by ID. -func DeleteInstanceWaitHandler(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, instanceId string) *wait.AsyncActionHandler[edge.Instance] { - return deleteInstanceWaitHandler(ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceExecute(ctx, projectId, regionId, instanceId) - }) -} - -// DeleteInstanceByNameWaitHandler waits for instance deletion by name. -func DeleteInstanceByNameWaitHandler(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, displayName string) *wait.AsyncActionHandler[edge.Instance] { - return deleteInstanceWaitHandler(ctx, func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceByNameExecute(ctx, projectId, regionId, displayName) - }) -} - -// kubeconfigWaitHandlerHelper contains the shared logic for waiting for the instance to become ready before retrieving the kubeconfig. -func kubeconfigWaitHandlerHelper(ctx context.Context, checkInstance func(ctx context.Context) error, getKubeconfig func(ctx context.Context) (*edge.Kubeconfig, error)) *wait.AsyncActionHandler[edge.Kubeconfig] { - waitConfig := wait.WaiterHelper[edge.Kubeconfig, string]{ - FetchInstance: func() (*edge.Kubeconfig, error) { - err := checkInstance(ctx) - if err != nil { - return nil, err - } - config, err := getKubeconfig(ctx) - if err != nil { - var apiErr *oapierror.GenericOpenAPIError - if ok := errors.As(err, &apiErr); ok && apiErr.StatusCode == http.StatusNotFound { - return nil, nil - } - } - return config, err - }, - GetState: func(k *edge.Kubeconfig) (string, error) { - if k == nil { - return "NOT_READY", nil - } - return "READY", nil - }, - ActiveState: []string{"READY"}, - } - handler := wait.New(waitConfig.Wait()) - handler.SetTimeout(timeoutMinutes * time.Minute) - return handler -} - -// KubeconfigWaitHandler waits the instance to become ready before retrieving the kubeconfig by instance ID. -func KubeconfigWaitHandler(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, instanceId string, expirationSeconds *int64) *wait.AsyncActionHandler[edge.Kubeconfig] { - return kubeconfigWaitHandlerHelper(ctx, - func(ctx context.Context) error { - return checkInstanceExistsWithUsableStatus(ctx, a, projectId, regionId, instanceId) - }, - func(ctx context.Context) (*edge.Kubeconfig, error) { - req := a.GetKubeconfigByInstanceId(ctx, projectId, regionId, instanceId) - if expirationSeconds != nil { - req = req.ExpirationSeconds(*expirationSeconds) - } - return req.Execute() - }, - ) -} - -// KubeconfigByInstanceNameWaitHandler waits the instance to become ready before retrieving the kubeconfig by instance displayName. -func KubeconfigByInstanceNameWaitHandler(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, displayName string, expirationSeconds *int64) *wait.AsyncActionHandler[edge.Kubeconfig] { - return kubeconfigWaitHandlerHelper(ctx, - func(ctx context.Context) error { - return checkInstanceNameExistsWithUsableStatus(ctx, a, projectId, regionId, displayName) - }, - func(ctx context.Context) (*edge.Kubeconfig, error) { - req := a.GetKubeconfigByInstanceName(ctx, projectId, regionId, displayName) - if expirationSeconds != nil { - req = req.ExpirationSeconds(*expirationSeconds) - } - return req.Execute() - }, - ) -} - -// tokenWaitHandlerHelper contains the shared logic for waiting for the instance to become ready before retrieving the service token. -func tokenWaitHandlerHelper(ctx context.Context, checkInstance func(ctx context.Context) error, getToken func(ctx context.Context) (*edge.Token, error)) *wait.AsyncActionHandler[edge.Token] { - waitConfig := wait.WaiterHelper[edge.Token, string]{ - FetchInstance: func() (*edge.Token, error) { - err := checkInstance(ctx) - if err != nil { - return nil, err - } - token, err := getToken(ctx) - if err != nil { - var apiErr *oapierror.GenericOpenAPIError - if ok := errors.As(err, &apiErr); ok && apiErr.StatusCode == http.StatusNotFound { - return nil, nil - } - } - return token, err - }, - GetState: func(t *edge.Token) (string, error) { - if t == nil { - return "NOT_READY", nil - } - return "READY", nil - }, - ActiveState: []string{"READY"}, - } - handler := wait.New(waitConfig.Wait()) - handler.SetTimeout(timeoutMinutes * time.Minute) - return handler -} - -// TokenWaitHandler waits for the instance to become ready before retrieving the service token by instance ID. -func TokenWaitHandler(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, instanceId string, expirationSeconds *int64) *wait.AsyncActionHandler[edge.Token] { - return tokenWaitHandlerHelper(ctx, - func(ctx context.Context) error { - return checkInstanceExistsWithUsableStatus(ctx, a, projectId, regionId, instanceId) - }, - func(ctx context.Context) (*edge.Token, error) { - req := a.GetTokenByInstanceId(ctx, projectId, regionId, instanceId) - if expirationSeconds != nil { - req = req.ExpirationSeconds(*expirationSeconds) - } - return req.Execute() - }, - ) -} - -// TokenByInstanceNameWaitHandler waits for the instance to become ready before retrieving the service token by instance displayName. -func TokenByInstanceNameWaitHandler(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, displayName string, expirationSeconds *int64) *wait.AsyncActionHandler[edge.Token] { - return tokenWaitHandlerHelper(ctx, - func(ctx context.Context) error { - return checkInstanceNameExistsWithUsableStatus(ctx, a, projectId, regionId, displayName) - }, - func(ctx context.Context) (*edge.Token, error) { - req := a.GetTokenByInstanceName(ctx, projectId, regionId, displayName) - if expirationSeconds != nil { - req = req.ExpirationSeconds(*expirationSeconds) - } - return req.Execute() - }, - ) -} - -// checkInstanceUsableStatus contains the shared logic for checking instance status. -func checkInstanceUsableStatus(ctx context.Context, getInstance func(ctx context.Context) (*edge.Instance, error), identifierType, identifierValue string) error { - instance, err := getInstance(ctx) - if err != nil { - return err - } - if instance == nil { - return ErrInstanceNotFound - } - if instance.Status == nil { - return ErrInstanceStatusUndefined - } - if *instance.Status == edge.INSTANCESTATUS_ACTIVE || *instance.Status == edge.INSTANCESTATUS_RECONCILING { - return nil - } - return fmt.Errorf("cannot use instance with %s '%s' with status '%s'", identifierType, identifierValue, *instance.Status) -} - -// checkInstanceExistsWithUsableStatus checks if the instance with the given instanceId exists and has a usable status. -func checkInstanceExistsWithUsableStatus(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, instanceId string) error { - return checkInstanceUsableStatus( - ctx, - func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceExecute(ctx, projectId, regionId, instanceId) - }, - "ID", - instanceId, - ) -} - -// checkInstanceNameExistsWithUsableStatus checks if the instance with the given displayName exists and has a usable status. -func checkInstanceNameExistsWithUsableStatus(ctx context.Context, a EdgeCloudApiClient, projectId, regionId, displayName string) error { - return checkInstanceUsableStatus( - ctx, - func(ctx context.Context) (*edge.Instance, error) { - return a.GetInstanceByNameExecute(ctx, projectId, regionId, displayName) - }, - "name", - displayName, - ) -} diff --git a/services/edge/wait/wait_test.go b/services/edge/wait/wait_test.go deleted file mode 100644 index a79b971dcc..0000000000 --- a/services/edge/wait/wait_test.go +++ /dev/null @@ -1,438 +0,0 @@ -package wait - -import ( - "context" - "errors" - "net/http" - "strings" - "testing" - "testing/synctest" - - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" - "github.com/stackitcloud/stackit-sdk-go/core/wait" - "github.com/stackitcloud/stackit-sdk-go/services/edge" -) - -const ( - testRegion = "eu01" - testProjectId = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" - testInstanceId = "xxxxxxxx-xxxxxxx" - testName = "xxxxxxxx" -) - -type mockApiClient struct { - instanceStatus edge.InstanceStatus - instanceError error - - deleteErrors []error - deleteCallCount int - - resourceErrors []error - resourceCallCount int - mockShouldTimeout bool -} - -func (a *mockApiClient) getDeleteError() error { - var err error - if a.deleteCallCount < len(a.deleteErrors) { - err = a.deleteErrors[a.deleteCallCount] - } - a.deleteCallCount++ - return err -} - -func (a *mockApiClient) getResourceError() error { - if a.mockShouldTimeout { - if len(a.resourceErrors) > 0 { - return a.resourceErrors[0] - } - return nil - } - var err error - if a.resourceCallCount < len(a.resourceErrors) { - err = a.resourceErrors[a.resourceCallCount] - } - a.resourceCallCount++ - return err -} - -func (a *mockApiClient) GetInstanceExecute(_ context.Context, _, _, _ string) (*edge.Instance, error) { - if a.deleteErrors != nil { - err := a.getDeleteError() - if err != nil { - return nil, err - } - return &edge.Instance{}, nil - } - - if a.instanceError != nil { - return nil, a.instanceError - } - return &edge.Instance{Status: &a.instanceStatus}, nil -} - -func (a *mockApiClient) GetInstanceByNameExecute(ctx context.Context, _, _, _ string) (*edge.Instance, error) { - return a.GetInstanceExecute(ctx, "", "", "") -} - -type mockGetKubeconfigRequest struct { - client *mockApiClient -} - -func (r *mockGetKubeconfigRequest) ExpirationSeconds(_ int64) edge.ApiGetKubeconfigByInstanceIdRequest { - return r -} - -func (r *mockGetKubeconfigRequest) Execute() (*edge.Kubeconfig, error) { - if err := r.client.getResourceError(); err != nil { - return nil, err - } - return &edge.Kubeconfig{}, nil -} - -func (a *mockApiClient) GetKubeconfigByInstanceId(context.Context, string, string, string) edge.ApiGetKubeconfigByInstanceIdRequest { - return &mockGetKubeconfigRequest{client: a} -} - -type mockGetKubeconfigByNameRequest struct { - client *mockApiClient -} - -func (r *mockGetKubeconfigByNameRequest) ExpirationSeconds(_ int64) edge.ApiGetKubeconfigByInstanceNameRequest { - return r -} - -func (r *mockGetKubeconfigByNameRequest) Execute() (*edge.Kubeconfig, error) { - if err := r.client.getResourceError(); err != nil { - return nil, err - } - return &edge.Kubeconfig{}, nil -} - -func (a *mockApiClient) GetKubeconfigByInstanceName(context.Context, string, string, string) edge.ApiGetKubeconfigByInstanceNameRequest { - return &mockGetKubeconfigByNameRequest{client: a} -} - -type mockGetTokenRequest struct { - client *mockApiClient -} - -func (r *mockGetTokenRequest) ExpirationSeconds(_ int64) edge.ApiGetTokenByInstanceIdRequest { - return r -} - -func (r *mockGetTokenRequest) Execute() (*edge.Token, error) { - if err := r.client.getResourceError(); err != nil { - return nil, err - } - return &edge.Token{}, nil -} - -func (a *mockApiClient) GetTokenByInstanceId(context.Context, string, string, string) edge.ApiGetTokenByInstanceIdRequest { - return &mockGetTokenRequest{client: a} -} - -type mockGetTokenByNameRequest struct { - client *mockApiClient -} - -func (r *mockGetTokenByNameRequest) ExpirationSeconds(_ int64) edge.ApiGetTokenByInstanceNameRequest { - return r -} - -func (r *mockGetTokenByNameRequest) Execute() (*edge.Token, error) { - if err := r.client.getResourceError(); err != nil { - return nil, err - } - return &edge.Token{}, nil -} - -func (a *mockApiClient) GetTokenByInstanceName(context.Context, string, string, string) edge.ApiGetTokenByInstanceNameRequest { - return &mockGetTokenByNameRequest{client: a} -} - -var createOrUpdateInstanceTests = []struct { - desc string - shouldFail bool // This will be used to set instanceError - instanceStatus edge.InstanceStatus - wantErr error -}{ - { - desc: "successful creation", - shouldFail: false, - instanceStatus: edge.INSTANCESTATUS_ACTIVE, - wantErr: nil, - }, - { - desc: "timeout during reconciliation", - shouldFail: false, - instanceStatus: edge.INSTANCESTATUS_RECONCILING, - wantErr: errors.New("WaitWithContext() has timed out"), - }, - { - desc: "failed creation", - shouldFail: false, - instanceStatus: edge.INSTANCESTATUS_ERROR, - wantErr: errors.New("state is error"), - }, - { - desc: "API fails", - shouldFail: true, - wantErr: &oapierror.GenericOpenAPIError{StatusCode: http.StatusInternalServerError}, - }, -} - -var deleteInstanceTests = []struct { - desc string - errorsToReturn []error - wantErr error -}{ - { - desc: "successful deletion", - errorsToReturn: []error{ - nil, - &oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}, - }, - wantErr: nil, - }, - { - desc: "timeout during deletion", - errorsToReturn: []error{}, - wantErr: errors.New("WaitWithContext() has timed out"), - }, - { - desc: "API fails with status 500 error", - errorsToReturn: []error{ - &oapierror.GenericOpenAPIError{StatusCode: http.StatusInternalServerError}, - }, - wantErr: &oapierror.GenericOpenAPIError{StatusCode: http.StatusInternalServerError}, - }, -} - -// This test table is for handlers that retry on 404, which is currently required due to incorrect active instance status -var kubeconfigOrTokenTests = []struct { - desc string - instanceStatus edge.InstanceStatus - instanceError error - errorsToReturn []error - mockShouldTimeout bool - wantErr error -}{ - { - desc: "success", - instanceStatus: edge.INSTANCESTATUS_ACTIVE, - errorsToReturn: []error{nil}, - wantErr: nil, - }, - { - desc: "success_on_reconciling", - instanceStatus: edge.INSTANCESTATUS_RECONCILING, - errorsToReturn: []error{nil}, - wantErr: nil, - }, - { - desc: "retry_on_404", - instanceStatus: edge.INSTANCESTATUS_ACTIVE, - errorsToReturn: []error{ - &oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}, - &oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}, - &oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}, - nil, - }, - wantErr: nil, - }, - { - desc: "timeout", - instanceStatus: edge.INSTANCESTATUS_ACTIVE, - errorsToReturn: []error{&oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}}, - mockShouldTimeout: true, - wantErr: errors.New("WaitWithContext() has timed out"), - }, - { - desc: "instance_not_found", - instanceError: &oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}, - wantErr: &oapierror.GenericOpenAPIError{StatusCode: http.StatusNotFound}, - }, - { - desc: "unusable_instance_status", - instanceStatus: edge.INSTANCESTATUS_ERROR, - wantErr: errors.New("cannot use instance"), - }, -} - -func checkError(t *testing.T, gotErr, wantErr error) { - t.Helper() - if wantErr == nil { - if gotErr != nil { - t.Fatalf("handler returned an unexpected error: %v", gotErr) - } - return - } - - if gotErr == nil { - t.Fatalf("handler expected error %q, but got nil", wantErr) - } - - var wantOapiErr *oapierror.GenericOpenAPIError - if errors.As(wantErr, &wantOapiErr) { - var gotOapiErr *oapierror.GenericOpenAPIError - if !errors.As(gotErr, &gotOapiErr) { - t.Fatalf("handler error type = %T, want %T", gotErr, wantErr) - } - if wantOapiErr.StatusCode != 0 && gotOapiErr.StatusCode != wantOapiErr.StatusCode { - t.Fatalf("handler error status code = %d, want %d", gotOapiErr.StatusCode, wantOapiErr.StatusCode) - } - return - } - - if !strings.Contains(gotErr.Error(), wantErr.Error()) { - t.Fatalf("handler error = %q, want to contain %q", gotErr.Error(), wantErr.Error()) - } -} - -func executeHandlerAndGetError[T any](handler *wait.AsyncActionHandler[T]) error { - _, err := handler.WaitWithContext(context.Background()) - return err -} - -func TestCreateOrUpdateInstanceWaitHandler(t *testing.T) { - for _, tc := range createOrUpdateInstanceTests { - t.Run(tc.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := &mockApiClient{ - instanceStatus: tc.instanceStatus, - } - if tc.shouldFail { - apiClient.instanceError = &oapierror.GenericOpenAPIError{ - StatusCode: http.StatusInternalServerError, - } - } - handler := CreateOrUpdateInstanceWaitHandler(context.Background(), apiClient, testProjectId, testRegion, testInstanceId) - err := executeHandlerAndGetError(handler) - checkError(t, err, tc.wantErr) - }) - }) - } -} - -func TestCreateOrUpdateInstanceByNameWaitHandler(t *testing.T) { - for _, tc := range createOrUpdateInstanceTests { - t.Run(tc.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := &mockApiClient{ - instanceStatus: tc.instanceStatus, - } - if tc.shouldFail { - apiClient.instanceError = &oapierror.GenericOpenAPIError{ - StatusCode: http.StatusInternalServerError, - } - } - handler := CreateOrUpdateInstanceByNameWaitHandler(context.Background(), apiClient, testProjectId, testRegion, testName) - err := executeHandlerAndGetError(handler) - checkError(t, err, tc.wantErr) - }) - }) - } -} - -func TestDeleteInstanceWaitHandler(t *testing.T) { - for _, tc := range deleteInstanceTests { - t.Run(tc.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := &mockApiClient{ - deleteErrors: tc.errorsToReturn, - } - handler := DeleteInstanceWaitHandler(context.Background(), apiClient, testProjectId, testRegion, testInstanceId) - err := executeHandlerAndGetError(handler) - checkError(t, err, tc.wantErr) - }) - }) - } -} - -func TestDeleteInstanceByNameWaitHandler(t *testing.T) { - for _, tc := range deleteInstanceTests { - t.Run(tc.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := &mockApiClient{ - deleteErrors: tc.errorsToReturn, - } - handler := DeleteInstanceByNameWaitHandler(context.Background(), apiClient, testProjectId, testRegion, testName) - err := executeHandlerAndGetError(handler) - checkError(t, err, tc.wantErr) - }) - }) - } -} - -func TestKubeconfigWaitHandler(t *testing.T) { - for _, tc := range kubeconfigOrTokenTests { - t.Run(tc.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := &mockApiClient{ - instanceStatus: tc.instanceStatus, - instanceError: tc.instanceError, - resourceErrors: tc.errorsToReturn, - mockShouldTimeout: tc.mockShouldTimeout, - } - handler := KubeconfigWaitHandler(context.Background(), apiClient, testProjectId, testRegion, testInstanceId, nil) - err := executeHandlerAndGetError(handler) - checkError(t, err, tc.wantErr) - }) - }) - } -} - -func TestKubeconfigByInstanceNameWaitHandler(t *testing.T) { - for _, tc := range kubeconfigOrTokenTests { - t.Run(tc.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := &mockApiClient{ - instanceStatus: tc.instanceStatus, - instanceError: tc.instanceError, - resourceErrors: tc.errorsToReturn, - mockShouldTimeout: tc.mockShouldTimeout, - } - handler := KubeconfigByInstanceNameWaitHandler(context.Background(), apiClient, testProjectId, testRegion, testName, nil) - err := executeHandlerAndGetError(handler) - checkError(t, err, tc.wantErr) - }) - }) - } -} - -func TestTokenWaitHandler(t *testing.T) { - for _, tc := range kubeconfigOrTokenTests { - t.Run(tc.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := &mockApiClient{ - instanceStatus: tc.instanceStatus, - instanceError: tc.instanceError, - resourceErrors: tc.errorsToReturn, - mockShouldTimeout: tc.mockShouldTimeout, - } - handler := TokenWaitHandler(context.Background(), apiClient, testProjectId, testRegion, testInstanceId, nil) - err := executeHandlerAndGetError(handler) - checkError(t, err, tc.wantErr) - }) - }) - } -} - -func TestTokenByInstanceNameWaitHandler(t *testing.T) { - for _, tc := range kubeconfigOrTokenTests { - t.Run(tc.desc, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - apiClient := &mockApiClient{ - instanceStatus: tc.instanceStatus, - instanceError: tc.instanceError, - resourceErrors: tc.errorsToReturn, - mockShouldTimeout: tc.mockShouldTimeout, - } - handler := TokenByInstanceNameWaitHandler(context.Background(), apiClient, testProjectId, testRegion, testName, nil) - err := executeHandlerAndGetError(handler) - checkError(t, err, tc.wantErr) - }) - }) - } -}