diff --git a/CHANGELOG.md b/CHANGELOG.md index 1811893725..dd8efc1a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -91,6 +91,10 @@ - `v1api`: - **Breaking Change:** Field `IsmJitter` in `InstanceParameters` model changed from *float32 to *float64 - **Deprecation:** The `v1api` is deprecated and is planned to retire on 1 October 2027. Use the regional v2 api. +- `logs`: + - [v0.11.0](services/logs/CHANGELOG.md#v0110) + - **Breaking change:** Removal of deprecated compatibility layer previously found in the root of the SDK module + - **Dependencies:** Bump STACKIT SDK core module from `v0.27.0` to `v0.27.1` - `lbiplists`: - [v0.1.0](services/lbiplists/CHANGELOG.md#v010) - **New**: Load Balancer IP Lists Service SDK diff --git a/examples/logs/go.mod b/examples/logs/go.mod index ce57461463..54c3e800dc 100644 --- a/examples/logs/go.mod +++ b/examples/logs/go.mod @@ -6,7 +6,7 @@ go 1.25 replace github.com/stackitcloud/stackit-sdk-go/services/logs => ../../services/logs require ( - github.com/stackitcloud/stackit-sdk-go/core v0.27.0 + github.com/stackitcloud/stackit-sdk-go/core v0.27.1 github.com/stackitcloud/stackit-sdk-go/services/logs v0.10.2 ) diff --git a/examples/logs/go.sum b/examples/logs/go.sum index 042f4a71a5..5bae1d1250 100644 --- a/examples/logs/go.sum +++ b/examples/logs/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/logs/.openapi-generator/VERSION b/services/logs/.openapi-generator/VERSION deleted file mode 100644 index cd802a1ec4..0000000000 --- a/services/logs/.openapi-generator/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.6.0 \ No newline at end of file diff --git a/services/logs/CHANGELOG.md b/services/logs/CHANGELOG.md index 03af8aafae..f27db25a47 100644 --- a/services/logs/CHANGELOG.md +++ b/services/logs/CHANGELOG.md @@ -1,3 +1,7 @@ +## v0.11.0 +- **Breaking change:** Removal of deprecated compatibility layer previously found in the root of the SDK module +- **Dependencies:** Bump STACKIT SDK core module from `v0.27.0` to `v0.27.1` + ## v0.10.2 - **Dependencies:** Bump STACKIT SDK core module from `v0.26.0` to `v0.27.0` diff --git a/services/logs/VERSION b/services/logs/VERSION index 3123ff93a6..e88c34ff01 100644 --- a/services/logs/VERSION +++ b/services/logs/VERSION @@ -1 +1 @@ -v0.10.2 +v0.11.0 \ No newline at end of file diff --git a/services/logs/api_default.go b/services/logs/api_default.go deleted file mode 100644 index a8de521fe1..0000000000 --- a/services/logs/api_default.go +++ /dev/null @@ -1,2155 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -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 { - /* - CreateAccessToken Create Access Token - Create a new Logs instance access 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiCreateAccessTokenRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest - /* - CreateAccessTokenExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return AccessToken - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - CreateAccessTokenExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*AccessToken, error) - /* - CreateLogsInstance Create Logs instance - Creates a new Logs 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @return ApiCreateLogsInstanceRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest - /* - CreateLogsInstanceExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @return LogsInstance - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - CreateLogsInstanceExecute(ctx context.Context, projectId string, regionId string) (*LogsInstance, error) - /* - DeleteAccessToken Delete Access Token - Deletes a Logs instance access 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @param tId The access token UUID. - @return ApiDeleteAccessTokenRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest - /* - DeleteAccessTokenExecute executes the request - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteAccessTokenExecute(ctx context.Context, projectId string, regionId string, instanceId string, tId string) error - /* - DeleteAllAccessTokens Delete All Access Tokens - Deletes all access tokens available for a Logs 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiDeleteAllAccessTokensRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest - /* - DeleteAllAccessTokensExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return AccessTokenList - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteAllAccessTokensExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*AccessTokenList, error) - /* - DeleteAllExpiredAccessTokens Deletes all expired access tokens - Deletes all expired access tokens - - @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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiDeleteAllExpiredAccessTokensRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest - /* - DeleteAllExpiredAccessTokensExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return AccessTokenList - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteAllExpiredAccessTokensExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*AccessTokenList, error) - /* - DeleteLogsInstance Delete Logs instance - Deletes the given Logs 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiDeleteLogsInstanceRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest - /* - DeleteLogsInstanceExecute executes the request - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - DeleteLogsInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error - /* - GetAccessToken Get Access Token - Get the information of the given access 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @param tId The access token UUID. - @return ApiGetAccessTokenRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest - /* - GetAccessTokenExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @param tId The access token UUID. - @return AccessToken - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetAccessTokenExecute(ctx context.Context, projectId string, regionId string, instanceId string, tId string) (*AccessToken, error) - /* - GetLogsInstance Get Logs Instance - Returns the details for the given Logs 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiGetLogsInstanceRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest - /* - GetLogsInstanceExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return LogsInstance - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - GetLogsInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*LogsInstance, error) - /* - ListAccessTokens List Access Tokens - Returns a list of access tokens created for a Logs 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiListAccessTokensRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest - /* - ListAccessTokensExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return AccessTokenList - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListAccessTokensExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*AccessTokenList, error) - /* - ListLogsInstances List Logs instances - Returns a list of all Logs 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @return ApiListLogsInstancesRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest - /* - ListLogsInstancesExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @return LogsInstancesList - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - ListLogsInstancesExecute(ctx context.Context, projectId string, regionId string) (*LogsInstancesList, error) - /* - UpdateAccessToken Update Access Token - Updates the given access 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @param tId The access token UUID. - @return ApiUpdateAccessTokenRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest - /* - UpdateAccessTokenExecute executes the request - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - UpdateAccessTokenExecute(ctx context.Context, projectId string, regionId string, instanceId string, tId string) error - /* - UpdateLogsInstance Update Logs instance - Updates the given Logs 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiUpdateLogsInstanceRequest - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest - /* - UpdateLogsInstanceExecute 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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return LogsInstance - - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - */ - UpdateLogsInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*LogsInstance, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiCreateAccessTokenRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - CreateAccessTokenPayload(createAccessTokenPayload CreateAccessTokenPayload) ApiCreateAccessTokenRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*AccessToken, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiCreateLogsInstanceRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - CreateLogsInstancePayload(createLogsInstancePayload CreateLogsInstancePayload) ApiCreateLogsInstanceRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*LogsInstance, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiDeleteAccessTokenRequest 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 ApiDeleteAllAccessTokensRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*AccessTokenList, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiDeleteAllExpiredAccessTokensRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*AccessTokenList, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiDeleteLogsInstanceRequest 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 ApiGetAccessTokenRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*AccessToken, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiGetLogsInstanceRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*LogsInstance, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiListAccessTokensRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*AccessTokenList, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiListLogsInstancesRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*LogsInstancesList, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type ApiUpdateAccessTokenRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - UpdateAccessTokenPayload(updateAccessTokenPayload UpdateAccessTokenPayload) ApiUpdateAccessTokenRequest - // 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 ApiUpdateLogsInstanceRequest interface { - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - UpdateLogsInstancePayload(updateLogsInstancePayload UpdateLogsInstancePayload) ApiUpdateLogsInstanceRequest - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - Execute() (*LogsInstance, 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 CreateAccessTokenRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string - createAccessTokenPayload *CreateAccessTokenPayload -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r CreateAccessTokenRequest) CreateAccessTokenPayload(createAccessTokenPayload CreateAccessTokenPayload) ApiCreateAccessTokenRequest { - r.createAccessTokenPayload = &createAccessTokenPayload - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r CreateAccessTokenRequest) Execute() (*AccessToken, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AccessToken - ) - 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.CreateAccessToken") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens" - 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 r.createAccessTokenPayload == nil { - return localVarReturnValue, fmt.Errorf("createAccessTokenPayload 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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createAccessTokenPayload - 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 string - 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 -} - -/* -CreateAccessToken: Create Access Token - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiCreateAccessTokenRequest -*/ -func (a *APIClient) CreateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string) ApiCreateAccessTokenRequest { - return CreateAccessTokenRequest{ - 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) CreateAccessTokenExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*AccessToken, error) { - r := CreateAccessTokenRequest{ - 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 CreateLogsInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - createLogsInstancePayload *CreateLogsInstancePayload -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r CreateLogsInstanceRequest) CreateLogsInstancePayload(createLogsInstancePayload CreateLogsInstancePayload) ApiCreateLogsInstanceRequest { - r.createLogsInstancePayload = &createLogsInstancePayload - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r CreateLogsInstanceRequest) Execute() (*LogsInstance, error) { - var ( - localVarHTTPMethod = http.MethodPost - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *LogsInstance - ) - 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.CreateLogsInstance") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/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.createLogsInstancePayload == nil { - return localVarReturnValue, fmt.Errorf("createLogsInstancePayload 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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.createLogsInstancePayload - 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 string - 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 -} - -/* -CreateLogsInstance: Create Logs instance - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @return ApiCreateLogsInstanceRequest -*/ -func (a *APIClient) CreateLogsInstance(ctx context.Context, projectId string, regionId string) ApiCreateLogsInstanceRequest { - return CreateLogsInstanceRequest{ - 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) CreateLogsInstanceExecute(ctx context.Context, projectId string, regionId string) (*LogsInstance, error) { - r := CreateLogsInstanceRequest{ - 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 DeleteAccessTokenRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string - tId string -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r DeleteAccessTokenRequest) 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.DeleteAccessToken") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/{tId}" - 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) - localVarPath = strings.Replace(localVarPath, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(r.tId, "tId")), -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{"text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return 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 == 401 { - var v string - 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 -} - -/* -DeleteAccessToken: Delete Access Token - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @param tId The access token UUID. - @return ApiDeleteAccessTokenRequest -*/ -func (a *APIClient) DeleteAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiDeleteAccessTokenRequest { - return DeleteAccessTokenRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - tId: tId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) DeleteAccessTokenExecute(ctx context.Context, projectId string, regionId string, instanceId string, tId string) error { - r := DeleteAccessTokenRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - tId: tId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type DeleteAllAccessTokensRequest 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 DeleteAllAccessTokensRequest) Execute() (*AccessTokenList, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AccessTokenList - ) - 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.DeleteAllAccessTokens") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens" - 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{} - - // 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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - 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 -} - -/* -DeleteAllAccessTokens: Delete All Access Tokens - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiDeleteAllAccessTokensRequest -*/ -func (a *APIClient) DeleteAllAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllAccessTokensRequest { - return DeleteAllAccessTokensRequest{ - 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) DeleteAllAccessTokensExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*AccessTokenList, error) { - r := DeleteAllAccessTokensRequest{ - 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 DeleteAllExpiredAccessTokensRequest 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 DeleteAllExpiredAccessTokensRequest) Execute() (*AccessTokenList, error) { - var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AccessTokenList - ) - 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.DeleteAllExpiredAccessTokens") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/expired" - 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{} - - // 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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - 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 -} - -/* -DeleteAllExpiredAccessTokens: Deletes all expired access tokens - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiDeleteAllExpiredAccessTokensRequest -*/ -func (a *APIClient) DeleteAllExpiredAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteAllExpiredAccessTokensRequest { - return DeleteAllExpiredAccessTokensRequest{ - 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) DeleteAllExpiredAccessTokensExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*AccessTokenList, error) { - r := DeleteAllExpiredAccessTokensRequest{ - 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 DeleteLogsInstanceRequest 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 DeleteLogsInstanceRequest) 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.DeleteLogsInstance") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/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{} - - // 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{"text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return 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 == 401 { - var v string - 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 -} - -/* -DeleteLogsInstance: Delete Logs instance - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiDeleteLogsInstanceRequest -*/ -func (a *APIClient) DeleteLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiDeleteLogsInstanceRequest { - return DeleteLogsInstanceRequest{ - 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) DeleteLogsInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) error { - r := DeleteLogsInstanceRequest{ - 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 GetAccessTokenRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string - tId string -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r GetAccessTokenRequest) Execute() (*AccessToken, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AccessToken - ) - 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.GetAccessToken") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/{tId}" - 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) - localVarPath = strings.Replace(localVarPath, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(r.tId, "tId")), -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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - 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 -} - -/* -GetAccessToken: Get Access Token - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @param tId The access token UUID. - @return ApiGetAccessTokenRequest -*/ -func (a *APIClient) GetAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiGetAccessTokenRequest { - return GetAccessTokenRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - tId: tId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) GetAccessTokenExecute(ctx context.Context, projectId string, regionId string, instanceId string, tId string) (*AccessToken, error) { - r := GetAccessTokenRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - tId: tId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type GetLogsInstanceRequest 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 GetLogsInstanceRequest) Execute() (*LogsInstance, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *LogsInstance - ) - 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.GetLogsInstance") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/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{} - - // 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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - 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 -} - -/* -GetLogsInstance: Get Logs Instance - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiGetLogsInstanceRequest -*/ -func (a *APIClient) GetLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiGetLogsInstanceRequest { - return GetLogsInstanceRequest{ - 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) GetLogsInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*LogsInstance, error) { - r := GetLogsInstanceRequest{ - 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 ListAccessTokensRequest 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 ListAccessTokensRequest) Execute() (*AccessTokenList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *AccessTokenList - ) - 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.ListAccessTokens") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens" - 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{} - - // 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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - 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 -} - -/* -ListAccessTokens: List Access Tokens - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiListAccessTokensRequest -*/ -func (a *APIClient) ListAccessTokens(ctx context.Context, projectId string, regionId string, instanceId string) ApiListAccessTokensRequest { - return ListAccessTokensRequest{ - 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) ListAccessTokensExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*AccessTokenList, error) { - r := ListAccessTokensRequest{ - 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 ListLogsInstancesRequest 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 ListLogsInstancesRequest) Execute() (*LogsInstancesList, error) { - var ( - localVarHTTPMethod = http.MethodGet - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *LogsInstancesList - ) - 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.ListLogsInstances") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) - if err != nil { - return localVarReturnValue, err - } - - contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) - if ok { - *contextHTTPRequest = req - } - - localVarHTTPResponse, err := client.callAPI(req) - contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) - if ok { - *contextHTTPResponse = localVarHTTPResponse - } - if err != nil || localVarHTTPResponse == nil { - return localVarReturnValue, err - } - - localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) - localVarHTTPResponse.Body.Close() - localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) - if err != nil { - return localVarReturnValue, err - } - - if localVarHTTPResponse.StatusCode >= 300 { - newErr := &oapierror.GenericOpenAPIError{ - StatusCode: localVarHTTPResponse.StatusCode, - Body: localVarBody, - ErrorMessage: localVarHTTPResponse.Status, - } - if localVarHTTPResponse.StatusCode == 401 { - var v string - 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 -} - -/* -ListLogsInstances: List Logs instances - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @return ApiListLogsInstancesRequest -*/ -func (a *APIClient) ListLogsInstances(ctx context.Context, projectId string, regionId string) ApiListLogsInstancesRequest { - return ListLogsInstancesRequest{ - 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) ListLogsInstancesExecute(ctx context.Context, projectId string, regionId string) (*LogsInstancesList, error) { - r := ListLogsInstancesRequest{ - 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 UpdateAccessTokenRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string - tId string - updateAccessTokenPayload *UpdateAccessTokenPayload -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateAccessTokenRequest) UpdateAccessTokenPayload(updateAccessTokenPayload UpdateAccessTokenPayload) ApiUpdateAccessTokenRequest { - r.updateAccessTokenPayload = &updateAccessTokenPayload - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateAccessTokenRequest) 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.UpdateAccessToken") - if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/projects/{projectId}/regions/{regionId}/instances/{instanceId}/access-tokens/{tId}" - 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) - localVarPath = strings.Replace(localVarPath, "{"+"tId"+"}", url.PathEscape(ParameterValueToString(r.tId, "tId")), -1) - - localVarHeaderParams := make(map[string]string) - localVarQueryParams := url.Values{} - localVarFormParams := url.Values{} - if r.updateAccessTokenPayload == nil { - return fmt.Errorf("updateAccessTokenPayload 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{"text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateAccessTokenPayload - 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 == 401 { - var v string - 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 -} - -/* -UpdateAccessToken: Update Access Token - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @param tId The access token UUID. - @return ApiUpdateAccessTokenRequest -*/ -func (a *APIClient) UpdateAccessToken(ctx context.Context, projectId string, regionId string, instanceId string, tId string) ApiUpdateAccessTokenRequest { - return UpdateAccessTokenRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - tId: tId, - } -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (a *APIClient) UpdateAccessTokenExecute(ctx context.Context, projectId string, regionId string, instanceId string, tId string) error { - r := UpdateAccessTokenRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - tId: tId, - } - return r.Execute() -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - regionId string - instanceId string - updateLogsInstancePayload *UpdateLogsInstancePayload -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateLogsInstanceRequest) UpdateLogsInstancePayload(updateLogsInstancePayload UpdateLogsInstancePayload) ApiUpdateLogsInstanceRequest { - r.updateLogsInstancePayload = &updateLogsInstancePayload - return r -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (r UpdateLogsInstanceRequest) Execute() (*LogsInstance, error) { - var ( - localVarHTTPMethod = http.MethodPut - localVarPostBody interface{} - formFiles []formFile - localVarReturnValue *LogsInstance - ) - 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.UpdateLogsInstance") - if err != nil { - return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} - } - - localVarPath := localBasePath + "/v1/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 r.updateLogsInstancePayload == nil { - return localVarReturnValue, fmt.Errorf("updateLogsInstancePayload 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", "text/plain"} - - // set Accept header - localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) - if localVarHTTPHeaderAccept != "" { - localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept - } - // body params - localVarPostBody = r.updateLogsInstancePayload - 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 string - 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 -} - -/* -UpdateLogsInstance: Update Logs instance - -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 resource is located in. - @param regionId The STACKIT region name the resource is located in. - @param instanceId The Logs Instance UUID. - @return ApiUpdateLogsInstanceRequest -*/ -func (a *APIClient) UpdateLogsInstance(ctx context.Context, projectId string, regionId string, instanceId string) ApiUpdateLogsInstanceRequest { - return UpdateLogsInstanceRequest{ - 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) UpdateLogsInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*LogsInstance, error) { - r := UpdateLogsInstanceRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, - regionId: regionId, - instanceId: instanceId, - } - return r.Execute() -} diff --git a/services/logs/client.go b/services/logs/client.go deleted file mode 100644 index 08f26c7d1f..0000000000 --- a/services/logs/client.go +++ /dev/null @@ -1,635 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -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 Logs API API v1.0.0 -// In most cases there should be only one, shared, APIClient. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type APIClient struct { - cfg *config.Configuration - common service // Reuse a single struct instead of allocating one for each service on the heap. - defaultApi *DefaultApiService -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type service struct { - client DefaultApi -} - -// NewAPIClient creates a new API client. -// Optionally receives configuration options -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { - cfg := NewConfiguration() - - 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/logs/configuration.go b/services/logs/configuration.go deleted file mode 100644 index 0213c4d3c0..0000000000 --- a/services/logs/configuration.go +++ /dev/null @@ -1,40 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -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/logs", - Debug: false, - Servers: config.ServerConfigurations{ - { - URL: "https://logs.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/logs/go.mod b/services/logs/go.mod index 0ba57359ae..55a46db29c 100644 --- a/services/logs/go.mod +++ b/services/logs/go.mod @@ -5,7 +5,7 @@ go 1.25 require ( github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.27.0 + 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/logs/go.sum b/services/logs/go.sum index 042f4a71a5..5bae1d1250 100644 --- a/services/logs/go.sum +++ b/services/logs/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/logs/model_access_token.go b/services/logs/model_access_token.go deleted file mode 100644 index 640fdc04ea..0000000000 --- a/services/logs/model_access_token.go +++ /dev/null @@ -1,718 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the AccessToken type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AccessToken{} - -/* - types and functions for accessToken -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetAccessTokenAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenGetAccessTokenAttributeTypeOk(arg AccessTokenGetAccessTokenAttributeType) (ret AccessTokenGetAccessTokenRetType, 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 setAccessTokenGetAccessTokenAttributeType(arg *AccessTokenGetAccessTokenAttributeType, val AccessTokenGetAccessTokenRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetAccessTokenArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetAccessTokenRetType = string - -/* - types and functions for creator -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetCreatorAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenGetCreatorAttributeTypeOk(arg AccessTokenGetCreatorAttributeType) (ret AccessTokenGetCreatorRetType, 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 setAccessTokenGetCreatorAttributeType(arg *AccessTokenGetCreatorAttributeType, val AccessTokenGetCreatorRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetCreatorArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetCreatorRetType = string - -/* - 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 AccessTokenGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenGetDescriptionAttributeTypeOk(arg AccessTokenGetDescriptionAttributeType) (ret AccessTokenGetDescriptionRetType, 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 setAccessTokenGetDescriptionAttributeType(arg *AccessTokenGetDescriptionAttributeType, val AccessTokenGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetDescriptionRetType = 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 AccessTokenGetDisplayNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenGetDisplayNameAttributeTypeOk(arg AccessTokenGetDisplayNameAttributeType) (ret AccessTokenGetDisplayNameRetType, 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 setAccessTokenGetDisplayNameAttributeType(arg *AccessTokenGetDisplayNameAttributeType, val AccessTokenGetDisplayNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetDisplayNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetDisplayNameRetType = string - -/* - types and functions for expires -*/ - -// isBoolean -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokengetExpiresAttributeType = *bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokengetExpiresArgType = bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokengetExpiresRetType = bool - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokengetExpiresAttributeTypeOk(arg AccessTokengetExpiresAttributeType) (ret AccessTokengetExpiresRetType, 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 setAccessTokengetExpiresAttributeType(arg *AccessTokengetExpiresAttributeType, val AccessTokengetExpiresRetType) { - *arg = &val -} - -/* - types and functions for id -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenGetIdAttributeTypeOk(arg AccessTokenGetIdAttributeType) (ret AccessTokenGetIdRetType, 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 setAccessTokenGetIdAttributeType(arg *AccessTokenGetIdAttributeType, val AccessTokenGetIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetIdRetType = string - -/* - types and functions for permissions -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetPermissionsAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetPermissionsArgType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetPermissionsRetType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenGetPermissionsAttributeTypeOk(arg AccessTokenGetPermissionsAttributeType) (ret AccessTokenGetPermissionsRetType, 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 setAccessTokenGetPermissionsAttributeType(arg *AccessTokenGetPermissionsAttributeType, val AccessTokenGetPermissionsRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isEnum - -// AccessTokenStatus the model 'AccessToken' -// value type for enums -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenStatus string - -// List of Status -const ( - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - ACCESSTOKENSTATUS_ACTIVE AccessTokenStatus = "active" - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - ACCESSTOKENSTATUS_EXPIRED AccessTokenStatus = "expired" -) - -// All allowed values of AccessToken enum -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -var AllowedAccessTokenStatusEnumValues = []AccessTokenStatus{ - "active", - "expired", -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *AccessTokenStatus) 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 AccessTokenStatus - 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 := AccessTokenStatus(value) - for _, existing := range AllowedAccessTokenStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid AccessToken", value) -} - -// NewAccessTokenStatusFromValue returns a pointer to a valid AccessTokenStatus -// 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 NewAccessTokenStatusFromValue(v AccessTokenStatus) (*AccessTokenStatus, error) { - ev := AccessTokenStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for AccessTokenStatus: valid values are %v", v, AllowedAccessTokenStatusEnumValues) - } -} - -// 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 AccessTokenStatus) IsValid() bool { - for _, existing := range AllowedAccessTokenStatusEnumValues { - 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 AccessTokenStatus) Ptr() *AccessTokenStatus { - return &v -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableAccessTokenStatus struct { - value *AccessTokenStatus - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableAccessTokenStatus) Get() *AccessTokenStatus { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableAccessTokenStatus) Set(val *AccessTokenStatus) { - 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 NullableAccessTokenStatus) 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 *NullableAccessTokenStatus) 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 NewNullableAccessTokenStatus(val *AccessTokenStatus) *NullableAccessTokenStatus { - return &NullableAccessTokenStatus{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 NullableAccessTokenStatus) 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 *NullableAccessTokenStatus) 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 AccessTokenGetStatusAttributeType = *AccessTokenStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetStatusArgType = AccessTokenStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetStatusRetType = AccessTokenStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenGetStatusAttributeTypeOk(arg AccessTokenGetStatusAttributeType) (ret AccessTokenGetStatusRetType, 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 setAccessTokenGetStatusAttributeType(arg *AccessTokenGetStatusAttributeType, val AccessTokenGetStatusRetType) { - *arg = &val -} - -/* - types and functions for validUntil -*/ - -// isDateTime -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetValidUntilAttributeType = *time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetValidUntilArgType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenGetValidUntilRetType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenGetValidUntilAttributeTypeOk(arg AccessTokenGetValidUntilAttributeType) (ret AccessTokenGetValidUntilRetType, 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 setAccessTokenGetValidUntilAttributeType(arg *AccessTokenGetValidUntilAttributeType, val AccessTokenGetValidUntilRetType) { - *arg = &val -} - -// AccessToken struct for AccessToken -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessToken struct { - // A generated access token. Only available on creation. - AccessToken AccessTokenGetAccessTokenAttributeType `json:"accessToken,omitempty"` - // The user who created the access token. - // REQUIRED - Creator AccessTokenGetCreatorAttributeType `json:"creator" required:"true"` - // The description of the access token. - Description AccessTokenGetDescriptionAttributeType `json:"description,omitempty"` - // The displayed name of the access token. - // REQUIRED - DisplayName AccessTokenGetDisplayNameAttributeType `json:"displayName" required:"true"` - // Indicates if the access token can expire. - // REQUIRED - Expires AccessTokengetExpiresAttributeType `json:"expires" required:"true"` - // An auto generated unique id which identifies the access token. - // REQUIRED - Id AccessTokenGetIdAttributeType `json:"id" required:"true"` - // The access permissions granted to the access token. - // REQUIRED - Permissions AccessTokenGetPermissionsAttributeType `json:"permissions" required:"true"` - // REQUIRED - Status AccessTokenGetStatusAttributeType `json:"status" required:"true"` - // The date and time util an access token is valid to (inclusively). - ValidUntil AccessTokenGetValidUntilAttributeType `json:"validUntil,omitempty"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _AccessToken AccessToken - -// NewAccessToken instantiates a new AccessToken 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 NewAccessToken(creator AccessTokenGetCreatorArgType, displayName AccessTokenGetDisplayNameArgType, expires AccessTokengetExpiresArgType, id AccessTokenGetIdArgType, permissions AccessTokenGetPermissionsArgType, status AccessTokenGetStatusArgType) *AccessToken { - this := AccessToken{} - setAccessTokenGetCreatorAttributeType(&this.Creator, creator) - setAccessTokenGetDisplayNameAttributeType(&this.DisplayName, displayName) - setAccessTokengetExpiresAttributeType(&this.Expires, expires) - setAccessTokenGetIdAttributeType(&this.Id, id) - setAccessTokenGetPermissionsAttributeType(&this.Permissions, permissions) - setAccessTokenGetStatusAttributeType(&this.Status, status) - return &this -} - -// NewAccessTokenWithDefaults instantiates a new AccessToken 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 NewAccessTokenWithDefaults() *AccessToken { - this := AccessToken{} - return &this -} - -// GetAccessToken returns the AccessToken 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 *AccessToken) GetAccessToken() (res AccessTokenGetAccessTokenRetType) { - res, _ = o.GetAccessTokenOk() - return -} - -// GetAccessTokenOk returns a tuple with the AccessToken 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 *AccessToken) GetAccessTokenOk() (ret AccessTokenGetAccessTokenRetType, ok bool) { - return getAccessTokenGetAccessTokenAttributeTypeOk(o.AccessToken) -} - -// HasAccessToken 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 *AccessToken) HasAccessToken() bool { - _, ok := o.GetAccessTokenOk() - return ok -} - -// SetAccessToken gets a reference to the given string and assigns it to the AccessToken field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessToken) SetAccessToken(v AccessTokenGetAccessTokenRetType) { - setAccessTokenGetAccessTokenAttributeType(&o.AccessToken, v) -} - -// GetCreator returns the Creator field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessToken) GetCreator() (ret AccessTokenGetCreatorRetType) { - ret, _ = o.GetCreatorOk() - return ret -} - -// GetCreatorOk returns a tuple with the Creator 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 *AccessToken) GetCreatorOk() (ret AccessTokenGetCreatorRetType, ok bool) { - return getAccessTokenGetCreatorAttributeTypeOk(o.Creator) -} - -// SetCreator sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessToken) SetCreator(v AccessTokenGetCreatorRetType) { - setAccessTokenGetCreatorAttributeType(&o.Creator, 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 *AccessToken) GetDescription() (res AccessTokenGetDescriptionRetType) { - 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 *AccessToken) GetDescriptionOk() (ret AccessTokenGetDescriptionRetType, ok bool) { - return getAccessTokenGetDescriptionAttributeTypeOk(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 *AccessToken) 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 *AccessToken) SetDescription(v AccessTokenGetDescriptionRetType) { - setAccessTokenGetDescriptionAttributeType(&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 *AccessToken) GetDisplayName() (ret AccessTokenGetDisplayNameRetType) { - 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 *AccessToken) GetDisplayNameOk() (ret AccessTokenGetDisplayNameRetType, ok bool) { - return getAccessTokenGetDisplayNameAttributeTypeOk(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 *AccessToken) SetDisplayName(v AccessTokenGetDisplayNameRetType) { - setAccessTokenGetDisplayNameAttributeType(&o.DisplayName, v) -} - -// GetExpires returns the Expires field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessToken) GetExpires() (ret AccessTokengetExpiresRetType) { - ret, _ = o.GetExpiresOk() - return ret -} - -// GetExpiresOk returns a tuple with the Expires 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 *AccessToken) GetExpiresOk() (ret AccessTokengetExpiresRetType, ok bool) { - return getAccessTokengetExpiresAttributeTypeOk(o.Expires) -} - -// SetExpires sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessToken) SetExpires(v AccessTokengetExpiresRetType) { - setAccessTokengetExpiresAttributeType(&o.Expires, 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 *AccessToken) GetId() (ret AccessTokenGetIdRetType) { - 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 *AccessToken) GetIdOk() (ret AccessTokenGetIdRetType, ok bool) { - return getAccessTokenGetIdAttributeTypeOk(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 *AccessToken) SetId(v AccessTokenGetIdRetType) { - setAccessTokenGetIdAttributeType(&o.Id, v) -} - -// GetPermissions returns the Permissions field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessToken) GetPermissions() (ret AccessTokenGetPermissionsRetType) { - ret, _ = o.GetPermissionsOk() - return ret -} - -// GetPermissionsOk returns a tuple with the Permissions 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 *AccessToken) GetPermissionsOk() (ret AccessTokenGetPermissionsRetType, ok bool) { - return getAccessTokenGetPermissionsAttributeTypeOk(o.Permissions) -} - -// SetPermissions sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessToken) SetPermissions(v AccessTokenGetPermissionsRetType) { - setAccessTokenGetPermissionsAttributeType(&o.Permissions, 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 *AccessToken) GetStatus() (ret AccessTokenGetStatusRetType) { - 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 *AccessToken) GetStatusOk() (ret AccessTokenGetStatusRetType, ok bool) { - return getAccessTokenGetStatusAttributeTypeOk(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 *AccessToken) SetStatus(v AccessTokenGetStatusRetType) { - setAccessTokenGetStatusAttributeType(&o.Status, v) -} - -// GetValidUntil returns the ValidUntil 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 *AccessToken) GetValidUntil() (res AccessTokenGetValidUntilRetType) { - res, _ = o.GetValidUntilOk() - return -} - -// GetValidUntilOk returns a tuple with the ValidUntil 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 *AccessToken) GetValidUntilOk() (ret AccessTokenGetValidUntilRetType, ok bool) { - return getAccessTokenGetValidUntilAttributeTypeOk(o.ValidUntil) -} - -// HasValidUntil 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 *AccessToken) HasValidUntil() bool { - _, ok := o.GetValidUntilOk() - return ok -} - -// SetValidUntil gets a reference to the given time.Time and assigns it to the ValidUntil field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessToken) SetValidUntil(v AccessTokenGetValidUntilRetType) { - setAccessTokenGetValidUntilAttributeType(&o.ValidUntil, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o AccessToken) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAccessTokenGetAccessTokenAttributeTypeOk(o.AccessToken); ok { - toSerialize["AccessToken"] = val - } - if val, ok := getAccessTokenGetCreatorAttributeTypeOk(o.Creator); ok { - toSerialize["Creator"] = val - } - if val, ok := getAccessTokenGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getAccessTokenGetDisplayNameAttributeTypeOk(o.DisplayName); ok { - toSerialize["DisplayName"] = val - } - if val, ok := getAccessTokengetExpiresAttributeTypeOk(o.Expires); ok { - toSerialize["Expires"] = val - } - if val, ok := getAccessTokenGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getAccessTokenGetPermissionsAttributeTypeOk(o.Permissions); ok { - toSerialize["Permissions"] = val - } - if val, ok := getAccessTokenGetStatusAttributeTypeOk(o.Status); ok { - toSerialize["Status"] = val - } - if val, ok := getAccessTokenGetValidUntilAttributeTypeOk(o.ValidUntil); ok { - toSerialize["ValidUntil"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableAccessToken struct { - value *AccessToken - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableAccessToken) Get() *AccessToken { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableAccessToken) Set(val *AccessToken) { - 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 NullableAccessToken) 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 *NullableAccessToken) 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 NewNullableAccessToken(val *AccessToken) *NullableAccessToken { - return &NullableAccessToken{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 NullableAccessToken) 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 *NullableAccessToken) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/logs/model_access_token_list.go b/services/logs/model_access_token_list.go deleted file mode 100644 index 09559d7c53..0000000000 --- a/services/logs/model_access_token_list.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -import ( - "encoding/json" -) - -// checks if the AccessTokenList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &AccessTokenList{} - -/* - types and functions for tokens -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenListGetTokensAttributeType = *[]AccessToken - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenListGetTokensArgType = []AccessToken - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenListGetTokensRetType = []AccessToken - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getAccessTokenListGetTokensAttributeTypeOk(arg AccessTokenListGetTokensAttributeType) (ret AccessTokenListGetTokensRetType, 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 setAccessTokenListGetTokensAttributeType(arg *AccessTokenListGetTokensAttributeType, val AccessTokenListGetTokensRetType) { - *arg = &val -} - -// AccessTokenList struct for AccessTokenList -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type AccessTokenList struct { - // REQUIRED - Tokens AccessTokenListGetTokensAttributeType `json:"tokens" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _AccessTokenList AccessTokenList - -// NewAccessTokenList instantiates a new AccessTokenList 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 NewAccessTokenList(tokens AccessTokenListGetTokensArgType) *AccessTokenList { - this := AccessTokenList{} - setAccessTokenListGetTokensAttributeType(&this.Tokens, tokens) - return &this -} - -// NewAccessTokenListWithDefaults instantiates a new AccessTokenList 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 NewAccessTokenListWithDefaults() *AccessTokenList { - this := AccessTokenList{} - return &this -} - -// GetTokens returns the Tokens field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessTokenList) GetTokens() (ret AccessTokenListGetTokensRetType) { - ret, _ = o.GetTokensOk() - return ret -} - -// GetTokensOk returns a tuple with the Tokens 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 *AccessTokenList) GetTokensOk() (ret AccessTokenListGetTokensRetType, ok bool) { - return getAccessTokenListGetTokensAttributeTypeOk(o.Tokens) -} - -// SetTokens sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *AccessTokenList) SetTokens(v AccessTokenListGetTokensRetType) { - setAccessTokenListGetTokensAttributeType(&o.Tokens, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o AccessTokenList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getAccessTokenListGetTokensAttributeTypeOk(o.Tokens); ok { - toSerialize["Tokens"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableAccessTokenList struct { - value *AccessTokenList - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableAccessTokenList) Get() *AccessTokenList { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableAccessTokenList) Set(val *AccessTokenList) { - 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 NullableAccessTokenList) 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 *NullableAccessTokenList) 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 NewNullableAccessTokenList(val *AccessTokenList) *NullableAccessTokenList { - return &NullableAccessTokenList{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 NullableAccessTokenList) 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 *NullableAccessTokenList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/logs/model_access_token_list_test.go b/services/logs/model_access_token_list_test.go deleted file mode 100644 index 81ac6fa6a1..0000000000 --- a/services/logs/model_access_token_list_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs diff --git a/services/logs/model_access_token_test.go b/services/logs/model_access_token_test.go deleted file mode 100644 index e32c0d8d8a..0000000000 --- a/services/logs/model_access_token_test.go +++ /dev/null @@ -1,58 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs - -import ( - "testing" -) - -// isEnum - -func TestAccessTokenStatus_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(`"active"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 2`, - args: args{ - src: []byte(`"expired"`), - }, - wantErr: false, - }, - { - name: "fail", - args: args{ - src: []byte("\"FOOBAR\""), - }, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := AccessTokenStatus("") - 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/logs/model_create_access_token_payload.go b/services/logs/model_create_access_token_payload.go deleted file mode 100644 index c97370d1ff..0000000000 --- a/services/logs/model_create_access_token_payload.go +++ /dev/null @@ -1,323 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -import ( - "encoding/json" -) - -// checks if the CreateAccessTokenPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateAccessTokenPayload{} - -/* - 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 CreateAccessTokenPayloadGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateAccessTokenPayloadGetDescriptionAttributeTypeOk(arg CreateAccessTokenPayloadGetDescriptionAttributeType) (ret CreateAccessTokenPayloadGetDescriptionRetType, 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 setCreateAccessTokenPayloadGetDescriptionAttributeType(arg *CreateAccessTokenPayloadGetDescriptionAttributeType, val CreateAccessTokenPayloadGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetDescriptionRetType = 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 CreateAccessTokenPayloadGetDisplayNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateAccessTokenPayloadGetDisplayNameAttributeTypeOk(arg CreateAccessTokenPayloadGetDisplayNameAttributeType) (ret CreateAccessTokenPayloadGetDisplayNameRetType, 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 setCreateAccessTokenPayloadGetDisplayNameAttributeType(arg *CreateAccessTokenPayloadGetDisplayNameAttributeType, val CreateAccessTokenPayloadGetDisplayNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetDisplayNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetDisplayNameRetType = string - -/* - types and functions for lifetime -*/ - -// isInteger -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetLifetimeAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetLifetimeArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetLifetimeRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateAccessTokenPayloadGetLifetimeAttributeTypeOk(arg CreateAccessTokenPayloadGetLifetimeAttributeType) (ret CreateAccessTokenPayloadGetLifetimeRetType, 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 setCreateAccessTokenPayloadGetLifetimeAttributeType(arg *CreateAccessTokenPayloadGetLifetimeAttributeType, val CreateAccessTokenPayloadGetLifetimeRetType) { - *arg = &val -} - -/* - types and functions for permissions -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetPermissionsAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetPermissionsArgType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayloadGetPermissionsRetType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateAccessTokenPayloadGetPermissionsAttributeTypeOk(arg CreateAccessTokenPayloadGetPermissionsAttributeType) (ret CreateAccessTokenPayloadGetPermissionsRetType, 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 setCreateAccessTokenPayloadGetPermissionsAttributeType(arg *CreateAccessTokenPayloadGetPermissionsAttributeType, val CreateAccessTokenPayloadGetPermissionsRetType) { - *arg = &val -} - -// CreateAccessTokenPayload struct for CreateAccessTokenPayload -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateAccessTokenPayload struct { - // The description of the access token. - Description CreateAccessTokenPayloadGetDescriptionAttributeType `json:"description,omitempty"` - // The displayed name of the access token. - // REQUIRED - DisplayName CreateAccessTokenPayloadGetDisplayNameAttributeType `json:"displayName" required:"true"` - // A lifetime period for an access token in days. If unset the token will not expire. - // Can be cast to int32 without loss of precision. - Lifetime CreateAccessTokenPayloadGetLifetimeAttributeType `json:"lifetime,omitempty"` - // The access permissions granted to the access token. - // REQUIRED - Permissions CreateAccessTokenPayloadGetPermissionsAttributeType `json:"permissions" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _CreateAccessTokenPayload CreateAccessTokenPayload - -// NewCreateAccessTokenPayload instantiates a new CreateAccessTokenPayload 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 NewCreateAccessTokenPayload(displayName CreateAccessTokenPayloadGetDisplayNameArgType, permissions CreateAccessTokenPayloadGetPermissionsArgType) *CreateAccessTokenPayload { - this := CreateAccessTokenPayload{} - setCreateAccessTokenPayloadGetDisplayNameAttributeType(&this.DisplayName, displayName) - setCreateAccessTokenPayloadGetPermissionsAttributeType(&this.Permissions, permissions) - return &this -} - -// NewCreateAccessTokenPayloadWithDefaults instantiates a new CreateAccessTokenPayload 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 NewCreateAccessTokenPayloadWithDefaults() *CreateAccessTokenPayload { - this := CreateAccessTokenPayload{} - 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 *CreateAccessTokenPayload) GetDescription() (res CreateAccessTokenPayloadGetDescriptionRetType) { - 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 *CreateAccessTokenPayload) GetDescriptionOk() (ret CreateAccessTokenPayloadGetDescriptionRetType, ok bool) { - return getCreateAccessTokenPayloadGetDescriptionAttributeTypeOk(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 *CreateAccessTokenPayload) 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 *CreateAccessTokenPayload) SetDescription(v CreateAccessTokenPayloadGetDescriptionRetType) { - setCreateAccessTokenPayloadGetDescriptionAttributeType(&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 *CreateAccessTokenPayload) GetDisplayName() (ret CreateAccessTokenPayloadGetDisplayNameRetType) { - 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 *CreateAccessTokenPayload) GetDisplayNameOk() (ret CreateAccessTokenPayloadGetDisplayNameRetType, ok bool) { - return getCreateAccessTokenPayloadGetDisplayNameAttributeTypeOk(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 *CreateAccessTokenPayload) SetDisplayName(v CreateAccessTokenPayloadGetDisplayNameRetType) { - setCreateAccessTokenPayloadGetDisplayNameAttributeType(&o.DisplayName, v) -} - -// GetLifetime returns the Lifetime 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 *CreateAccessTokenPayload) GetLifetime() (res CreateAccessTokenPayloadGetLifetimeRetType) { - res, _ = o.GetLifetimeOk() - return -} - -// GetLifetimeOk returns a tuple with the Lifetime 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 *CreateAccessTokenPayload) GetLifetimeOk() (ret CreateAccessTokenPayloadGetLifetimeRetType, ok bool) { - return getCreateAccessTokenPayloadGetLifetimeAttributeTypeOk(o.Lifetime) -} - -// HasLifetime 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 *CreateAccessTokenPayload) HasLifetime() bool { - _, ok := o.GetLifetimeOk() - return ok -} - -// SetLifetime gets a reference to the given int64 and assigns it to the Lifetime field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateAccessTokenPayload) SetLifetime(v CreateAccessTokenPayloadGetLifetimeRetType) { - setCreateAccessTokenPayloadGetLifetimeAttributeType(&o.Lifetime, v) -} - -// GetPermissions returns the Permissions field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateAccessTokenPayload) GetPermissions() (ret CreateAccessTokenPayloadGetPermissionsRetType) { - ret, _ = o.GetPermissionsOk() - return ret -} - -// GetPermissionsOk returns a tuple with the Permissions 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 *CreateAccessTokenPayload) GetPermissionsOk() (ret CreateAccessTokenPayloadGetPermissionsRetType, ok bool) { - return getCreateAccessTokenPayloadGetPermissionsAttributeTypeOk(o.Permissions) -} - -// SetPermissions sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateAccessTokenPayload) SetPermissions(v CreateAccessTokenPayloadGetPermissionsRetType) { - setCreateAccessTokenPayloadGetPermissionsAttributeType(&o.Permissions, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o CreateAccessTokenPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateAccessTokenPayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getCreateAccessTokenPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { - toSerialize["DisplayName"] = val - } - if val, ok := getCreateAccessTokenPayloadGetLifetimeAttributeTypeOk(o.Lifetime); ok { - toSerialize["Lifetime"] = val - } - if val, ok := getCreateAccessTokenPayloadGetPermissionsAttributeTypeOk(o.Permissions); ok { - toSerialize["Permissions"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableCreateAccessTokenPayload struct { - value *CreateAccessTokenPayload - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableCreateAccessTokenPayload) Get() *CreateAccessTokenPayload { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableCreateAccessTokenPayload) Set(val *CreateAccessTokenPayload) { - 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 NullableCreateAccessTokenPayload) 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 *NullableCreateAccessTokenPayload) 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 NewNullableCreateAccessTokenPayload(val *CreateAccessTokenPayload) *NullableCreateAccessTokenPayload { - return &NullableCreateAccessTokenPayload{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 NullableCreateAccessTokenPayload) 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 *NullableCreateAccessTokenPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/logs/model_create_access_token_payload_test.go b/services/logs/model_create_access_token_payload_test.go deleted file mode 100644 index 81ac6fa6a1..0000000000 --- a/services/logs/model_create_access_token_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs diff --git a/services/logs/model_create_logs_instance_payload.go b/services/logs/model_create_logs_instance_payload.go deleted file mode 100644 index bdc269fafb..0000000000 --- a/services/logs/model_create_logs_instance_payload.go +++ /dev/null @@ -1,323 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -import ( - "encoding/json" -) - -// checks if the CreateLogsInstancePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &CreateLogsInstancePayload{} - -/* - types and functions for acl -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetAclAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetAclArgType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetAclRetType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateLogsInstancePayloadGetAclAttributeTypeOk(arg CreateLogsInstancePayloadGetAclAttributeType) (ret CreateLogsInstancePayloadGetAclRetType, 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 setCreateLogsInstancePayloadGetAclAttributeType(arg *CreateLogsInstancePayloadGetAclAttributeType, val CreateLogsInstancePayloadGetAclRetType) { - *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 CreateLogsInstancePayloadGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateLogsInstancePayloadGetDescriptionAttributeTypeOk(arg CreateLogsInstancePayloadGetDescriptionAttributeType) (ret CreateLogsInstancePayloadGetDescriptionRetType, 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 setCreateLogsInstancePayloadGetDescriptionAttributeType(arg *CreateLogsInstancePayloadGetDescriptionAttributeType, val CreateLogsInstancePayloadGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetDescriptionRetType = 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 CreateLogsInstancePayloadGetDisplayNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateLogsInstancePayloadGetDisplayNameAttributeTypeOk(arg CreateLogsInstancePayloadGetDisplayNameAttributeType) (ret CreateLogsInstancePayloadGetDisplayNameRetType, 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 setCreateLogsInstancePayloadGetDisplayNameAttributeType(arg *CreateLogsInstancePayloadGetDisplayNameAttributeType, val CreateLogsInstancePayloadGetDisplayNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetDisplayNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetDisplayNameRetType = string - -/* - types and functions for retentionDays -*/ - -// isInteger -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetRetentionDaysAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetRetentionDaysArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayloadGetRetentionDaysRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getCreateLogsInstancePayloadGetRetentionDaysAttributeTypeOk(arg CreateLogsInstancePayloadGetRetentionDaysAttributeType) (ret CreateLogsInstancePayloadGetRetentionDaysRetType, 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 setCreateLogsInstancePayloadGetRetentionDaysAttributeType(arg *CreateLogsInstancePayloadGetRetentionDaysAttributeType, val CreateLogsInstancePayloadGetRetentionDaysRetType) { - *arg = &val -} - -// CreateLogsInstancePayload struct for CreateLogsInstancePayload -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type CreateLogsInstancePayload struct { - // The access control list for the Logs instance. - Acl CreateLogsInstancePayloadGetAclAttributeType `json:"acl,omitempty"` - // The description of the access token. - Description CreateLogsInstancePayloadGetDescriptionAttributeType `json:"description,omitempty"` - // The displayed name to distinguish multiple Logs instances. - // REQUIRED - DisplayName CreateLogsInstancePayloadGetDisplayNameAttributeType `json:"displayName" required:"true"` - // The log retention time in days. - // Can be cast to int32 without loss of precision. - // REQUIRED - RetentionDays CreateLogsInstancePayloadGetRetentionDaysAttributeType `json:"retentionDays" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _CreateLogsInstancePayload CreateLogsInstancePayload - -// NewCreateLogsInstancePayload instantiates a new CreateLogsInstancePayload 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 NewCreateLogsInstancePayload(displayName CreateLogsInstancePayloadGetDisplayNameArgType, retentionDays CreateLogsInstancePayloadGetRetentionDaysArgType) *CreateLogsInstancePayload { - this := CreateLogsInstancePayload{} - setCreateLogsInstancePayloadGetDisplayNameAttributeType(&this.DisplayName, displayName) - setCreateLogsInstancePayloadGetRetentionDaysAttributeType(&this.RetentionDays, retentionDays) - return &this -} - -// NewCreateLogsInstancePayloadWithDefaults instantiates a new CreateLogsInstancePayload 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 NewCreateLogsInstancePayloadWithDefaults() *CreateLogsInstancePayload { - this := CreateLogsInstancePayload{} - 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 *CreateLogsInstancePayload) GetAcl() (res CreateLogsInstancePayloadGetAclRetType) { - 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 *CreateLogsInstancePayload) GetAclOk() (ret CreateLogsInstancePayloadGetAclRetType, ok bool) { - return getCreateLogsInstancePayloadGetAclAttributeTypeOk(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 *CreateLogsInstancePayload) HasAcl() bool { - _, ok := o.GetAclOk() - return ok -} - -// SetAcl gets a reference to the given []string 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 *CreateLogsInstancePayload) SetAcl(v CreateLogsInstancePayloadGetAclRetType) { - setCreateLogsInstancePayloadGetAclAttributeType(&o.Acl, 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 *CreateLogsInstancePayload) GetDescription() (res CreateLogsInstancePayloadGetDescriptionRetType) { - 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 *CreateLogsInstancePayload) GetDescriptionOk() (ret CreateLogsInstancePayloadGetDescriptionRetType, ok bool) { - return getCreateLogsInstancePayloadGetDescriptionAttributeTypeOk(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 *CreateLogsInstancePayload) 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 *CreateLogsInstancePayload) SetDescription(v CreateLogsInstancePayloadGetDescriptionRetType) { - setCreateLogsInstancePayloadGetDescriptionAttributeType(&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 *CreateLogsInstancePayload) GetDisplayName() (ret CreateLogsInstancePayloadGetDisplayNameRetType) { - 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 *CreateLogsInstancePayload) GetDisplayNameOk() (ret CreateLogsInstancePayloadGetDisplayNameRetType, ok bool) { - return getCreateLogsInstancePayloadGetDisplayNameAttributeTypeOk(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 *CreateLogsInstancePayload) SetDisplayName(v CreateLogsInstancePayloadGetDisplayNameRetType) { - setCreateLogsInstancePayloadGetDisplayNameAttributeType(&o.DisplayName, v) -} - -// GetRetentionDays returns the RetentionDays field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateLogsInstancePayload) GetRetentionDays() (ret CreateLogsInstancePayloadGetRetentionDaysRetType) { - ret, _ = o.GetRetentionDaysOk() - return ret -} - -// GetRetentionDaysOk returns a tuple with the RetentionDays field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateLogsInstancePayload) GetRetentionDaysOk() (ret CreateLogsInstancePayloadGetRetentionDaysRetType, ok bool) { - return getCreateLogsInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays) -} - -// SetRetentionDays sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *CreateLogsInstancePayload) SetRetentionDays(v CreateLogsInstancePayloadGetRetentionDaysRetType) { - setCreateLogsInstancePayloadGetRetentionDaysAttributeType(&o.RetentionDays, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o CreateLogsInstancePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getCreateLogsInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { - toSerialize["Acl"] = val - } - if val, ok := getCreateLogsInstancePayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getCreateLogsInstancePayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { - toSerialize["DisplayName"] = val - } - if val, ok := getCreateLogsInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { - toSerialize["RetentionDays"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableCreateLogsInstancePayload struct { - value *CreateLogsInstancePayload - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableCreateLogsInstancePayload) Get() *CreateLogsInstancePayload { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableCreateLogsInstancePayload) Set(val *CreateLogsInstancePayload) { - 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 NullableCreateLogsInstancePayload) 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 *NullableCreateLogsInstancePayload) 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 NewNullableCreateLogsInstancePayload(val *CreateLogsInstancePayload) *NullableCreateLogsInstancePayload { - return &NullableCreateLogsInstancePayload{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 NullableCreateLogsInstancePayload) 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 *NullableCreateLogsInstancePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/logs/model_create_logs_instance_payload_test.go b/services/logs/model_create_logs_instance_payload_test.go deleted file mode 100644 index 81ac6fa6a1..0000000000 --- a/services/logs/model_create_logs_instance_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs diff --git a/services/logs/model_logs_instance.go b/services/logs/model_logs_instance.go deleted file mode 100644 index 6bd1b6d8d5..0000000000 --- a/services/logs/model_logs_instance.go +++ /dev/null @@ -1,905 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -import ( - "encoding/json" - "fmt" - "time" -) - -// checks if the LogsInstance type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LogsInstance{} - -/* - types and functions for acl -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetAclAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetAclArgType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetAclRetType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetAclAttributeTypeOk(arg LogsInstanceGetAclAttributeType) (ret LogsInstanceGetAclRetType, 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 setLogsInstanceGetAclAttributeType(arg *LogsInstanceGetAclAttributeType, val LogsInstanceGetAclRetType) { - *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 LogsInstanceGetCreatedAttributeType = *time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetCreatedArgType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetCreatedRetType = time.Time - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetCreatedAttributeTypeOk(arg LogsInstanceGetCreatedAttributeType) (ret LogsInstanceGetCreatedRetType, 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 setLogsInstanceGetCreatedAttributeType(arg *LogsInstanceGetCreatedAttributeType, val LogsInstanceGetCreatedRetType) { - *arg = &val -} - -/* - types and functions for datasourceUrl -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetDatasourceUrlAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetDatasourceUrlAttributeTypeOk(arg LogsInstanceGetDatasourceUrlAttributeType) (ret LogsInstanceGetDatasourceUrlRetType, 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 setLogsInstanceGetDatasourceUrlAttributeType(arg *LogsInstanceGetDatasourceUrlAttributeType, val LogsInstanceGetDatasourceUrlRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetDatasourceUrlArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetDatasourceUrlRetType = string - -/* - 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 LogsInstanceGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetDescriptionAttributeTypeOk(arg LogsInstanceGetDescriptionAttributeType) (ret LogsInstanceGetDescriptionRetType, 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 setLogsInstanceGetDescriptionAttributeType(arg *LogsInstanceGetDescriptionAttributeType, val LogsInstanceGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetDescriptionRetType = 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 LogsInstanceGetDisplayNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetDisplayNameAttributeTypeOk(arg LogsInstanceGetDisplayNameAttributeType) (ret LogsInstanceGetDisplayNameRetType, 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 setLogsInstanceGetDisplayNameAttributeType(arg *LogsInstanceGetDisplayNameAttributeType, val LogsInstanceGetDisplayNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetDisplayNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetDisplayNameRetType = 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 LogsInstanceGetIdAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetIdAttributeTypeOk(arg LogsInstanceGetIdAttributeType) (ret LogsInstanceGetIdRetType, 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 setLogsInstanceGetIdAttributeType(arg *LogsInstanceGetIdAttributeType, val LogsInstanceGetIdRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetIdArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetIdRetType = string - -/* - types and functions for ingestOtlpUrl -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetIngestOtlpUrlAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetIngestOtlpUrlAttributeTypeOk(arg LogsInstanceGetIngestOtlpUrlAttributeType) (ret LogsInstanceGetIngestOtlpUrlRetType, 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 setLogsInstanceGetIngestOtlpUrlAttributeType(arg *LogsInstanceGetIngestOtlpUrlAttributeType, val LogsInstanceGetIngestOtlpUrlRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetIngestOtlpUrlArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetIngestOtlpUrlRetType = string - -/* - types and functions for ingestUrl -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetIngestUrlAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetIngestUrlAttributeTypeOk(arg LogsInstanceGetIngestUrlAttributeType) (ret LogsInstanceGetIngestUrlRetType, 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 setLogsInstanceGetIngestUrlAttributeType(arg *LogsInstanceGetIngestUrlAttributeType, val LogsInstanceGetIngestUrlRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetIngestUrlArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetIngestUrlRetType = string - -/* - types and functions for queryRangeUrl -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetQueryRangeUrlAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetQueryRangeUrlAttributeTypeOk(arg LogsInstanceGetQueryRangeUrlAttributeType) (ret LogsInstanceGetQueryRangeUrlRetType, 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 setLogsInstanceGetQueryRangeUrlAttributeType(arg *LogsInstanceGetQueryRangeUrlAttributeType, val LogsInstanceGetQueryRangeUrlRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetQueryRangeUrlArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetQueryRangeUrlRetType = string - -/* - types and functions for queryUrl -*/ - -// isNotNullableString -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetQueryUrlAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetQueryUrlAttributeTypeOk(arg LogsInstanceGetQueryUrlAttributeType) (ret LogsInstanceGetQueryUrlRetType, 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 setLogsInstanceGetQueryUrlAttributeType(arg *LogsInstanceGetQueryUrlAttributeType, val LogsInstanceGetQueryUrlRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetQueryUrlArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetQueryUrlRetType = string - -/* - types and functions for retentionDays -*/ - -// isInteger -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetRetentionDaysAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetRetentionDaysArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetRetentionDaysRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetRetentionDaysAttributeTypeOk(arg LogsInstanceGetRetentionDaysAttributeType) (ret LogsInstanceGetRetentionDaysRetType, 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 setLogsInstanceGetRetentionDaysAttributeType(arg *LogsInstanceGetRetentionDaysAttributeType, val LogsInstanceGetRetentionDaysRetType) { - *arg = &val -} - -/* - types and functions for status -*/ - -// isEnum - -// LogsInstanceStatus The current status of the Logs 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 LogsInstanceStatus string - -// List of Status -const ( - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - LOGSINSTANCESTATUS_ACTIVE LogsInstanceStatus = "active" - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - LOGSINSTANCESTATUS_DELETING LogsInstanceStatus = "deleting" - // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead - LOGSINSTANCESTATUS_RECONCILING LogsInstanceStatus = "reconciling" -) - -// All allowed values of LogsInstance enum -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -var AllowedLogsInstanceStatusEnumValues = []LogsInstanceStatus{ - "active", - "deleting", - "reconciling", -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *LogsInstanceStatus) 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 LogsInstanceStatus - 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 := LogsInstanceStatus(value) - for _, existing := range AllowedLogsInstanceStatusEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid LogsInstance", value) -} - -// NewLogsInstanceStatusFromValue returns a pointer to a valid LogsInstanceStatus -// 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 NewLogsInstanceStatusFromValue(v LogsInstanceStatus) (*LogsInstanceStatus, error) { - ev := LogsInstanceStatus(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for LogsInstanceStatus: valid values are %v", v, AllowedLogsInstanceStatusEnumValues) - } -} - -// 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 LogsInstanceStatus) IsValid() bool { - for _, existing := range AllowedLogsInstanceStatusEnumValues { - 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 LogsInstanceStatus) Ptr() *LogsInstanceStatus { - return &v -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableLogsInstanceStatus struct { - value *LogsInstanceStatus - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableLogsInstanceStatus) Get() *LogsInstanceStatus { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableLogsInstanceStatus) Set(val *LogsInstanceStatus) { - 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 NullableLogsInstanceStatus) 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 *NullableLogsInstanceStatus) 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 NewNullableLogsInstanceStatus(val *LogsInstanceStatus) *NullableLogsInstanceStatus { - return &NullableLogsInstanceStatus{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 NullableLogsInstanceStatus) 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 *NullableLogsInstanceStatus) 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 LogsInstanceGetStatusAttributeType = *LogsInstanceStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetStatusArgType = LogsInstanceStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstanceGetStatusRetType = LogsInstanceStatus - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstanceGetStatusAttributeTypeOk(arg LogsInstanceGetStatusAttributeType) (ret LogsInstanceGetStatusRetType, 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 setLogsInstanceGetStatusAttributeType(arg *LogsInstanceGetStatusAttributeType, val LogsInstanceGetStatusRetType) { - *arg = &val -} - -// LogsInstance struct for LogsInstance -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstance struct { - // The access control list for the Logs instance. - Acl LogsInstanceGetAclAttributeType `json:"acl,omitempty"` - // The date and time the creation of the Logs instance was triggered. - // REQUIRED - Created LogsInstanceGetCreatedAttributeType `json:"created" required:"true"` - // The Logs instance's datasource URL, can be used in Grafana as a datasource URL - DatasourceUrl LogsInstanceGetDatasourceUrlAttributeType `json:"datasourceUrl,omitempty"` - // The description of the Logs instance. - Description LogsInstanceGetDescriptionAttributeType `json:"description,omitempty"` - // The displayed name of the Logs instance. - // REQUIRED - DisplayName LogsInstanceGetDisplayNameAttributeType `json:"displayName" required:"true"` - // A auto generated unique id which identifies the Logs instance. - // REQUIRED - Id LogsInstanceGetIdAttributeType `json:"id" required:"true"` - // The Logs instance's ingest logs via OTLP URL - IngestOtlpUrl LogsInstanceGetIngestOtlpUrlAttributeType `json:"ingestOtlpUrl,omitempty"` - // The Logs instance's ingest logs URL - IngestUrl LogsInstanceGetIngestUrlAttributeType `json:"ingestUrl,omitempty"` - // The Logs instance's query range URL - QueryRangeUrl LogsInstanceGetQueryRangeUrlAttributeType `json:"queryRangeUrl,omitempty"` - // The Logs instance's query URL - QueryUrl LogsInstanceGetQueryUrlAttributeType `json:"queryUrl,omitempty"` - // The log retention time in days. - // Can be cast to int32 without loss of precision. - // REQUIRED - RetentionDays LogsInstanceGetRetentionDaysAttributeType `json:"retentionDays" required:"true"` - // The current status of the Logs instance. - // REQUIRED - Status LogsInstanceGetStatusAttributeType `json:"status" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _LogsInstance LogsInstance - -// NewLogsInstance instantiates a new LogsInstance 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 NewLogsInstance(created LogsInstanceGetCreatedArgType, displayName LogsInstanceGetDisplayNameArgType, id LogsInstanceGetIdArgType, retentionDays LogsInstanceGetRetentionDaysArgType, status LogsInstanceGetStatusArgType) *LogsInstance { - this := LogsInstance{} - setLogsInstanceGetCreatedAttributeType(&this.Created, created) - setLogsInstanceGetDisplayNameAttributeType(&this.DisplayName, displayName) - setLogsInstanceGetIdAttributeType(&this.Id, id) - setLogsInstanceGetRetentionDaysAttributeType(&this.RetentionDays, retentionDays) - setLogsInstanceGetStatusAttributeType(&this.Status, status) - return &this -} - -// NewLogsInstanceWithDefaults instantiates a new LogsInstance 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 NewLogsInstanceWithDefaults() *LogsInstance { - this := LogsInstance{} - 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 *LogsInstance) GetAcl() (res LogsInstanceGetAclRetType) { - 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 *LogsInstance) GetAclOk() (ret LogsInstanceGetAclRetType, ok bool) { - return getLogsInstanceGetAclAttributeTypeOk(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 *LogsInstance) HasAcl() bool { - _, ok := o.GetAclOk() - return ok -} - -// SetAcl gets a reference to the given []string 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 *LogsInstance) SetAcl(v LogsInstanceGetAclRetType) { - setLogsInstanceGetAclAttributeType(&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 *LogsInstance) GetCreated() (ret LogsInstanceGetCreatedRetType) { - 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 *LogsInstance) GetCreatedOk() (ret LogsInstanceGetCreatedRetType, ok bool) { - return getLogsInstanceGetCreatedAttributeTypeOk(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 *LogsInstance) SetCreated(v LogsInstanceGetCreatedRetType) { - setLogsInstanceGetCreatedAttributeType(&o.Created, v) -} - -// GetDatasourceUrl returns the DatasourceUrl 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 *LogsInstance) GetDatasourceUrl() (res LogsInstanceGetDatasourceUrlRetType) { - res, _ = o.GetDatasourceUrlOk() - return -} - -// GetDatasourceUrlOk returns a tuple with the DatasourceUrl 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 *LogsInstance) GetDatasourceUrlOk() (ret LogsInstanceGetDatasourceUrlRetType, ok bool) { - return getLogsInstanceGetDatasourceUrlAttributeTypeOk(o.DatasourceUrl) -} - -// HasDatasourceUrl 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 *LogsInstance) HasDatasourceUrl() bool { - _, ok := o.GetDatasourceUrlOk() - return ok -} - -// SetDatasourceUrl gets a reference to the given string and assigns it to the DatasourceUrl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *LogsInstance) SetDatasourceUrl(v LogsInstanceGetDatasourceUrlRetType) { - setLogsInstanceGetDatasourceUrlAttributeType(&o.DatasourceUrl, 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 *LogsInstance) GetDescription() (res LogsInstanceGetDescriptionRetType) { - 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 *LogsInstance) GetDescriptionOk() (ret LogsInstanceGetDescriptionRetType, ok bool) { - return getLogsInstanceGetDescriptionAttributeTypeOk(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 *LogsInstance) 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 *LogsInstance) SetDescription(v LogsInstanceGetDescriptionRetType) { - setLogsInstanceGetDescriptionAttributeType(&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 *LogsInstance) GetDisplayName() (ret LogsInstanceGetDisplayNameRetType) { - 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 *LogsInstance) GetDisplayNameOk() (ret LogsInstanceGetDisplayNameRetType, ok bool) { - return getLogsInstanceGetDisplayNameAttributeTypeOk(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 *LogsInstance) SetDisplayName(v LogsInstanceGetDisplayNameRetType) { - setLogsInstanceGetDisplayNameAttributeType(&o.DisplayName, 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 *LogsInstance) GetId() (ret LogsInstanceGetIdRetType) { - 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 *LogsInstance) GetIdOk() (ret LogsInstanceGetIdRetType, ok bool) { - return getLogsInstanceGetIdAttributeTypeOk(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 *LogsInstance) SetId(v LogsInstanceGetIdRetType) { - setLogsInstanceGetIdAttributeType(&o.Id, v) -} - -// GetIngestOtlpUrl returns the IngestOtlpUrl 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 *LogsInstance) GetIngestOtlpUrl() (res LogsInstanceGetIngestOtlpUrlRetType) { - res, _ = o.GetIngestOtlpUrlOk() - return -} - -// GetIngestOtlpUrlOk returns a tuple with the IngestOtlpUrl 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 *LogsInstance) GetIngestOtlpUrlOk() (ret LogsInstanceGetIngestOtlpUrlRetType, ok bool) { - return getLogsInstanceGetIngestOtlpUrlAttributeTypeOk(o.IngestOtlpUrl) -} - -// HasIngestOtlpUrl 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 *LogsInstance) HasIngestOtlpUrl() bool { - _, ok := o.GetIngestOtlpUrlOk() - return ok -} - -// SetIngestOtlpUrl gets a reference to the given string and assigns it to the IngestOtlpUrl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *LogsInstance) SetIngestOtlpUrl(v LogsInstanceGetIngestOtlpUrlRetType) { - setLogsInstanceGetIngestOtlpUrlAttributeType(&o.IngestOtlpUrl, v) -} - -// GetIngestUrl returns the IngestUrl 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 *LogsInstance) GetIngestUrl() (res LogsInstanceGetIngestUrlRetType) { - res, _ = o.GetIngestUrlOk() - return -} - -// GetIngestUrlOk returns a tuple with the IngestUrl 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 *LogsInstance) GetIngestUrlOk() (ret LogsInstanceGetIngestUrlRetType, ok bool) { - return getLogsInstanceGetIngestUrlAttributeTypeOk(o.IngestUrl) -} - -// HasIngestUrl 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 *LogsInstance) HasIngestUrl() bool { - _, ok := o.GetIngestUrlOk() - return ok -} - -// SetIngestUrl gets a reference to the given string and assigns it to the IngestUrl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *LogsInstance) SetIngestUrl(v LogsInstanceGetIngestUrlRetType) { - setLogsInstanceGetIngestUrlAttributeType(&o.IngestUrl, v) -} - -// GetQueryRangeUrl returns the QueryRangeUrl 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 *LogsInstance) GetQueryRangeUrl() (res LogsInstanceGetQueryRangeUrlRetType) { - res, _ = o.GetQueryRangeUrlOk() - return -} - -// GetQueryRangeUrlOk returns a tuple with the QueryRangeUrl 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 *LogsInstance) GetQueryRangeUrlOk() (ret LogsInstanceGetQueryRangeUrlRetType, ok bool) { - return getLogsInstanceGetQueryRangeUrlAttributeTypeOk(o.QueryRangeUrl) -} - -// HasQueryRangeUrl 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 *LogsInstance) HasQueryRangeUrl() bool { - _, ok := o.GetQueryRangeUrlOk() - return ok -} - -// SetQueryRangeUrl gets a reference to the given string and assigns it to the QueryRangeUrl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *LogsInstance) SetQueryRangeUrl(v LogsInstanceGetQueryRangeUrlRetType) { - setLogsInstanceGetQueryRangeUrlAttributeType(&o.QueryRangeUrl, v) -} - -// GetQueryUrl returns the QueryUrl 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 *LogsInstance) GetQueryUrl() (res LogsInstanceGetQueryUrlRetType) { - res, _ = o.GetQueryUrlOk() - return -} - -// GetQueryUrlOk returns a tuple with the QueryUrl 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 *LogsInstance) GetQueryUrlOk() (ret LogsInstanceGetQueryUrlRetType, ok bool) { - return getLogsInstanceGetQueryUrlAttributeTypeOk(o.QueryUrl) -} - -// HasQueryUrl 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 *LogsInstance) HasQueryUrl() bool { - _, ok := o.GetQueryUrlOk() - return ok -} - -// SetQueryUrl gets a reference to the given string and assigns it to the QueryUrl field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *LogsInstance) SetQueryUrl(v LogsInstanceGetQueryUrlRetType) { - setLogsInstanceGetQueryUrlAttributeType(&o.QueryUrl, v) -} - -// GetRetentionDays returns the RetentionDays field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *LogsInstance) GetRetentionDays() (ret LogsInstanceGetRetentionDaysRetType) { - ret, _ = o.GetRetentionDaysOk() - return ret -} - -// GetRetentionDaysOk returns a tuple with the RetentionDays field value -// and a boolean to check if the value has been set. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *LogsInstance) GetRetentionDaysOk() (ret LogsInstanceGetRetentionDaysRetType, ok bool) { - return getLogsInstanceGetRetentionDaysAttributeTypeOk(o.RetentionDays) -} - -// SetRetentionDays sets field value -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *LogsInstance) SetRetentionDays(v LogsInstanceGetRetentionDaysRetType) { - setLogsInstanceGetRetentionDaysAttributeType(&o.RetentionDays, 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 *LogsInstance) GetStatus() (ret LogsInstanceGetStatusRetType) { - 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 *LogsInstance) GetStatusOk() (ret LogsInstanceGetStatusRetType, ok bool) { - return getLogsInstanceGetStatusAttributeTypeOk(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 *LogsInstance) SetStatus(v LogsInstanceGetStatusRetType) { - setLogsInstanceGetStatusAttributeType(&o.Status, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o LogsInstance) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getLogsInstanceGetAclAttributeTypeOk(o.Acl); ok { - toSerialize["Acl"] = val - } - if val, ok := getLogsInstanceGetCreatedAttributeTypeOk(o.Created); ok { - toSerialize["Created"] = val - } - if val, ok := getLogsInstanceGetDatasourceUrlAttributeTypeOk(o.DatasourceUrl); ok { - toSerialize["DatasourceUrl"] = val - } - if val, ok := getLogsInstanceGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getLogsInstanceGetDisplayNameAttributeTypeOk(o.DisplayName); ok { - toSerialize["DisplayName"] = val - } - if val, ok := getLogsInstanceGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getLogsInstanceGetIngestOtlpUrlAttributeTypeOk(o.IngestOtlpUrl); ok { - toSerialize["IngestOtlpUrl"] = val - } - if val, ok := getLogsInstanceGetIngestUrlAttributeTypeOk(o.IngestUrl); ok { - toSerialize["IngestUrl"] = val - } - if val, ok := getLogsInstanceGetQueryRangeUrlAttributeTypeOk(o.QueryRangeUrl); ok { - toSerialize["QueryRangeUrl"] = val - } - if val, ok := getLogsInstanceGetQueryUrlAttributeTypeOk(o.QueryUrl); ok { - toSerialize["QueryUrl"] = val - } - if val, ok := getLogsInstanceGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { - toSerialize["RetentionDays"] = val - } - if val, ok := getLogsInstanceGetStatusAttributeTypeOk(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 NullableLogsInstance struct { - value *LogsInstance - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableLogsInstance) Get() *LogsInstance { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableLogsInstance) Set(val *LogsInstance) { - 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 NullableLogsInstance) 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 *NullableLogsInstance) 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 NewNullableLogsInstance(val *LogsInstance) *NullableLogsInstance { - return &NullableLogsInstance{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 NullableLogsInstance) 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 *NullableLogsInstance) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/logs/model_logs_instance_test.go b/services/logs/model_logs_instance_test.go deleted file mode 100644 index 3299096430..0000000000 --- a/services/logs/model_logs_instance_test.go +++ /dev/null @@ -1,65 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs - -import ( - "testing" -) - -// isEnum - -func TestLogsInstanceStatus_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(`"active"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 2`, - args: args{ - src: []byte(`"deleting"`), - }, - wantErr: false, - }, - { - name: `success - possible enum value no. 3`, - args: args{ - src: []byte(`"reconciling"`), - }, - wantErr: false, - }, - { - name: "fail", - args: args{ - src: []byte("\"FOOBAR\""), - }, - wantErr: true, - }, - } - for _, tt := range tests { - t.Run(tt.name, func(t *testing.T) { - v := LogsInstanceStatus("") - 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/logs/model_logs_instances_list.go b/services/logs/model_logs_instances_list.go deleted file mode 100644 index 32efac2ee9..0000000000 --- a/services/logs/model_logs_instances_list.go +++ /dev/null @@ -1,149 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -import ( - "encoding/json" -) - -// checks if the LogsInstancesList type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &LogsInstancesList{} - -/* - 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 LogsInstancesListGetInstancesAttributeType = *[]LogsInstance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstancesListGetInstancesArgType = []LogsInstance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstancesListGetInstancesRetType = []LogsInstance - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getLogsInstancesListGetInstancesAttributeTypeOk(arg LogsInstancesListGetInstancesAttributeType) (ret LogsInstancesListGetInstancesRetType, 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 setLogsInstancesListGetInstancesAttributeType(arg *LogsInstancesListGetInstancesAttributeType, val LogsInstancesListGetInstancesRetType) { - *arg = &val -} - -// LogsInstancesList struct for LogsInstancesList -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type LogsInstancesList struct { - // REQUIRED - Instances LogsInstancesListGetInstancesAttributeType `json:"instances" required:"true"` -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type _LogsInstancesList LogsInstancesList - -// NewLogsInstancesList instantiates a new LogsInstancesList 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 NewLogsInstancesList(instances LogsInstancesListGetInstancesArgType) *LogsInstancesList { - this := LogsInstancesList{} - setLogsInstancesListGetInstancesAttributeType(&this.Instances, instances) - return &this -} - -// NewLogsInstancesListWithDefaults instantiates a new LogsInstancesList 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 NewLogsInstancesListWithDefaults() *LogsInstancesList { - this := LogsInstancesList{} - 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 *LogsInstancesList) GetInstances() (ret LogsInstancesListGetInstancesRetType) { - 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 *LogsInstancesList) GetInstancesOk() (ret LogsInstancesListGetInstancesRetType, ok bool) { - return getLogsInstancesListGetInstancesAttributeTypeOk(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 *LogsInstancesList) SetInstances(v LogsInstancesListGetInstancesRetType) { - setLogsInstancesListGetInstancesAttributeType(&o.Instances, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o LogsInstancesList) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getLogsInstancesListGetInstancesAttributeTypeOk(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 NullableLogsInstancesList struct { - value *LogsInstancesList - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableLogsInstancesList) Get() *LogsInstancesList { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableLogsInstancesList) Set(val *LogsInstancesList) { - 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 NullableLogsInstancesList) 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 *NullableLogsInstancesList) 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 NewNullableLogsInstancesList(val *LogsInstancesList) *NullableLogsInstancesList { - return &NullableLogsInstancesList{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 NullableLogsInstancesList) 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 *NullableLogsInstancesList) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/logs/model_logs_instances_list_test.go b/services/logs/model_logs_instances_list_test.go deleted file mode 100644 index 81ac6fa6a1..0000000000 --- a/services/logs/model_logs_instances_list_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs diff --git a/services/logs/model_update_access_token_payload.go b/services/logs/model_update_access_token_payload.go deleted file mode 100644 index 7375a6f673..0000000000 --- a/services/logs/model_update_access_token_payload.go +++ /dev/null @@ -1,211 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -import ( - "encoding/json" -) - -// checks if the UpdateAccessTokenPayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateAccessTokenPayload{} - -/* - 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 UpdateAccessTokenPayloadGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateAccessTokenPayloadGetDescriptionAttributeTypeOk(arg UpdateAccessTokenPayloadGetDescriptionAttributeType) (ret UpdateAccessTokenPayloadGetDescriptionRetType, 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 setUpdateAccessTokenPayloadGetDescriptionAttributeType(arg *UpdateAccessTokenPayloadGetDescriptionAttributeType, val UpdateAccessTokenPayloadGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateAccessTokenPayloadGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateAccessTokenPayloadGetDescriptionRetType = 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 UpdateAccessTokenPayloadGetDisplayNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateAccessTokenPayloadGetDisplayNameAttributeTypeOk(arg UpdateAccessTokenPayloadGetDisplayNameAttributeType) (ret UpdateAccessTokenPayloadGetDisplayNameRetType, 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 setUpdateAccessTokenPayloadGetDisplayNameAttributeType(arg *UpdateAccessTokenPayloadGetDisplayNameAttributeType, val UpdateAccessTokenPayloadGetDisplayNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateAccessTokenPayloadGetDisplayNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateAccessTokenPayloadGetDisplayNameRetType = string - -// UpdateAccessTokenPayload struct for UpdateAccessTokenPayload -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateAccessTokenPayload struct { - // The description of the access token. - Description UpdateAccessTokenPayloadGetDescriptionAttributeType `json:"description,omitempty"` - // The displayed name of the access token. - DisplayName UpdateAccessTokenPayloadGetDisplayNameAttributeType `json:"displayName,omitempty"` -} - -// NewUpdateAccessTokenPayload instantiates a new UpdateAccessTokenPayload 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 NewUpdateAccessTokenPayload() *UpdateAccessTokenPayload { - this := UpdateAccessTokenPayload{} - return &this -} - -// NewUpdateAccessTokenPayloadWithDefaults instantiates a new UpdateAccessTokenPayload 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 NewUpdateAccessTokenPayloadWithDefaults() *UpdateAccessTokenPayload { - this := UpdateAccessTokenPayload{} - 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 *UpdateAccessTokenPayload) GetDescription() (res UpdateAccessTokenPayloadGetDescriptionRetType) { - 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 *UpdateAccessTokenPayload) GetDescriptionOk() (ret UpdateAccessTokenPayloadGetDescriptionRetType, ok bool) { - return getUpdateAccessTokenPayloadGetDescriptionAttributeTypeOk(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 *UpdateAccessTokenPayload) 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 *UpdateAccessTokenPayload) SetDescription(v UpdateAccessTokenPayloadGetDescriptionRetType) { - setUpdateAccessTokenPayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetDisplayName returns the DisplayName 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 *UpdateAccessTokenPayload) GetDisplayName() (res UpdateAccessTokenPayloadGetDisplayNameRetType) { - res, _ = o.GetDisplayNameOk() - return -} - -// GetDisplayNameOk returns a tuple with the DisplayName 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 *UpdateAccessTokenPayload) GetDisplayNameOk() (ret UpdateAccessTokenPayloadGetDisplayNameRetType, ok bool) { - return getUpdateAccessTokenPayloadGetDisplayNameAttributeTypeOk(o.DisplayName) -} - -// HasDisplayName 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 *UpdateAccessTokenPayload) HasDisplayName() bool { - _, ok := o.GetDisplayNameOk() - return ok -} - -// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateAccessTokenPayload) SetDisplayName(v UpdateAccessTokenPayloadGetDisplayNameRetType) { - setUpdateAccessTokenPayloadGetDisplayNameAttributeType(&o.DisplayName, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o UpdateAccessTokenPayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateAccessTokenPayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getUpdateAccessTokenPayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { - toSerialize["DisplayName"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUpdateAccessTokenPayload struct { - value *UpdateAccessTokenPayload - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUpdateAccessTokenPayload) Get() *UpdateAccessTokenPayload { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUpdateAccessTokenPayload) Set(val *UpdateAccessTokenPayload) { - 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 NullableUpdateAccessTokenPayload) 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 *NullableUpdateAccessTokenPayload) 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 NewNullableUpdateAccessTokenPayload(val *UpdateAccessTokenPayload) *NullableUpdateAccessTokenPayload { - return &NullableUpdateAccessTokenPayload{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 NullableUpdateAccessTokenPayload) 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 *NullableUpdateAccessTokenPayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/logs/model_update_access_token_payload_test.go b/services/logs/model_update_access_token_payload_test.go deleted file mode 100644 index 81ac6fa6a1..0000000000 --- a/services/logs/model_update_access_token_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs diff --git a/services/logs/model_update_logs_instance_payload.go b/services/logs/model_update_logs_instance_payload.go deleted file mode 100644 index f9c7360611..0000000000 --- a/services/logs/model_update_logs_instance_payload.go +++ /dev/null @@ -1,330 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -package logs - -import ( - "encoding/json" -) - -// checks if the UpdateLogsInstancePayload type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UpdateLogsInstancePayload{} - -/* - types and functions for acl -*/ - -// isArray -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetAclAttributeType = *[]string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetAclArgType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetAclRetType = []string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateLogsInstancePayloadGetAclAttributeTypeOk(arg UpdateLogsInstancePayloadGetAclAttributeType) (ret UpdateLogsInstancePayloadGetAclRetType, 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 setUpdateLogsInstancePayloadGetAclAttributeType(arg *UpdateLogsInstancePayloadGetAclAttributeType, val UpdateLogsInstancePayloadGetAclRetType) { - *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 UpdateLogsInstancePayloadGetDescriptionAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateLogsInstancePayloadGetDescriptionAttributeTypeOk(arg UpdateLogsInstancePayloadGetDescriptionAttributeType) (ret UpdateLogsInstancePayloadGetDescriptionRetType, 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 setUpdateLogsInstancePayloadGetDescriptionAttributeType(arg *UpdateLogsInstancePayloadGetDescriptionAttributeType, val UpdateLogsInstancePayloadGetDescriptionRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetDescriptionArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetDescriptionRetType = 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 UpdateLogsInstancePayloadGetDisplayNameAttributeType = *string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateLogsInstancePayloadGetDisplayNameAttributeTypeOk(arg UpdateLogsInstancePayloadGetDisplayNameAttributeType) (ret UpdateLogsInstancePayloadGetDisplayNameRetType, 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 setUpdateLogsInstancePayloadGetDisplayNameAttributeType(arg *UpdateLogsInstancePayloadGetDisplayNameAttributeType, val UpdateLogsInstancePayloadGetDisplayNameRetType) { - *arg = &val -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetDisplayNameArgType = string - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetDisplayNameRetType = string - -/* - types and functions for retentionDays -*/ - -// isInteger -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetRetentionDaysAttributeType = *int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetRetentionDaysArgType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayloadGetRetentionDaysRetType = int64 - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func getUpdateLogsInstancePayloadGetRetentionDaysAttributeTypeOk(arg UpdateLogsInstancePayloadGetRetentionDaysAttributeType) (ret UpdateLogsInstancePayloadGetRetentionDaysRetType, 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 setUpdateLogsInstancePayloadGetRetentionDaysAttributeType(arg *UpdateLogsInstancePayloadGetRetentionDaysAttributeType, val UpdateLogsInstancePayloadGetRetentionDaysRetType) { - *arg = &val -} - -// UpdateLogsInstancePayload struct for UpdateLogsInstancePayload -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type UpdateLogsInstancePayload struct { - // The access control list for the Logs instance. - Acl UpdateLogsInstancePayloadGetAclAttributeType `json:"acl,omitempty"` - // The description of the Logs instance. - Description UpdateLogsInstancePayloadGetDescriptionAttributeType `json:"description,omitempty"` - // The displayed name to distinguish multiple Logs instances. - DisplayName UpdateLogsInstancePayloadGetDisplayNameAttributeType `json:"displayName,omitempty"` - // The log retention time in days. - // Can be cast to int32 without loss of precision. - RetentionDays UpdateLogsInstancePayloadGetRetentionDaysAttributeType `json:"retentionDays,omitempty"` -} - -// NewUpdateLogsInstancePayload instantiates a new UpdateLogsInstancePayload 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 NewUpdateLogsInstancePayload() *UpdateLogsInstancePayload { - this := UpdateLogsInstancePayload{} - return &this -} - -// NewUpdateLogsInstancePayloadWithDefaults instantiates a new UpdateLogsInstancePayload 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 NewUpdateLogsInstancePayloadWithDefaults() *UpdateLogsInstancePayload { - this := UpdateLogsInstancePayload{} - 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 *UpdateLogsInstancePayload) GetAcl() (res UpdateLogsInstancePayloadGetAclRetType) { - 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 *UpdateLogsInstancePayload) GetAclOk() (ret UpdateLogsInstancePayloadGetAclRetType, ok bool) { - return getUpdateLogsInstancePayloadGetAclAttributeTypeOk(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 *UpdateLogsInstancePayload) HasAcl() bool { - _, ok := o.GetAclOk() - return ok -} - -// SetAcl gets a reference to the given []string 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 *UpdateLogsInstancePayload) SetAcl(v UpdateLogsInstancePayloadGetAclRetType) { - setUpdateLogsInstancePayloadGetAclAttributeType(&o.Acl, 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 *UpdateLogsInstancePayload) GetDescription() (res UpdateLogsInstancePayloadGetDescriptionRetType) { - 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 *UpdateLogsInstancePayload) GetDescriptionOk() (ret UpdateLogsInstancePayloadGetDescriptionRetType, ok bool) { - return getUpdateLogsInstancePayloadGetDescriptionAttributeTypeOk(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 *UpdateLogsInstancePayload) 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 *UpdateLogsInstancePayload) SetDescription(v UpdateLogsInstancePayloadGetDescriptionRetType) { - setUpdateLogsInstancePayloadGetDescriptionAttributeType(&o.Description, v) -} - -// GetDisplayName returns the DisplayName 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 *UpdateLogsInstancePayload) GetDisplayName() (res UpdateLogsInstancePayloadGetDisplayNameRetType) { - res, _ = o.GetDisplayNameOk() - return -} - -// GetDisplayNameOk returns a tuple with the DisplayName 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 *UpdateLogsInstancePayload) GetDisplayNameOk() (ret UpdateLogsInstancePayloadGetDisplayNameRetType, ok bool) { - return getUpdateLogsInstancePayloadGetDisplayNameAttributeTypeOk(o.DisplayName) -} - -// HasDisplayName 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 *UpdateLogsInstancePayload) HasDisplayName() bool { - _, ok := o.GetDisplayNameOk() - return ok -} - -// SetDisplayName gets a reference to the given string and assigns it to the DisplayName field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateLogsInstancePayload) SetDisplayName(v UpdateLogsInstancePayloadGetDisplayNameRetType) { - setUpdateLogsInstancePayloadGetDisplayNameAttributeType(&o.DisplayName, v) -} - -// GetRetentionDays returns the RetentionDays 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 *UpdateLogsInstancePayload) GetRetentionDays() (res UpdateLogsInstancePayloadGetRetentionDaysRetType) { - res, _ = o.GetRetentionDaysOk() - return -} - -// GetRetentionDaysOk returns a tuple with the RetentionDays 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 *UpdateLogsInstancePayload) GetRetentionDaysOk() (ret UpdateLogsInstancePayloadGetRetentionDaysRetType, ok bool) { - return getUpdateLogsInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays) -} - -// HasRetentionDays 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 *UpdateLogsInstancePayload) HasRetentionDays() bool { - _, ok := o.GetRetentionDaysOk() - return ok -} - -// SetRetentionDays gets a reference to the given int64 and assigns it to the RetentionDays field. -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o *UpdateLogsInstancePayload) SetRetentionDays(v UpdateLogsInstancePayloadGetRetentionDaysRetType) { - setUpdateLogsInstancePayloadGetRetentionDaysAttributeType(&o.RetentionDays, v) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (o UpdateLogsInstancePayload) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUpdateLogsInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { - toSerialize["Acl"] = val - } - if val, ok := getUpdateLogsInstancePayloadGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getUpdateLogsInstancePayloadGetDisplayNameAttributeTypeOk(o.DisplayName); ok { - toSerialize["DisplayName"] = val - } - if val, ok := getUpdateLogsInstancePayloadGetRetentionDaysAttributeTypeOk(o.RetentionDays); ok { - toSerialize["RetentionDays"] = val - } - return toSerialize, nil -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type NullableUpdateLogsInstancePayload struct { - value *UpdateLogsInstancePayload - isSet bool -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v NullableUpdateLogsInstancePayload) Get() *UpdateLogsInstancePayload { - return v.value -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func (v *NullableUpdateLogsInstancePayload) Set(val *UpdateLogsInstancePayload) { - 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 NullableUpdateLogsInstancePayload) 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 *NullableUpdateLogsInstancePayload) 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 NewNullableUpdateLogsInstancePayload(val *UpdateLogsInstancePayload) *NullableUpdateLogsInstancePayload { - return &NullableUpdateLogsInstancePayload{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 NullableUpdateLogsInstancePayload) 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 *NullableUpdateLogsInstancePayload) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/logs/model_update_logs_instance_payload_test.go b/services/logs/model_update_logs_instance_payload_test.go deleted file mode 100644 index 81ac6fa6a1..0000000000 --- a/services/logs/model_update_logs_instance_payload_test.go +++ /dev/null @@ -1,11 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs diff --git a/services/logs/package.go b/services/logs/package.go new file mode 100644 index 0000000000..80aeb27082 --- /dev/null +++ b/services/logs/package.go @@ -0,0 +1 @@ +package logs diff --git a/services/logs/utils.go b/services/logs/utils.go deleted file mode 100644 index 94c9a7d985..0000000000 --- a/services/logs/utils.go +++ /dev/null @@ -1,466 +0,0 @@ -/* -STACKIT Logs API - -This API provides endpoints for managing STACKIT Logs. - -API version: 1.0.0 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package logs - -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/logs/wait/deprecation.go b/services/logs/wait/deprecation.go deleted file mode 100644 index 58f184c093..0000000000 --- a/services/logs/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/logs/wait/wait.go b/services/logs/wait/wait.go deleted file mode 100644 index bfbc361447..0000000000 --- a/services/logs/wait/wait.go +++ /dev/null @@ -1,61 +0,0 @@ -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -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/logs" -) - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -type APIClientInterface interface { - GetLogsInstanceExecute(ctx context.Context, projectId string, regionId string, instanceId string) (*logs.LogsInstance, error) -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func CreateLogsInstanceWaitHandler(ctx context.Context, client APIClientInterface, projectID, region, instanceID string) *wait.AsyncActionHandler[logs.LogsInstance] { - handler := wait.New(func() (waitFinished bool, response *logs.LogsInstance, err error) { - instance, err := client.GetLogsInstanceExecute(ctx, projectID, region, instanceID) - if err != nil { - return false, nil, err - } - if instance.Id == nil || instance.Status == nil { - return false, nil, fmt.Errorf("get instance, project: %q, region: %q, instanceID: %q: missing id or status", projectID, region, instanceID) - } - if *instance.Id == instanceID && *instance.Status == logs.LOGSINSTANCESTATUS_ACTIVE { - return true, instance, nil - } - if *instance.Status == logs.LOGSINSTANCESTATUS_DELETING { - return true, nil, fmt.Errorf("creating log instance failed, instance is being deleted") - } - return false, nil, nil - }) - handler.SetTimeout(10 * time.Minute) - return handler -} - -// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead -func DeleteLogsInstanceWaitHandler(ctx context.Context, client APIClientInterface, projectID, region, instanceID string) *wait.AsyncActionHandler[logs.LogsInstance] { - handler := wait.New(func() (waitFinished bool, response *logs.LogsInstance, err error) { - _, err = client.GetLogsInstanceExecute(ctx, projectID, region, instanceID) - // the instances is still gettable, e.g. not deleted, when the errors is null - if err == nil { - return false, nil, nil - } - var oapiError *oapierror.GenericOpenAPIError - if errors.As(err, &oapiError) { - if statusCode := oapiError.StatusCode; statusCode == http.StatusNotFound { - return true, nil, nil - } - } - return false, nil, err - }) - handler.SetTimeout(10 * time.Minute) - return handler -} diff --git a/services/logs/wait/wait_test.go b/services/logs/wait/wait_test.go deleted file mode 100644 index 0abe954070..0000000000 --- a/services/logs/wait/wait_test.go +++ /dev/null @@ -1,175 +0,0 @@ -package wait - -import ( - "context" - "net/http" - "testing" - "testing/synctest" - "time" - - "github.com/google/go-cmp/cmp" - "github.com/google/uuid" - - "github.com/stackitcloud/stackit-sdk-go/core/oapierror" - "github.com/stackitcloud/stackit-sdk-go/core/utils" - "github.com/stackitcloud/stackit-sdk-go/services/logs" -) - -type apiClientMock struct { - getFails bool - returnInstance bool - statusCode int - getLogsResponse *logs.LogsInstance -} - -func (a *apiClientMock) GetLogsInstanceExecute(_ context.Context, _, _, _ string) (*logs.LogsInstance, error) { - if a.getFails { - return nil, &oapierror.GenericOpenAPIError{ - StatusCode: a.statusCode, - } - } - if !a.returnInstance { - return nil, nil - } - return a.getLogsResponse, nil -} - -var projectId = uuid.NewString() -var instanceId = uuid.NewString() - -const region = "eu01" - -func TestCreateLogsInstanceWaitHandler(t *testing.T) { - tests := []struct { - description string - getFails bool - wantErr bool - wantResp bool - returnInstance bool - getLogsResponse *logs.LogsInstance - }{ - { - description: "create succeeded", - getFails: false, - wantErr: false, - wantResp: true, - returnInstance: true, - getLogsResponse: &logs.LogsInstance{ - Id: utils.Ptr(instanceId), - Status: utils.Ptr(logs.LOGSINSTANCESTATUS_ACTIVE), - }, - }, - { - description: "create failed with error", - getFails: true, - wantErr: true, - wantResp: false, - returnInstance: true, - getLogsResponse: &logs.LogsInstance{ - Id: utils.Ptr(instanceId), - Status: utils.Ptr(logs.LOGSINSTANCESTATUS_ACTIVE), - }, - }, - { - description: "create without id", - getFails: false, - wantErr: true, - wantResp: false, - returnInstance: true, - getLogsResponse: &logs.LogsInstance{ - Status: utils.Ptr(logs.LOGSINSTANCESTATUS_ACTIVE), - }, - }, - { - description: "create without status", - getFails: false, - wantErr: true, - wantResp: false, - returnInstance: true, - getLogsResponse: &logs.LogsInstance{ - Id: utils.Ptr(instanceId), - }, - }, - { - description: "instance deleting", - getFails: false, - wantErr: true, - wantResp: false, - returnInstance: true, - getLogsResponse: &logs.LogsInstance{ - Id: utils.Ptr(instanceId), - Status: utils.Ptr(logs.LOGSINSTANCESTATUS_DELETING), - }, - }, - } - for _, tt := range tests { - t.Run(tt.description, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - client := &apiClientMock{ - getFails: tt.getFails, - getLogsResponse: tt.getLogsResponse, - returnInstance: tt.returnInstance, - } - var instanceWanted *logs.LogsInstance - if tt.wantResp { - instanceWanted = tt.getLogsResponse - } - - handler := CreateLogsInstanceWaitHandler(context.Background(), client, projectId, region, instanceId) - - response, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) - - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - if !cmp.Equal(response, instanceWanted) { - t.Fatalf("handler gotRes = %v, want %v", response, instanceWanted) - } - }) - }) - } -} - -func TestDeleteLogsInstanceWaitHandler(t *testing.T) { - tests := []struct { - description string - getFails bool - wantErr bool - statusCode int - }{ - { - description: "delete succeeded", - getFails: true, - statusCode: http.StatusNotFound, - }, - { - description: "delete failed with error", - getFails: true, - wantErr: true, - statusCode: http.StatusInternalServerError, - }, - { - description: "delete still in progress", - getFails: false, - wantErr: true, - statusCode: http.StatusOK, - }, - } - for _, tt := range tests { - t.Run(tt.description, func(t *testing.T) { - synctest.Test(t, func(t *testing.T) { - client := &apiClientMock{ - getFails: tt.getFails, - returnInstance: false, - statusCode: tt.statusCode, - getLogsResponse: nil, - } - handler := DeleteLogsInstanceWaitHandler(context.Background(), client, projectId, region, instanceId) - _, err := handler.SetTimeout(10 * time.Millisecond).WaitWithContext(context.Background()) - if (err != nil) != tt.wantErr { - t.Fatalf("handler error = %v, wantErr %v", err, tt.wantErr) - } - }) - }) - } -}