diff --git a/services/git/api_default.go b/services/git/api_default.go index 3e7fae492..21e1022e9 100644 --- a/services/git/api_default.go +++ b/services/git/api_default.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -23,7 +24,32 @@ import ( "github.com/stackitcloud/stackit-sdk-go/core/oapierror" ) +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type DefaultApi interface { + /* + CreateAuthentication Creates an authentication source + Creates an authentication source for the corresponding STACKIT Git instance + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiCreateAuthenticationRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + CreateAuthentication(ctx context.Context, projectId string, instanceId string) ApiCreateAuthenticationRequest + /* + CreateAuthenticationExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return Authentication + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + CreateAuthenticationExecute(ctx context.Context, projectId string, instanceId string) (*Authentication, error) /* CreateInstance Create an Instance. Creates a new STACKIT Git instance as a project resource. @@ -32,6 +58,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. @return ApiCreateInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest /* @@ -41,8 +69,53 @@ type DefaultApi interface { @param projectId Project identifier. @return Instance + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ CreateInstanceExecute(ctx context.Context, projectId string) (*Instance, error) + /* + CreateRunner Create the runner associated to this instance. + Creates the runner associated to this STACKIT Git instance. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiCreateRunnerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + CreateRunner(ctx context.Context, projectId string, instanceId string) ApiCreateRunnerRequest + /* + CreateRunnerExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return Runner + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + CreateRunnerExecute(ctx context.Context, projectId string, instanceId string) (*Runner, error) + /* + DeleteAuthentication Delete Authentication Source + Deletes the authentication source associated to this STACKIT Git instance. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiDeleteAuthenticationRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + DeleteAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiDeleteAuthenticationRequest + /* + DeleteAuthenticationExecute executes the request + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + DeleteAuthenticationExecute(ctx context.Context, projectId string, instanceId string, authenticationId string) error /* DeleteInstance Delete Instance. Deletes a STACKIT Git instance and destroys all associated data. @@ -52,13 +125,61 @@ type DefaultApi interface { @param projectId Project identifier. @param instanceId Instance identifier. @return ApiDeleteInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest /* DeleteInstanceExecute executes the request + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error + /* + DeleteRunner Delete Runner. + Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiDeleteRunnerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + DeleteRunner(ctx context.Context, projectId string, instanceId string) ApiDeleteRunnerRequest + /* + DeleteRunnerExecute executes the request + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + DeleteRunnerExecute(ctx context.Context, projectId string, instanceId string) error + /* + GetAuthentication Get authentication provider + Get authentication provider + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiGetAuthenticationRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiGetAuthenticationRequest + /* + GetAuthenticationExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return Authentication + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetAuthenticationExecute(ctx context.Context, projectId string, instanceId string, authenticationId string) (*Authentication, error) /* GetInstance Get Instance information. Retrieves information about a STACKIT Git instance. @@ -67,6 +188,8 @@ type DefaultApi interface { @param projectId Project identifier. @param instanceId Instance identifier. @return ApiGetInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest /* @@ -77,8 +200,56 @@ type DefaultApi interface { @param instanceId Instance identifier. @return Instance + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) + /* + GetRunner Get Runner information. + Retrieves information about a runner in a STACKIT Git instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiGetRunnerRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetRunner(ctx context.Context, projectId string, instanceId string) ApiGetRunnerRequest + /* + GetRunnerExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return Runner + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + GetRunnerExecute(ctx context.Context, projectId string, instanceId string) (*Runner, error) + /* + ListAuthentication List authentication sources + Lists all authentication sources belonging to a specific instance + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiListAuthenticationRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + ListAuthentication(ctx context.Context, projectId string, instanceId string) ApiListAuthenticationRequest + /* + ListAuthenticationExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return AuthenticationList + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + ListAuthenticationExecute(ctx context.Context, projectId string, instanceId string) (*AuthenticationList, error) /* ListFlavors Returns the details for the given STACKIT Git flavors. Provides detailed information about possible Git Flavors. @@ -87,6 +258,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. @return ApiListFlavorsRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest /* @@ -96,6 +269,7 @@ type DefaultApi interface { @param projectId Project identifier. @return ListFlavors + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListFlavorsExecute(ctx context.Context, projectId string) (*ListFlavors, error) /* @@ -106,6 +280,8 @@ type DefaultApi interface { @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. @return ApiListInstancesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest /* @@ -115,27 +291,56 @@ type DefaultApi interface { @param projectId Project identifier. @return ListInstances + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ ListInstancesExecute(ctx context.Context, projectId string) (*ListInstances, error) /* - ListRunnerLabels Returns the details for the given STACKIT Git RunnerLabels. - Type of runners we can use for running jobs. + ListRunnerRuntimes Method for ListRunnerRuntimes + A list of runner runtimes that are available to be enabled for the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiListRunnerRuntimesRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + ListRunnerRuntimes(ctx context.Context, projectId string) ApiListRunnerRuntimesRequest + /* + ListRunnerRuntimesExecute executes the request + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return RunnerRuntimeList + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + */ + ListRunnerRuntimesExecute(ctx context.Context, projectId string) (*RunnerRuntimeList, error) + /* + PatchAuthentication Patch Authentication. + Patches the Authentication Provider. @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. - @return ApiListRunnerLabelsRequest + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiPatchAuthenticationRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRunnerLabels(ctx context.Context, projectId string) ApiListRunnerLabelsRequest + PatchAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiPatchAuthenticationRequest /* - ListRunnerLabelsExecute executes the request + PatchAuthenticationExecute executes the request @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. - @return ListRunnerLabels + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return Authentication + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ - ListRunnerLabelsExecute(ctx context.Context, projectId string) (*ListRunnerLabels, error) + PatchAuthenticationExecute(ctx context.Context, projectId string, instanceId string, authenticationId string) (*Authentication, error) /* PatchInstance Patch Instance. Patches the Instance. @@ -145,6 +350,8 @@ type DefaultApi interface { @param projectId Project identifier. @param instanceId Instance identifier. @return ApiPatchInstanceRequest + + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PatchInstance(ctx context.Context, projectId string, instanceId string) ApiPatchInstanceRequest /* @@ -155,77 +362,1593 @@ type DefaultApi interface { @param instanceId Instance identifier. @return Instance + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead */ PatchInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiCreateAuthenticationRequest interface { + // Authentication Definition configuration data. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateAuthenticationPayload(createAuthenticationPayload CreateAuthenticationPayload) ApiCreateAuthenticationRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*Authentication, error) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiCreateInstanceRequest interface { // Instance configuration options. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Instance, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiCreateRunnerRequest interface { + // Runner configuration options. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CreateRunnerPayload(createRunnerPayload CreateRunnerPayload) ApiCreateRunnerRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*Runner, error) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiDeleteAuthenticationRequest 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 ApiDeleteInstanceRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() error } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiDeleteRunnerRequest 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 ApiGetAuthenticationRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*Authentication, error) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiGetInstanceRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Instance, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiGetRunnerRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*Runner, error) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiListAuthenticationRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*AuthenticationList, error) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListFlavorsRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListFlavors, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiListInstancesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*ListInstances, error) } -type ApiListRunnerLabelsRequest interface { - Execute() (*ListRunnerLabels, error) +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiListRunnerRuntimesRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*RunnerRuntimeList, error) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ApiPatchAuthenticationRequest interface { + // Authentication Definition configuration data. + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + PatchAuthenticationPayload(patchAuthenticationPayload PatchAuthenticationPayload) ApiPatchAuthenticationRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + Execute() (*Authentication, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ApiPatchInstanceRequest interface { + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PatchInstancePayload(patchInstancePayload PatchInstancePayload) ApiPatchInstanceRequest + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead Execute() (*Instance, 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 -type CreateInstanceRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string - createInstancePayload *CreateInstancePayload +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string + createAuthenticationPayload *CreateAuthenticationPayload +} + +// Authentication Definition configuration data. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateAuthenticationRequest) CreateAuthenticationPayload(createAuthenticationPayload CreateAuthenticationPayload) ApiCreateAuthenticationRequest { + r.createAuthenticationPayload = &createAuthenticationPayload + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateAuthenticationRequest) Execute() (*Authentication, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Authentication + ) + 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.CreateAuthentication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") + } + if r.createAuthenticationPayload == nil { + return localVarReturnValue, fmt.Errorf("createAuthenticationPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAuthenticationPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v UnauthorizedErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotFoundErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v ConflictErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InternalServerErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateAuthentication: Creates an authentication source + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiCreateAuthenticationRequest +*/ +func (a *APIClient) CreateAuthentication(ctx context.Context, projectId string, instanceId string) ApiCreateAuthenticationRequest { + return CreateAuthenticationRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) CreateAuthenticationExecute(ctx context.Context, projectId string, instanceId string) (*Authentication, error) { + r := CreateAuthenticationRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + 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 CreateInstanceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + createInstancePayload *CreateInstancePayload +} + +// Instance configuration options. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateInstanceRequest) Execute() (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if r.createInstancePayload == nil { + return localVarReturnValue, fmt.Errorf("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateInstance: Create an 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 Project identifier. + @return ApiCreateInstanceRequest +*/ +func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { + return CreateInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*Instance, error) { + r := CreateInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + } + return r.Execute() +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateRunnerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string + createRunnerPayload *CreateRunnerPayload +} + +// Runner configuration options. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateRunnerRequest) CreateRunnerPayload(createRunnerPayload CreateRunnerPayload) ApiCreateRunnerRequest { + r.createRunnerPayload = &createRunnerPayload + return r +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r CreateRunnerRequest) Execute() (*Runner, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Runner + ) + 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.CreateRunner") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/runner" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") + } + if r.createRunnerPayload == nil { + return localVarReturnValue, fmt.Errorf("createRunnerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createRunnerPayload + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v AlreadyExistsError + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +CreateRunner: Create the runner associated to this 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 Project identifier. + @param instanceId Instance identifier. + @return ApiCreateRunnerRequest +*/ +func (a *APIClient) CreateRunner(ctx context.Context, projectId string, instanceId string) ApiCreateRunnerRequest { + return CreateRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) CreateRunnerExecute(ctx context.Context, projectId string, instanceId string) (*Runner, error) { + r := CreateRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + 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 DeleteAuthenticationRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string + authenticationId string +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r DeleteAuthenticationRequest) 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.DeleteAuthentication") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authenticationId"+"}", url.PathEscape(ParameterValueToString(r.authenticationId, "authenticationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return fmt.Errorf("instanceId must have less than 36 elements") + } + if strlen(r.authenticationId) < 36 { + return fmt.Errorf("authenticationId must have at least 36 elements") + } + if strlen(r.authenticationId) > 36 { + return fmt.Errorf("authenticationId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v UnauthorizedErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + 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 nil +} + +/* +DeleteAuthentication: Delete Authentication Source + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiDeleteAuthenticationRequest +*/ +func (a *APIClient) DeleteAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiDeleteAuthenticationRequest { + return DeleteAuthenticationRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) DeleteAuthenticationExecute(ctx context.Context, projectId string, instanceId string, authenticationId string) error { + r := DeleteAuthenticationRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } + return r.Execute() +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type DeleteInstanceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r DeleteInstanceRequest) Execute() error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return fmt.Errorf("instanceId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + 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 nil +} + +/* +DeleteInstance: Delete 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 Project identifier. + @param instanceId Instance identifier. + @return ApiDeleteInstanceRequest +*/ +func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { + return DeleteInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { + r := DeleteInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + 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 DeleteRunnerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r DeleteRunnerRequest) 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.DeleteRunner") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/runner" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return fmt.Errorf("instanceId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + 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 nil +} + +/* +DeleteRunner: Delete Runner. + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiDeleteRunnerRequest +*/ +func (a *APIClient) DeleteRunner(ctx context.Context, projectId string, instanceId string) ApiDeleteRunnerRequest { + return DeleteRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) DeleteRunnerExecute(ctx context.Context, projectId string, instanceId string) error { + r := DeleteRunnerRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + 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 GetAuthenticationRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string + authenticationId string +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r GetAuthenticationRequest) Execute() (*Authentication, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Authentication + ) + 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.GetAuthentication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authenticationId"+"}", url.PathEscape(ParameterValueToString(r.authenticationId, "authenticationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") + } + if strlen(r.authenticationId) < 36 { + return localVarReturnValue, fmt.Errorf("authenticationId must have at least 36 elements") + } + if strlen(r.authenticationId) > 36 { + return localVarReturnValue, fmt.Errorf("authenticationId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v UnauthorizedErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InternalServerErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetAuthentication: Get authentication provider + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiGetAuthenticationRequest +*/ +func (a *APIClient) GetAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiGetAuthenticationRequest { + return GetAuthenticationRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) GetAuthenticationExecute(ctx context.Context, projectId string, instanceId string, authenticationId string) (*Authentication, error) { + r := GetAuthenticationRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } + return r.Execute() +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetInstanceRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r GetInstanceRequest) Execute() (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + a := r.apiService + client, ok := a.client.(*APIClient) + if !ok { + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") + } + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + } + return localVarReturnValue, newErr + } + + err = client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +/* +GetInstance: Get Instance information. + +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiGetInstanceRequest +*/ +func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { + return GetInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { + r := GetInstanceRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } + return r.Execute() } -// Instance configuration options. - -func (r CreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { - r.createInstancePayload = &createInstancePayload - return r +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type GetRunnerRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string } -func (r CreateInstanceRequest) Execute() (*Instance, error) { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r GetRunnerRequest) Execute() (*Runner, error) { var ( - localVarHTTPMethod = http.MethodPost + localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Instance + localVarReturnValue *Runner ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.CreateInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetRunner") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/runner" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -236,12 +1959,15 @@ func (r CreateInstanceRequest) Execute() (*Instance, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if r.createInstancePayload == nil { - return localVarReturnValue, fmt.Errorf("createInstancePayload is required and must be specified") + if strlen(r.instanceId) < 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") } // to determine the Content-Type header - localVarHTTPContentTypes := []string{"application/json"} + localVarHTTPContentTypes := []string{} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -257,8 +1983,6 @@ func (r CreateInstanceRequest) Execute() (*Instance, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } - // body params - localVarPostBody = r.createInstancePayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -302,28 +2026,6 @@ func (r CreateInstanceRequest) Execute() (*Instance, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedResponse - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } - if localVarHTTPResponse.StatusCode == 409 { - var v GenericErrorResponse - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v GenericErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -351,55 +2053,62 @@ func (r CreateInstanceRequest) Execute() (*Instance, error) { } /* -CreateInstance: Create an Instance. +GetRunner: Get Runner information. -Creates a new STACKIT Git instance as a project resource. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. - @return ApiCreateInstanceRequest + @param instanceId Instance identifier. + @return ApiGetRunnerRequest */ -func (a *APIClient) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { - return CreateInstanceRequest{ +func (a *APIClient) GetRunner(ctx context.Context, projectId string, instanceId string) ApiGetRunnerRequest { + return GetRunnerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + instanceId: instanceId, } } -func (a *APIClient) CreateInstanceExecute(ctx context.Context, projectId string) (*Instance, error) { - r := CreateInstanceRequest{ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) GetRunnerExecute(ctx context.Context, projectId string, instanceId string) (*Runner, error) { + r := GetRunnerRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, + instanceId: instanceId, } return r.Execute() } -type DeleteInstanceRequest struct { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListAuthenticationRequest struct { ctx context.Context apiService *DefaultApiService projectId string instanceId string } -func (r DeleteInstanceRequest) Execute() error { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListAuthenticationRequest) Execute() (*AuthenticationList, error) { var ( - localVarHTTPMethod = http.MethodDelete - localVarPostBody interface{} - formFiles []formFile + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticationList ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { - return fmt.Errorf("could not parse client to type APIClient") + return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.DeleteInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListAuthentication") if err != nil { - return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) @@ -407,16 +2116,16 @@ func (r DeleteInstanceRequest) Execute() error { localVarQueryParams := url.Values{} localVarFormParams := url.Values{} if strlen(r.projectId) < 36 { - return fmt.Errorf("projectId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have at least 36 elements") } if strlen(r.projectId) > 36 { - return fmt.Errorf("projectId must have less than 36 elements") + return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } if strlen(r.instanceId) < 36 { - return fmt.Errorf("instanceId must have at least 36 elements") + return localVarReturnValue, fmt.Errorf("instanceId must have at least 36 elements") } if strlen(r.instanceId) > 36 { - return fmt.Errorf("instanceId must have less than 36 elements") + return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") } // to determine the Content-Type header @@ -438,7 +2147,7 @@ func (r DeleteInstanceRequest) Execute() error { } req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { - return err + return localVarReturnValue, err } contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) @@ -452,14 +2161,14 @@ func (r DeleteInstanceRequest) Execute() error { *contextHTTPResponse = localVarHTTPResponse } if err != nil || localVarHTTPResponse == nil { - return err + return localVarReturnValue, err } localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) localVarHTTPResponse.Body.Close() localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) if err != nil { - return err + return localVarReturnValue, err } if localVarHTTPResponse.StatusCode >= 300 { @@ -469,55 +2178,65 @@ func (r DeleteInstanceRequest) Execute() error { ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v GenericErrorResponse + var v BadErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedResponse + var v UnauthorizedErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v - return newErr + return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { - var v GenericErrorResponse + var v InternalServerErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() - return newErr + return localVarReturnValue, newErr } newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) newErr.Model = v } - return newErr + return localVarReturnValue, newErr } - return nil + 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 } /* -DeleteInstance: Delete Instance. +ListAuthentication: List authentication sources -Deletes a STACKIT Git instance and destroys all associated data. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. @param instanceId Instance identifier. - @return ApiDeleteInstanceRequest + @return ApiListAuthenticationRequest */ -func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { - return DeleteInstanceRequest{ +func (a *APIClient) ListAuthentication(ctx context.Context, projectId string, instanceId string) ApiListAuthenticationRequest { + return ListAuthenticationRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -525,8 +2244,9 @@ func (a *APIClient) DeleteInstance(ctx context.Context, projectId string, instan } } -func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, instanceId string) error { - r := DeleteInstanceRequest{ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) ListAuthenticationExecute(ctx context.Context, projectId string, instanceId string) (*AuthenticationList, error) { + r := ListAuthenticationRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -535,33 +2255,33 @@ func (a *APIClient) DeleteInstanceExecute(ctx context.Context, projectId string, return r.Execute() } -type GetInstanceRequest struct { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListFlavorsRequest struct { ctx context.Context apiService *DefaultApiService projectId string - instanceId string } -func (r GetInstanceRequest) Execute() (*Instance, error) { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListFlavorsRequest) Execute() (*ListFlavors, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *Instance + localVarReturnValue *ListFlavors ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.GetInstance") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListFlavors") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/flavors" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) - localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -572,12 +2292,6 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } - if strlen(r.instanceId) < 36 { - return localVarReturnValue, fmt.Errorf("instanceId must have at least 36 elements") - } - if strlen(r.instanceId) > 36 { - return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") - } // to determine the Content-Type header localVarHTTPContentTypes := []string{} @@ -639,17 +2353,6 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedResponse - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v GenericErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -677,58 +2380,58 @@ func (r GetInstanceRequest) Execute() (*Instance, error) { } /* -GetInstance: Get Instance information. +ListFlavors: Returns the details for the given STACKIT Git flavors. -Retrieves information about a STACKIT Git 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 Project identifier. - @param instanceId Instance identifier. - @return ApiGetInstanceRequest + @return ApiListFlavorsRequest */ -func (a *APIClient) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { - return GetInstanceRequest{ +func (a *APIClient) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { + return ListFlavorsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - instanceId: instanceId, } } -func (a *APIClient) GetInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { - r := GetInstanceRequest{ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) ListFlavorsExecute(ctx context.Context, projectId string) (*ListFlavors, error) { + r := ListFlavorsRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, - instanceId: instanceId, } return r.Execute() } -type ListFlavorsRequest struct { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListInstancesRequest struct { ctx context.Context apiService *DefaultApiService projectId string } -func (r ListFlavorsRequest) Execute() (*ListFlavors, error) { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListInstancesRequest) Execute() (*ListInstances, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListFlavors + localVarReturnValue *ListInstances ) 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.ListFlavors") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListInstances") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/flavors" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -801,17 +2504,6 @@ func (r ListFlavorsRequest) Execute() (*ListFlavors, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedResponse - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v GenericErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -839,24 +2531,25 @@ func (r ListFlavorsRequest) Execute() (*ListFlavors, error) { } /* -ListFlavors: Returns the details for the given STACKIT Git flavors. +ListInstances: List Instances. -Provides detailed information about possible Git Flavors. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. - @return ApiListFlavorsRequest + @return ApiListInstancesRequest */ -func (a *APIClient) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { - return ListFlavorsRequest{ +func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { + return ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) ListFlavorsExecute(ctx context.Context, projectId string) (*ListFlavors, error) { - r := ListFlavorsRequest{ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstances, error) { + r := ListInstancesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -864,30 +2557,32 @@ func (a *APIClient) ListFlavorsExecute(ctx context.Context, projectId string) (* return r.Execute() } -type ListInstancesRequest struct { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ListRunnerRuntimesRequest struct { ctx context.Context apiService *DefaultApiService projectId string } -func (r ListInstancesRequest) Execute() (*ListInstances, error) { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r ListRunnerRuntimesRequest) Execute() (*RunnerRuntimeList, error) { var ( localVarHTTPMethod = http.MethodGet localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListInstances + localVarReturnValue *RunnerRuntimeList ) a := r.apiService client, ok := a.client.(*APIClient) if !ok { return localVarReturnValue, fmt.Errorf("could not parse client to type APIClient") } - localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListInstances") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.ListRunnerRuntimes") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/runner-runtimes" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) localVarHeaderParams := make(map[string]string) @@ -960,8 +2655,8 @@ func (r ListInstancesRequest) Execute() (*ListInstances, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedResponse + if localVarHTTPResponse.StatusCode == 404 { + var v GenericErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -998,24 +2693,25 @@ func (r ListInstancesRequest) Execute() (*ListInstances, error) { } /* -ListInstances: List Instances. +ListRunnerRuntimes: Method for ListRunnerRuntimes -Lists all STACKIT Git instances within a project. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. - @return ApiListInstancesRequest + @return ApiListRunnerRuntimesRequest */ -func (a *APIClient) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { - return ListInstancesRequest{ +func (a *APIClient) ListRunnerRuntimes(ctx context.Context, projectId string) ApiListRunnerRuntimesRequest { + return ListRunnerRuntimesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, } } -func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) (*ListInstances, error) { - r := ListInstancesRequest{ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) ListRunnerRuntimesExecute(ctx context.Context, projectId string) (*RunnerRuntimeList, error) { + r := ListRunnerRuntimesRequest{ apiService: a.defaultApi, ctx: ctx, projectId: projectId, @@ -1023,31 +2719,45 @@ func (a *APIClient) ListInstancesExecute(ctx context.Context, projectId string) return r.Execute() } -type ListRunnerLabelsRequest struct { - ctx context.Context - apiService *DefaultApiService - projectId string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationRequest struct { + ctx context.Context + apiService *DefaultApiService + projectId string + instanceId string + authenticationId string + patchAuthenticationPayload *PatchAuthenticationPayload +} + +// Authentication Definition configuration data. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r PatchAuthenticationRequest) PatchAuthenticationPayload(patchAuthenticationPayload PatchAuthenticationPayload) ApiPatchAuthenticationRequest { + r.patchAuthenticationPayload = &patchAuthenticationPayload + return r } -func (r ListRunnerLabelsRequest) Execute() (*ListRunnerLabels, error) { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (r PatchAuthenticationRequest) Execute() (*Authentication, error) { var ( - localVarHTTPMethod = http.MethodGet + localVarHTTPMethod = http.MethodPatch localVarPostBody interface{} formFiles []formFile - localVarReturnValue *ListRunnerLabels + localVarReturnValue *Authentication ) 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.ListRunnerLabels") + localBasePath, err := client.cfg.ServerURLWithContext(r.ctx, "DefaultApiService.PatchAuthentication") if err != nil { return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} } - localVarPath := localBasePath + "/v1beta/projects/{projectId}/runner-labels" + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authenticationId"+"}", url.PathEscape(ParameterValueToString(r.authenticationId, "authenticationId")), -1) localVarHeaderParams := make(map[string]string) localVarQueryParams := url.Values{} @@ -1058,9 +2768,24 @@ func (r ListRunnerLabelsRequest) Execute() (*ListRunnerLabels, error) { if strlen(r.projectId) > 36 { return localVarReturnValue, fmt.Errorf("projectId must have less than 36 elements") } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, fmt.Errorf("instanceId must have less than 36 elements") + } + if strlen(r.authenticationId) < 36 { + return localVarReturnValue, fmt.Errorf("authenticationId must have at least 36 elements") + } + if strlen(r.authenticationId) > 36 { + return localVarReturnValue, fmt.Errorf("authenticationId must have less than 36 elements") + } + if r.patchAuthenticationPayload == nil { + return localVarReturnValue, fmt.Errorf("patchAuthenticationPayload is required and must be specified") + } // to determine the Content-Type header - localVarHTTPContentTypes := []string{} + localVarHTTPContentTypes := []string{"application/json"} // set Content-Type header localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) @@ -1076,6 +2801,8 @@ func (r ListRunnerLabelsRequest) Execute() (*ListRunnerLabels, error) { if localVarHTTPHeaderAccept != "" { localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept } + // body params + localVarPostBody = r.patchAuthenticationPayload req, err := client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) if err != nil { return localVarReturnValue, err @@ -1109,7 +2836,7 @@ func (r ListRunnerLabelsRequest) Execute() (*ListRunnerLabels, error) { ErrorMessage: localVarHTTPResponse.Status, } if localVarHTTPResponse.StatusCode == 400 { - var v GenericErrorResponse + var v BadErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1120,7 +2847,18 @@ func (r ListRunnerLabelsRequest) Execute() (*ListRunnerLabels, error) { return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedResponse + var v UnauthorizedErrorResponse + err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotFoundErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1131,7 +2869,7 @@ func (r ListRunnerLabelsRequest) Execute() (*ListRunnerLabels, error) { return localVarReturnValue, newErr } if localVarHTTPResponse.StatusCode == 500 { - var v GenericErrorResponse + var v InternalServerErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) if err != nil { newErr.ErrorMessage = err.Error() @@ -1157,31 +2895,39 @@ func (r ListRunnerLabelsRequest) Execute() (*ListRunnerLabels, error) { } /* -ListRunnerLabels: Returns the details for the given STACKIT Git RunnerLabels. +PatchAuthentication: Patch Authentication. -Type of runners we can use for running jobs. +Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). @param projectId Project identifier. - @return ApiListRunnerLabelsRequest + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiPatchAuthenticationRequest */ -func (a *APIClient) ListRunnerLabels(ctx context.Context, projectId string) ApiListRunnerLabelsRequest { - return ListRunnerLabelsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +func (a *APIClient) PatchAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiPatchAuthenticationRequest { + return PatchAuthenticationRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, } } -func (a *APIClient) ListRunnerLabelsExecute(ctx context.Context, projectId string) (*ListRunnerLabels, error) { - r := ListRunnerLabelsRequest{ - apiService: a.defaultApi, - ctx: ctx, - projectId: projectId, +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (a *APIClient) PatchAuthenticationExecute(ctx context.Context, projectId string, instanceId string, authenticationId string) (*Authentication, error) { + r := PatchAuthenticationRequest{ + apiService: a.defaultApi, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, } return r.Execute() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchInstanceRequest struct { ctx context.Context apiService *DefaultApiService @@ -1190,11 +2936,13 @@ type PatchInstanceRequest struct { patchInstancePayload *PatchInstancePayload } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PatchInstanceRequest) PatchInstancePayload(patchInstancePayload PatchInstancePayload) ApiPatchInstanceRequest { r.patchInstancePayload = &patchInstancePayload return r } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (r PatchInstanceRequest) Execute() (*Instance, error) { var ( localVarHTTPMethod = http.MethodPatch @@ -1297,17 +3045,6 @@ func (r PatchInstanceRequest) Execute() (*Instance, error) { newErr.Model = v return localVarReturnValue, newErr } - if localVarHTTPResponse.StatusCode == 401 { - var v UnauthorizedResponse - err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) - if err != nil { - newErr.ErrorMessage = err.Error() - return localVarReturnValue, newErr - } - newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) - newErr.Model = v - return localVarReturnValue, newErr - } if localVarHTTPResponse.StatusCode == 500 { var v GenericErrorResponse err = client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) @@ -1337,7 +3074,7 @@ func (r PatchInstanceRequest) Execute() (*Instance, error) { /* PatchInstance: Patch Instance. -Patches the 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 Project identifier. @@ -1353,6 +3090,7 @@ func (a *APIClient) PatchInstance(ctx context.Context, projectId string, instanc } } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (a *APIClient) PatchInstanceExecute(ctx context.Context, projectId string, instanceId string) (*Instance, error) { r := PatchInstanceRequest{ apiService: a.defaultApi, diff --git a/services/git/api_default_test.go b/services/git/api_default_test.go deleted file mode 100644 index d4077721d..000000000 --- a/services/git/api_default_test.go +++ /dev/null @@ -1,395 +0,0 @@ -/* -STACKIT Git API - -Testing DefaultApiService - -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); - -package git - -import ( - "context" - "encoding/json" - "net/http" - "net/http/httptest" - "net/url" - "strings" - "testing" - - "github.com/stackitcloud/stackit-sdk-go/core/config" -) - -func Test_git_DefaultApiService(t *testing.T) { - - t.Run("Test DefaultApiService CreateInstance", func(t *testing.T) { - _apiUrlPath := "/v1beta/projects/{projectId}/instances" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Instance{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for git_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - createInstancePayload := CreateInstancePayload{} - - resp, reqErr := apiClient.CreateInstance(context.Background(), projectId).CreateInstancePayload(createInstancePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService DeleteInstance", func(t *testing.T) { - _apiUrlPath := "/v1beta/projects/{projectId}/instances/{instanceId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for git_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - - reqErr := apiClient.DeleteInstance(context.Background(), projectId, instanceId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - }) - - t.Run("Test DefaultApiService GetInstance", func(t *testing.T) { - _apiUrlPath := "/v1beta/projects/{projectId}/instances/{instanceId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Instance{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for git_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - - resp, reqErr := apiClient.GetInstance(context.Background(), projectId, instanceId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListFlavors", func(t *testing.T) { - _apiUrlPath := "/v1beta/projects/{projectId}/flavors" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListFlavors{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for git_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - - resp, reqErr := apiClient.ListFlavors(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListInstances", func(t *testing.T) { - _apiUrlPath := "/v1beta/projects/{projectId}/instances" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListInstances{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for git_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - - resp, reqErr := apiClient.ListInstances(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService ListRunnerLabels", func(t *testing.T) { - _apiUrlPath := "/v1beta/projects/{projectId}/runner-labels" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := ListRunnerLabels{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for git_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - - resp, reqErr := apiClient.ListRunnerLabels(context.Background(), projectId).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - - t.Run("Test DefaultApiService PatchInstance", func(t *testing.T) { - _apiUrlPath := "/v1beta/projects/{projectId}/instances/{instanceId}" - projectIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"projectId"+"}", url.PathEscape(ParameterValueToString(projectIdValue, "projectId")), -1) - instanceIdValue := randString(36) - _apiUrlPath = strings.Replace(_apiUrlPath, "{"+"instanceId"+"}", url.PathEscape(ParameterValueToString(instanceIdValue, "instanceId")), -1) - - testDefaultApiServeMux := http.NewServeMux() - testDefaultApiServeMux.HandleFunc(_apiUrlPath, func(w http.ResponseWriter, req *http.Request) { - data := Instance{} - w.Header().Add("Content-Type", "application/json") - json.NewEncoder(w).Encode(data) - }) - testServer := httptest.NewServer(testDefaultApiServeMux) - defer testServer.Close() - - configuration := &config.Configuration{ - DefaultHeader: make(map[string]string), - UserAgent: "OpenAPI-Generator/1.0.0/go", - Debug: false, - Region: "test_region", - Servers: config.ServerConfigurations{ - { - URL: testServer.URL, - Description: "Localhost for git_DefaultApi", - Variables: map[string]config.ServerVariable{ - "region": { - DefaultValue: "test_region.", - EnumValues: []string{ - "test_region.", - }, - }, - }, - }, - }, - OperationServers: map[string]config.ServerConfigurations{}, - } - apiClient, err := NewAPIClient(config.WithCustomConfiguration(configuration), config.WithoutAuthentication()) - if err != nil { - t.Fatalf("creating API client: %v", err) - } - - projectId := projectIdValue - instanceId := instanceIdValue - patchInstancePayload := PatchInstancePayload{} - - resp, reqErr := apiClient.PatchInstance(context.Background(), projectId, instanceId).PatchInstancePayload(patchInstancePayload).Execute() - - if reqErr != nil { - t.Fatalf("error in call: %v", reqErr) - } - if IsNil(resp) { - t.Fatalf("response not present") - } - }) - -} diff --git a/services/git/client.go b/services/git/client.go index 0f0b765b2..1188a394b 100644 --- a/services/git/client.go +++ b/services/git/client.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -44,18 +45,21 @@ var ( // APIClient manages communication with the STACKIT Git API API v1beta.0.4 // 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() @@ -147,6 +151,7 @@ func typeCheckParameter(obj interface{}, expected string, name string) error { return nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func ParameterValueToString(obj interface{}, key string) string { if reflect.TypeOf(obj).Kind() != reflect.Ptr { return fmt.Sprintf("%v", obj) @@ -285,6 +290,7 @@ func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { // Allow modification of underlying config for alternate implementations and testing // Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (c *APIClient) GetConfig() *config.Configuration { return c.cfg } @@ -501,10 +507,7 @@ func addFile(w *multipart.Writer, fieldName, path string) error { if err != nil { return err } - err = file.Close() - if err != nil { - return err - } + defer file.Close() part, err := w.CreateFormFile(fieldName, filepath.Base(path)) if err != nil { @@ -598,6 +601,7 @@ func parseCacheControl(headers http.Header) cacheControl { } // CacheExpires helper function to determine remaining time before repeating a request. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func CacheExpires(r *http.Response) time.Time { // Figure out when the cache expires. var expires time.Time diff --git a/services/git/configuration.go b/services/git/configuration.go index e8ffc3ea7..97aae6a2a 100644 --- a/services/git/configuration.go +++ b/services/git/configuration.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -15,6 +16,7 @@ import ( ) // NewConfiguration returns a new Configuration object +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewConfiguration() *config.Configuration { cfg := &config.Configuration{ DefaultHeader: make(map[string]string), diff --git a/services/git/go.mod b/services/git/go.mod index ca9db67dd..b3a1f3797 100644 --- a/services/git/go.mod +++ b/services/git/go.mod @@ -5,7 +5,7 @@ go 1.21 require ( github.com/google/go-cmp v0.7.0 github.com/google/uuid v1.6.0 - github.com/stackitcloud/stackit-sdk-go/core v0.21.1 + github.com/stackitcloud/stackit-sdk-go/core v0.22.0 ) require github.com/golang-jwt/jwt/v5 v5.3.1 // indirect diff --git a/services/git/go.sum b/services/git/go.sum index ca103c909..195011dd5 100644 --- a/services/git/go.sum +++ b/services/git/go.sum @@ -4,5 +4,5 @@ github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8= github.com/google/go-cmp v0.7.0/go.mod h1:pXiqmnSA92OHEEa9HXL2W4E7lf9JzCmGVUdgjX3N/iU= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1 h1:Y/PcAgM7DPYMNqum0MLv4n1mF9ieuevzcCIZYQfm3Ts= -github.com/stackitcloud/stackit-sdk-go/core v0.21.1/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0 h1:6rViz7GnNwXSh51Lur5xuDzO8EWSZfN9J0HvEkBKq6c= +github.com/stackitcloud/stackit-sdk-go/core v0.22.0/go.mod h1:osMglDby4csGZ5sIfhNyYq1bS1TxIdPY88+skE/kkmI= diff --git a/services/git/model_already_exists_error.go b/services/git/model_already_exists_error.go new file mode 100644 index 000000000..2083901f8 --- /dev/null +++ b/services/git/model_already_exists_error.go @@ -0,0 +1,149 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the AlreadyExistsError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AlreadyExistsError{} + +/* + types and functions for message +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AlreadyExistsErrorGetMessageAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAlreadyExistsErrorGetMessageAttributeTypeOk(arg AlreadyExistsErrorGetMessageAttributeType) (ret AlreadyExistsErrorGetMessageRetType, 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 setAlreadyExistsErrorGetMessageAttributeType(arg *AlreadyExistsErrorGetMessageAttributeType, val AlreadyExistsErrorGetMessageRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AlreadyExistsErrorGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AlreadyExistsErrorGetMessageRetType = string + +// AlreadyExistsError Error response when a resource already exists. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AlreadyExistsError struct { + // REQUIRED + Message AlreadyExistsErrorGetMessageAttributeType `json:"message" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _AlreadyExistsError AlreadyExistsError + +// NewAlreadyExistsError instantiates a new AlreadyExistsError 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 NewAlreadyExistsError(message AlreadyExistsErrorGetMessageArgType) *AlreadyExistsError { + this := AlreadyExistsError{} + setAlreadyExistsErrorGetMessageAttributeType(&this.Message, message) + return &this +} + +// NewAlreadyExistsErrorWithDefaults instantiates a new AlreadyExistsError 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 NewAlreadyExistsErrorWithDefaults() *AlreadyExistsError { + this := AlreadyExistsError{} + return &this +} + +// GetMessage returns the Message field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *AlreadyExistsError) GetMessage() (ret AlreadyExistsErrorGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *AlreadyExistsError) GetMessageOk() (ret AlreadyExistsErrorGetMessageRetType, ok bool) { + return getAlreadyExistsErrorGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *AlreadyExistsError) SetMessage(v AlreadyExistsErrorGetMessageRetType) { + setAlreadyExistsErrorGetMessageAttributeType(&o.Message, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o AlreadyExistsError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAlreadyExistsErrorGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableAlreadyExistsError struct { + value *AlreadyExistsError + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableAlreadyExistsError) Get() *AlreadyExistsError { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableAlreadyExistsError) Set(val *AlreadyExistsError) { + 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 NullableAlreadyExistsError) 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 *NullableAlreadyExistsError) 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 NewNullableAlreadyExistsError(val *AlreadyExistsError) *NullableAlreadyExistsError { + return &NullableAlreadyExistsError{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 NullableAlreadyExistsError) 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 *NullableAlreadyExistsError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_instance_flavor_test.go b/services/git/model_already_exists_error_test.go similarity index 100% rename from services/git/model_instance_flavor_test.go rename to services/git/model_already_exists_error_test.go diff --git a/services/git/model_authentication.go b/services/git/model_authentication.go new file mode 100644 index 000000000..5291ed29d --- /dev/null +++ b/services/git/model_authentication.go @@ -0,0 +1,583 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" + "time" +) + +// checks if the Authentication type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Authentication{} + +/* + types and functions for auto_discover_url +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetAutoDiscoverUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetAutoDiscoverUrlAttributeTypeOk(arg AuthenticationGetAutoDiscoverUrlAttributeType) (ret AuthenticationGetAutoDiscoverUrlRetType, 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 setAuthenticationGetAutoDiscoverUrlAttributeType(arg *AuthenticationGetAutoDiscoverUrlAttributeType, val AuthenticationGetAutoDiscoverUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetAutoDiscoverUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetAutoDiscoverUrlRetType = string + +/* + types and functions for client_id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetClientIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetClientIdAttributeTypeOk(arg AuthenticationGetClientIdAttributeType) (ret AuthenticationGetClientIdRetType, 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 setAuthenticationGetClientIdAttributeType(arg *AuthenticationGetClientIdAttributeType, val AuthenticationGetClientIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetClientIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetClientIdRetType = string + +/* + types and functions for created_at +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetCreatedAtRetType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetCreatedAtAttributeTypeOk(arg AuthenticationGetCreatedAtAttributeType) (ret AuthenticationGetCreatedAtRetType, 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 setAuthenticationGetCreatedAtAttributeType(arg *AuthenticationGetCreatedAtAttributeType, val AuthenticationGetCreatedAtRetType) { + *arg = &val +} + +/* + types and functions for icon_url +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetIconUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetIconUrlAttributeTypeOk(arg AuthenticationGetIconUrlAttributeType) (ret AuthenticationGetIconUrlRetType, 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 setAuthenticationGetIconUrlAttributeType(arg *AuthenticationGetIconUrlAttributeType, val AuthenticationGetIconUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetIconUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetIconUrlRetType = 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 AuthenticationGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetIdAttributeTypeOk(arg AuthenticationGetIdAttributeType) (ret AuthenticationGetIdRetType, 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 setAuthenticationGetIdAttributeType(arg *AuthenticationGetIdAttributeType, val AuthenticationGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetIdRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetNameAttributeTypeOk(arg AuthenticationGetNameAttributeType) (ret AuthenticationGetNameRetType, 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 setAuthenticationGetNameAttributeType(arg *AuthenticationGetNameAttributeType, val AuthenticationGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetNameRetType = string + +/* + types and functions for provider +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetProviderAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetProviderAttributeTypeOk(arg AuthenticationGetProviderAttributeType) (ret AuthenticationGetProviderRetType, 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 setAuthenticationGetProviderAttributeType(arg *AuthenticationGetProviderAttributeType, val AuthenticationGetProviderRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetProviderArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetProviderRetType = string + +/* + types and functions for scopes +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetScopesAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetScopesAttributeTypeOk(arg AuthenticationGetScopesAttributeType) (ret AuthenticationGetScopesRetType, 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 setAuthenticationGetScopesAttributeType(arg *AuthenticationGetScopesAttributeType, val AuthenticationGetScopesRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetScopesArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetScopesRetType = string + +/* + types and functions for status +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetStatusAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationGetStatusAttributeTypeOk(arg AuthenticationGetStatusAttributeType) (ret AuthenticationGetStatusRetType, 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 setAuthenticationGetStatusAttributeType(arg *AuthenticationGetStatusAttributeType, val AuthenticationGetStatusRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationGetStatusRetType = string + +// Authentication Describes an authentication definition associated to a STACKIT Git instance. The provider type will be an openidConnect type. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type Authentication struct { + // The well-known configuration url to use for this authentication definition. + // REQUIRED + AutoDiscoverUrl AuthenticationGetAutoDiscoverUrlAttributeType `json:"auto_discover_url" required:"true"` + // The IDP client id to use. + // REQUIRED + ClientId AuthenticationGetClientIdAttributeType `json:"client_id" required:"true"` + // The date and time the creation of the authentication definition was triggered. + // REQUIRED + CreatedAt AuthenticationGetCreatedAtAttributeType `json:"created_at" required:"true"` + // The url of the icon to use for this authentication definition. + // REQUIRED + IconUrl AuthenticationGetIconUrlAttributeType `json:"icon_url" required:"true"` + // An auto generated unique uuid which identifies the authentication definition in STACKIT Git instances. + // REQUIRED + Id AuthenticationGetIdAttributeType `json:"id" required:"true"` + // The name to identify an authentication definition associated with a STACKIT Git instance. + // REQUIRED + Name AuthenticationGetNameAttributeType `json:"name" required:"true"` + // The Oauth2 provider to use. + // REQUIRED + Provider AuthenticationGetProviderAttributeType `json:"provider" required:"true"` + // Scopes defines the OIDC scopes to request. + // REQUIRED + Scopes AuthenticationGetScopesAttributeType `json:"scopes" required:"true"` + // The current status of the authentication definition. + // REQUIRED + Status AuthenticationGetStatusAttributeType `json:"status" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _Authentication Authentication + +// NewAuthentication instantiates a new Authentication 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 NewAuthentication(autoDiscoverUrl AuthenticationGetAutoDiscoverUrlArgType, clientId AuthenticationGetClientIdArgType, createdAt AuthenticationGetCreatedAtArgType, iconUrl AuthenticationGetIconUrlArgType, id AuthenticationGetIdArgType, name AuthenticationGetNameArgType, provider AuthenticationGetProviderArgType, scopes AuthenticationGetScopesArgType, status AuthenticationGetStatusArgType) *Authentication { + this := Authentication{} + setAuthenticationGetAutoDiscoverUrlAttributeType(&this.AutoDiscoverUrl, autoDiscoverUrl) + setAuthenticationGetClientIdAttributeType(&this.ClientId, clientId) + setAuthenticationGetCreatedAtAttributeType(&this.CreatedAt, createdAt) + setAuthenticationGetIconUrlAttributeType(&this.IconUrl, iconUrl) + setAuthenticationGetIdAttributeType(&this.Id, id) + setAuthenticationGetNameAttributeType(&this.Name, name) + setAuthenticationGetProviderAttributeType(&this.Provider, provider) + setAuthenticationGetScopesAttributeType(&this.Scopes, scopes) + setAuthenticationGetStatusAttributeType(&this.Status, status) + return &this +} + +// NewAuthenticationWithDefaults instantiates a new Authentication 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 NewAuthenticationWithDefaults() *Authentication { + this := Authentication{} + return &this +} + +// GetAutoDiscoverUrl returns the AutoDiscoverUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetAutoDiscoverUrl() (ret AuthenticationGetAutoDiscoverUrlRetType) { + ret, _ = o.GetAutoDiscoverUrlOk() + return ret +} + +// GetAutoDiscoverUrlOk returns a tuple with the AutoDiscoverUrl 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 *Authentication) GetAutoDiscoverUrlOk() (ret AuthenticationGetAutoDiscoverUrlRetType, ok bool) { + return getAuthenticationGetAutoDiscoverUrlAttributeTypeOk(o.AutoDiscoverUrl) +} + +// SetAutoDiscoverUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) SetAutoDiscoverUrl(v AuthenticationGetAutoDiscoverUrlRetType) { + setAuthenticationGetAutoDiscoverUrlAttributeType(&o.AutoDiscoverUrl, v) +} + +// GetClientId returns the ClientId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetClientId() (ret AuthenticationGetClientIdRetType) { + ret, _ = o.GetClientIdOk() + return ret +} + +// GetClientIdOk returns a tuple with the ClientId 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 *Authentication) GetClientIdOk() (ret AuthenticationGetClientIdRetType, ok bool) { + return getAuthenticationGetClientIdAttributeTypeOk(o.ClientId) +} + +// SetClientId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) SetClientId(v AuthenticationGetClientIdRetType) { + setAuthenticationGetClientIdAttributeType(&o.ClientId, v) +} + +// GetCreatedAt returns the CreatedAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetCreatedAt() (ret AuthenticationGetCreatedAtRetType) { + ret, _ = o.GetCreatedAtOk() + return ret +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetCreatedAtOk() (ret AuthenticationGetCreatedAtRetType, ok bool) { + return getAuthenticationGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// SetCreatedAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) SetCreatedAt(v AuthenticationGetCreatedAtRetType) { + setAuthenticationGetCreatedAtAttributeType(&o.CreatedAt, v) +} + +// GetIconUrl returns the IconUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetIconUrl() (ret AuthenticationGetIconUrlRetType) { + ret, _ = o.GetIconUrlOk() + return ret +} + +// GetIconUrlOk returns a tuple with the IconUrl 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 *Authentication) GetIconUrlOk() (ret AuthenticationGetIconUrlRetType, ok bool) { + return getAuthenticationGetIconUrlAttributeTypeOk(o.IconUrl) +} + +// SetIconUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) SetIconUrl(v AuthenticationGetIconUrlRetType) { + setAuthenticationGetIconUrlAttributeType(&o.IconUrl, 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 *Authentication) GetId() (ret AuthenticationGetIdRetType) { + 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 *Authentication) GetIdOk() (ret AuthenticationGetIdRetType, ok bool) { + return getAuthenticationGetIdAttributeTypeOk(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 *Authentication) SetId(v AuthenticationGetIdRetType) { + setAuthenticationGetIdAttributeType(&o.Id, v) +} + +// GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetName() (ret AuthenticationGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetNameOk() (ret AuthenticationGetNameRetType, ok bool) { + return getAuthenticationGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) SetName(v AuthenticationGetNameRetType) { + setAuthenticationGetNameAttributeType(&o.Name, v) +} + +// GetProvider returns the Provider field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetProvider() (ret AuthenticationGetProviderRetType) { + ret, _ = o.GetProviderOk() + return ret +} + +// GetProviderOk returns a tuple with the Provider 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 *Authentication) GetProviderOk() (ret AuthenticationGetProviderRetType, ok bool) { + return getAuthenticationGetProviderAttributeTypeOk(o.Provider) +} + +// SetProvider sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) SetProvider(v AuthenticationGetProviderRetType) { + setAuthenticationGetProviderAttributeType(&o.Provider, v) +} + +// GetScopes returns the Scopes field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) GetScopes() (ret AuthenticationGetScopesRetType) { + ret, _ = o.GetScopesOk() + return ret +} + +// GetScopesOk returns a tuple with the Scopes 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 *Authentication) GetScopesOk() (ret AuthenticationGetScopesRetType, ok bool) { + return getAuthenticationGetScopesAttributeTypeOk(o.Scopes) +} + +// SetScopes sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Authentication) SetScopes(v AuthenticationGetScopesRetType) { + setAuthenticationGetScopesAttributeType(&o.Scopes, 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 *Authentication) GetStatus() (ret AuthenticationGetStatusRetType) { + 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 *Authentication) GetStatusOk() (ret AuthenticationGetStatusRetType, ok bool) { + return getAuthenticationGetStatusAttributeTypeOk(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 *Authentication) SetStatus(v AuthenticationGetStatusRetType) { + setAuthenticationGetStatusAttributeType(&o.Status, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o Authentication) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAuthenticationGetAutoDiscoverUrlAttributeTypeOk(o.AutoDiscoverUrl); ok { + toSerialize["AutoDiscoverUrl"] = val + } + if val, ok := getAuthenticationGetClientIdAttributeTypeOk(o.ClientId); ok { + toSerialize["ClientId"] = val + } + if val, ok := getAuthenticationGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getAuthenticationGetIconUrlAttributeTypeOk(o.IconUrl); ok { + toSerialize["IconUrl"] = val + } + if val, ok := getAuthenticationGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getAuthenticationGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getAuthenticationGetProviderAttributeTypeOk(o.Provider); ok { + toSerialize["Provider"] = val + } + if val, ok := getAuthenticationGetScopesAttributeTypeOk(o.Scopes); ok { + toSerialize["Scopes"] = val + } + if val, ok := getAuthenticationGetStatusAttributeTypeOk(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 NullableAuthentication struct { + value *Authentication + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableAuthentication) Get() *Authentication { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableAuthentication) Set(val *Authentication) { + 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 NullableAuthentication) 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 *NullableAuthentication) 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 NewNullableAuthentication(val *Authentication) *NullableAuthentication { + return &NullableAuthentication{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 NullableAuthentication) 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 *NullableAuthentication) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_authentication_list.go b/services/git/model_authentication_list.go new file mode 100644 index 000000000..7d7f44e59 --- /dev/null +++ b/services/git/model_authentication_list.go @@ -0,0 +1,149 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the AuthenticationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticationList{} + +/* + types and functions for authentication +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationListGetAuthenticationAttributeType = *[]Authentication + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationListGetAuthenticationArgType = []Authentication + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationListGetAuthenticationRetType = []Authentication + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getAuthenticationListGetAuthenticationAttributeTypeOk(arg AuthenticationListGetAuthenticationAttributeType) (ret AuthenticationListGetAuthenticationRetType, 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 setAuthenticationListGetAuthenticationAttributeType(arg *AuthenticationListGetAuthenticationAttributeType, val AuthenticationListGetAuthenticationRetType) { + *arg = &val +} + +// AuthenticationList A list of authentications belonging to an Instance. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type AuthenticationList struct { + // REQUIRED + Authentication AuthenticationListGetAuthenticationAttributeType `json:"authentication" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _AuthenticationList AuthenticationList + +// NewAuthenticationList instantiates a new AuthenticationList 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 NewAuthenticationList(authentication AuthenticationListGetAuthenticationArgType) *AuthenticationList { + this := AuthenticationList{} + setAuthenticationListGetAuthenticationAttributeType(&this.Authentication, authentication) + return &this +} + +// NewAuthenticationListWithDefaults instantiates a new AuthenticationList 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 NewAuthenticationListWithDefaults() *AuthenticationList { + this := AuthenticationList{} + return &this +} + +// GetAuthentication returns the Authentication field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *AuthenticationList) GetAuthentication() (ret AuthenticationListGetAuthenticationRetType) { + ret, _ = o.GetAuthenticationOk() + return ret +} + +// GetAuthenticationOk returns a tuple with the Authentication 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 *AuthenticationList) GetAuthenticationOk() (ret AuthenticationListGetAuthenticationRetType, ok bool) { + return getAuthenticationListGetAuthenticationAttributeTypeOk(o.Authentication) +} + +// SetAuthentication sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *AuthenticationList) SetAuthentication(v AuthenticationListGetAuthenticationRetType) { + setAuthenticationListGetAuthenticationAttributeType(&o.Authentication, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o AuthenticationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getAuthenticationListGetAuthenticationAttributeTypeOk(o.Authentication); ok { + toSerialize["Authentication"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableAuthenticationList struct { + value *AuthenticationList + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableAuthenticationList) Get() *AuthenticationList { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableAuthenticationList) Set(val *AuthenticationList) { + 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 NullableAuthenticationList) 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 *NullableAuthenticationList) 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 NewNullableAuthenticationList(val *AuthenticationList) *NullableAuthenticationList { + return &NullableAuthenticationList{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 NullableAuthenticationList) 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 *NullableAuthenticationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_list_runner_labels_test.go b/services/git/model_authentication_list_test.go similarity index 100% rename from services/git/model_list_runner_labels_test.go rename to services/git/model_authentication_list_test.go diff --git a/services/git/model_runner_label_test.go b/services/git/model_authentication_test.go similarity index 100% rename from services/git/model_runner_label_test.go rename to services/git/model_authentication_test.go diff --git a/services/git/model_bad_error_response.go b/services/git/model_bad_error_response.go new file mode 100644 index 000000000..9d4a911e4 --- /dev/null +++ b/services/git/model_bad_error_response.go @@ -0,0 +1,209 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the BadErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BadErrorResponse{} + +/* + types and functions for details +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BadErrorResponseGetDetailsAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getBadErrorResponseGetDetailsAttributeTypeOk(arg BadErrorResponseGetDetailsAttributeType) (ret BadErrorResponseGetDetailsRetType, 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 setBadErrorResponseGetDetailsAttributeType(arg *BadErrorResponseGetDetailsAttributeType, val BadErrorResponseGetDetailsRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BadErrorResponseGetDetailsArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BadErrorResponseGetDetailsRetType = string + +/* + types and functions for error +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BadErrorResponseGetErrorAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getBadErrorResponseGetErrorAttributeTypeOk(arg BadErrorResponseGetErrorAttributeType) (ret BadErrorResponseGetErrorRetType, 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 setBadErrorResponseGetErrorAttributeType(arg *BadErrorResponseGetErrorAttributeType, val BadErrorResponseGetErrorRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BadErrorResponseGetErrorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BadErrorResponseGetErrorRetType = string + +// BadErrorResponse 400 Error Response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type BadErrorResponse struct { + Details BadErrorResponseGetDetailsAttributeType `json:"details,omitempty"` + Error BadErrorResponseGetErrorAttributeType `json:"error,omitempty"` +} + +// NewBadErrorResponse instantiates a new BadErrorResponse 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 NewBadErrorResponse() *BadErrorResponse { + this := BadErrorResponse{} + return &this +} + +// NewBadErrorResponseWithDefaults instantiates a new BadErrorResponse 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 NewBadErrorResponseWithDefaults() *BadErrorResponse { + this := BadErrorResponse{} + return &this +} + +// GetDetails returns the Details 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 *BadErrorResponse) GetDetails() (res BadErrorResponseGetDetailsRetType) { + res, _ = o.GetDetailsOk() + return +} + +// GetDetailsOk returns a tuple with the Details 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 *BadErrorResponse) GetDetailsOk() (ret BadErrorResponseGetDetailsRetType, ok bool) { + return getBadErrorResponseGetDetailsAttributeTypeOk(o.Details) +} + +// HasDetails 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 *BadErrorResponse) HasDetails() bool { + _, ok := o.GetDetailsOk() + return ok +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BadErrorResponse) SetDetails(v BadErrorResponseGetDetailsRetType) { + setBadErrorResponseGetDetailsAttributeType(&o.Details, v) +} + +// GetError returns the Error 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 *BadErrorResponse) GetError() (res BadErrorResponseGetErrorRetType) { + res, _ = o.GetErrorOk() + return +} + +// GetErrorOk returns a tuple with the Error 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 *BadErrorResponse) GetErrorOk() (ret BadErrorResponseGetErrorRetType, ok bool) { + return getBadErrorResponseGetErrorAttributeTypeOk(o.Error) +} + +// HasError 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 *BadErrorResponse) HasError() bool { + _, ok := o.GetErrorOk() + return ok +} + +// SetError gets a reference to the given string and assigns it to the Error field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *BadErrorResponse) SetError(v BadErrorResponseGetErrorRetType) { + setBadErrorResponseGetErrorAttributeType(&o.Error, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o BadErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getBadErrorResponseGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val + } + if val, ok := getBadErrorResponseGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableBadErrorResponse struct { + value *BadErrorResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableBadErrorResponse) Get() *BadErrorResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableBadErrorResponse) Set(val *BadErrorResponse) { + 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 NullableBadErrorResponse) 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 *NullableBadErrorResponse) 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 NewNullableBadErrorResponse(val *BadErrorResponse) *NullableBadErrorResponse { + return &NullableBadErrorResponse{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 NullableBadErrorResponse) 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 *NullableBadErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_unauthorized_response_test.go b/services/git/model_bad_error_response_test.go similarity index 100% rename from services/git/model_unauthorized_response_test.go rename to services/git/model_bad_error_response_test.go diff --git a/services/git/model_conflict_error_response.go b/services/git/model_conflict_error_response.go new file mode 100644 index 000000000..bd30dabe2 --- /dev/null +++ b/services/git/model_conflict_error_response.go @@ -0,0 +1,209 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the ConflictErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConflictErrorResponse{} + +/* + types and functions for details +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConflictErrorResponseGetDetailsAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getConflictErrorResponseGetDetailsAttributeTypeOk(arg ConflictErrorResponseGetDetailsAttributeType) (ret ConflictErrorResponseGetDetailsRetType, 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 setConflictErrorResponseGetDetailsAttributeType(arg *ConflictErrorResponseGetDetailsAttributeType, val ConflictErrorResponseGetDetailsRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConflictErrorResponseGetDetailsArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConflictErrorResponseGetDetailsRetType = string + +/* + types and functions for error +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConflictErrorResponseGetErrorAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getConflictErrorResponseGetErrorAttributeTypeOk(arg ConflictErrorResponseGetErrorAttributeType) (ret ConflictErrorResponseGetErrorRetType, 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 setConflictErrorResponseGetErrorAttributeType(arg *ConflictErrorResponseGetErrorAttributeType, val ConflictErrorResponseGetErrorRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConflictErrorResponseGetErrorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConflictErrorResponseGetErrorRetType = string + +// ConflictErrorResponse 409 Error Response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type ConflictErrorResponse struct { + Details ConflictErrorResponseGetDetailsAttributeType `json:"details,omitempty"` + Error ConflictErrorResponseGetErrorAttributeType `json:"error,omitempty"` +} + +// NewConflictErrorResponse instantiates a new ConflictErrorResponse 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 NewConflictErrorResponse() *ConflictErrorResponse { + this := ConflictErrorResponse{} + return &this +} + +// NewConflictErrorResponseWithDefaults instantiates a new ConflictErrorResponse 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 NewConflictErrorResponseWithDefaults() *ConflictErrorResponse { + this := ConflictErrorResponse{} + return &this +} + +// GetDetails returns the Details 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 *ConflictErrorResponse) GetDetails() (res ConflictErrorResponseGetDetailsRetType) { + res, _ = o.GetDetailsOk() + return +} + +// GetDetailsOk returns a tuple with the Details 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 *ConflictErrorResponse) GetDetailsOk() (ret ConflictErrorResponseGetDetailsRetType, ok bool) { + return getConflictErrorResponseGetDetailsAttributeTypeOk(o.Details) +} + +// HasDetails 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 *ConflictErrorResponse) HasDetails() bool { + _, ok := o.GetDetailsOk() + return ok +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ConflictErrorResponse) SetDetails(v ConflictErrorResponseGetDetailsRetType) { + setConflictErrorResponseGetDetailsAttributeType(&o.Details, v) +} + +// GetError returns the Error 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 *ConflictErrorResponse) GetError() (res ConflictErrorResponseGetErrorRetType) { + res, _ = o.GetErrorOk() + return +} + +// GetErrorOk returns a tuple with the Error 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 *ConflictErrorResponse) GetErrorOk() (ret ConflictErrorResponseGetErrorRetType, ok bool) { + return getConflictErrorResponseGetErrorAttributeTypeOk(o.Error) +} + +// HasError 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 *ConflictErrorResponse) HasError() bool { + _, ok := o.GetErrorOk() + return ok +} + +// SetError gets a reference to the given string and assigns it to the Error field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *ConflictErrorResponse) SetError(v ConflictErrorResponseGetErrorRetType) { + setConflictErrorResponseGetErrorAttributeType(&o.Error, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o ConflictErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getConflictErrorResponseGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val + } + if val, ok := getConflictErrorResponseGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableConflictErrorResponse struct { + value *ConflictErrorResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableConflictErrorResponse) Get() *ConflictErrorResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableConflictErrorResponse) Set(val *ConflictErrorResponse) { + 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 NullableConflictErrorResponse) 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 *NullableConflictErrorResponse) 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 NewNullableConflictErrorResponse(val *ConflictErrorResponse) *NullableConflictErrorResponse { + return &NullableConflictErrorResponse{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 NullableConflictErrorResponse) 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 *NullableConflictErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_conflict_error_response_test.go b/services/git/model_conflict_error_response_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_conflict_error_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_create_authentication_payload.go b/services/git/model_create_authentication_payload.go new file mode 100644 index 000000000..77fead5ce --- /dev/null +++ b/services/git/model_create_authentication_payload.go @@ -0,0 +1,493 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the CreateAuthenticationPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAuthenticationPayload{} + +/* + types and functions for auto_discover_url +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetAutoDiscoverUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateAuthenticationPayloadGetAutoDiscoverUrlAttributeTypeOk(arg CreateAuthenticationPayloadGetAutoDiscoverUrlAttributeType) (ret CreateAuthenticationPayloadGetAutoDiscoverUrlRetType, 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 setCreateAuthenticationPayloadGetAutoDiscoverUrlAttributeType(arg *CreateAuthenticationPayloadGetAutoDiscoverUrlAttributeType, val CreateAuthenticationPayloadGetAutoDiscoverUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetAutoDiscoverUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetAutoDiscoverUrlRetType = string + +/* + types and functions for client_id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetClientIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateAuthenticationPayloadGetClientIdAttributeTypeOk(arg CreateAuthenticationPayloadGetClientIdAttributeType) (ret CreateAuthenticationPayloadGetClientIdRetType, 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 setCreateAuthenticationPayloadGetClientIdAttributeType(arg *CreateAuthenticationPayloadGetClientIdAttributeType, val CreateAuthenticationPayloadGetClientIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetClientIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetClientIdRetType = string + +/* + types and functions for client_secret +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetClientSecretAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateAuthenticationPayloadGetClientSecretAttributeTypeOk(arg CreateAuthenticationPayloadGetClientSecretAttributeType) (ret CreateAuthenticationPayloadGetClientSecretRetType, 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 setCreateAuthenticationPayloadGetClientSecretAttributeType(arg *CreateAuthenticationPayloadGetClientSecretAttributeType, val CreateAuthenticationPayloadGetClientSecretRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetClientSecretArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetClientSecretRetType = string + +/* + types and functions for icon_url +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetIconUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateAuthenticationPayloadGetIconUrlAttributeTypeOk(arg CreateAuthenticationPayloadGetIconUrlAttributeType) (ret CreateAuthenticationPayloadGetIconUrlRetType, 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 setCreateAuthenticationPayloadGetIconUrlAttributeType(arg *CreateAuthenticationPayloadGetIconUrlAttributeType, val CreateAuthenticationPayloadGetIconUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetIconUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetIconUrlRetType = string + +/* + types and functions for name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateAuthenticationPayloadGetNameAttributeTypeOk(arg CreateAuthenticationPayloadGetNameAttributeType) (ret CreateAuthenticationPayloadGetNameRetType, 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 setCreateAuthenticationPayloadGetNameAttributeType(arg *CreateAuthenticationPayloadGetNameAttributeType, val CreateAuthenticationPayloadGetNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetNameRetType = string + +/* + types and functions for provider +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetProviderAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateAuthenticationPayloadGetProviderAttributeTypeOk(arg CreateAuthenticationPayloadGetProviderAttributeType) (ret CreateAuthenticationPayloadGetProviderRetType, 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 setCreateAuthenticationPayloadGetProviderAttributeType(arg *CreateAuthenticationPayloadGetProviderAttributeType, val CreateAuthenticationPayloadGetProviderRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetProviderArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetProviderRetType = string + +/* + types and functions for scopes +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetScopesAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateAuthenticationPayloadGetScopesAttributeTypeOk(arg CreateAuthenticationPayloadGetScopesAttributeType) (ret CreateAuthenticationPayloadGetScopesRetType, 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 setCreateAuthenticationPayloadGetScopesAttributeType(arg *CreateAuthenticationPayloadGetScopesAttributeType, val CreateAuthenticationPayloadGetScopesRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetScopesArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayloadGetScopesRetType = string + +// CreateAuthenticationPayload Properties to patch on an authentication. All fields are optional. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateAuthenticationPayload struct { + // The well-known configuration url to use for this authentication definition. + // REQUIRED + AutoDiscoverUrl CreateAuthenticationPayloadGetAutoDiscoverUrlAttributeType `json:"auto_discover_url" required:"true"` + // The IDP client id to use. + // REQUIRED + ClientId CreateAuthenticationPayloadGetClientIdAttributeType `json:"client_id" required:"true"` + // The IDP client secret to use. + // REQUIRED + ClientSecret CreateAuthenticationPayloadGetClientSecretAttributeType `json:"client_secret" required:"true"` + // The url of the icon to use for this authentication definition. + IconUrl CreateAuthenticationPayloadGetIconUrlAttributeType `json:"icon_url,omitempty"` + // The name to identify an authentication definition associated with a STACKIT Git instance. + // REQUIRED + Name CreateAuthenticationPayloadGetNameAttributeType `json:"name" required:"true"` + // The Oauth2 provider to use. + Provider CreateAuthenticationPayloadGetProviderAttributeType `json:"provider,omitempty"` + // Scopes defines the OIDC scopes to request. + Scopes CreateAuthenticationPayloadGetScopesAttributeType `json:"scopes,omitempty"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CreateAuthenticationPayload CreateAuthenticationPayload + +// NewCreateAuthenticationPayload instantiates a new CreateAuthenticationPayload 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 NewCreateAuthenticationPayload(autoDiscoverUrl CreateAuthenticationPayloadGetAutoDiscoverUrlArgType, clientId CreateAuthenticationPayloadGetClientIdArgType, clientSecret CreateAuthenticationPayloadGetClientSecretArgType, name CreateAuthenticationPayloadGetNameArgType) *CreateAuthenticationPayload { + this := CreateAuthenticationPayload{} + setCreateAuthenticationPayloadGetAutoDiscoverUrlAttributeType(&this.AutoDiscoverUrl, autoDiscoverUrl) + setCreateAuthenticationPayloadGetClientIdAttributeType(&this.ClientId, clientId) + setCreateAuthenticationPayloadGetClientSecretAttributeType(&this.ClientSecret, clientSecret) + setCreateAuthenticationPayloadGetNameAttributeType(&this.Name, name) + return &this +} + +// NewCreateAuthenticationPayloadWithDefaults instantiates a new CreateAuthenticationPayload 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 NewCreateAuthenticationPayloadWithDefaults() *CreateAuthenticationPayload { + this := CreateAuthenticationPayload{} + var provider string = "openidConnect" + this.Provider = &provider + var scopes string = "openid profile email" + this.Scopes = &scopes + return &this +} + +// GetAutoDiscoverUrl returns the AutoDiscoverUrl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) GetAutoDiscoverUrl() (ret CreateAuthenticationPayloadGetAutoDiscoverUrlRetType) { + ret, _ = o.GetAutoDiscoverUrlOk() + return ret +} + +// GetAutoDiscoverUrlOk returns a tuple with the AutoDiscoverUrl 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 *CreateAuthenticationPayload) GetAutoDiscoverUrlOk() (ret CreateAuthenticationPayloadGetAutoDiscoverUrlRetType, ok bool) { + return getCreateAuthenticationPayloadGetAutoDiscoverUrlAttributeTypeOk(o.AutoDiscoverUrl) +} + +// SetAutoDiscoverUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) SetAutoDiscoverUrl(v CreateAuthenticationPayloadGetAutoDiscoverUrlRetType) { + setCreateAuthenticationPayloadGetAutoDiscoverUrlAttributeType(&o.AutoDiscoverUrl, v) +} + +// GetClientId returns the ClientId field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) GetClientId() (ret CreateAuthenticationPayloadGetClientIdRetType) { + ret, _ = o.GetClientIdOk() + return ret +} + +// GetClientIdOk returns a tuple with the ClientId 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 *CreateAuthenticationPayload) GetClientIdOk() (ret CreateAuthenticationPayloadGetClientIdRetType, ok bool) { + return getCreateAuthenticationPayloadGetClientIdAttributeTypeOk(o.ClientId) +} + +// SetClientId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) SetClientId(v CreateAuthenticationPayloadGetClientIdRetType) { + setCreateAuthenticationPayloadGetClientIdAttributeType(&o.ClientId, v) +} + +// GetClientSecret returns the ClientSecret field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) GetClientSecret() (ret CreateAuthenticationPayloadGetClientSecretRetType) { + ret, _ = o.GetClientSecretOk() + return ret +} + +// GetClientSecretOk returns a tuple with the ClientSecret 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 *CreateAuthenticationPayload) GetClientSecretOk() (ret CreateAuthenticationPayloadGetClientSecretRetType, ok bool) { + return getCreateAuthenticationPayloadGetClientSecretAttributeTypeOk(o.ClientSecret) +} + +// SetClientSecret sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) SetClientSecret(v CreateAuthenticationPayloadGetClientSecretRetType) { + setCreateAuthenticationPayloadGetClientSecretAttributeType(&o.ClientSecret, v) +} + +// GetIconUrl returns the IconUrl 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 *CreateAuthenticationPayload) GetIconUrl() (res CreateAuthenticationPayloadGetIconUrlRetType) { + res, _ = o.GetIconUrlOk() + return +} + +// GetIconUrlOk returns a tuple with the IconUrl 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 *CreateAuthenticationPayload) GetIconUrlOk() (ret CreateAuthenticationPayloadGetIconUrlRetType, ok bool) { + return getCreateAuthenticationPayloadGetIconUrlAttributeTypeOk(o.IconUrl) +} + +// HasIconUrl 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 *CreateAuthenticationPayload) HasIconUrl() bool { + _, ok := o.GetIconUrlOk() + return ok +} + +// SetIconUrl gets a reference to the given string and assigns it to the IconUrl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) SetIconUrl(v CreateAuthenticationPayloadGetIconUrlRetType) { + setCreateAuthenticationPayloadGetIconUrlAttributeType(&o.IconUrl, v) +} + +// GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) GetName() (ret CreateAuthenticationPayloadGetNameRetType) { + ret, _ = o.GetNameOk() + return ret +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) GetNameOk() (ret CreateAuthenticationPayloadGetNameRetType, ok bool) { + return getCreateAuthenticationPayloadGetNameAttributeTypeOk(o.Name) +} + +// SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) SetName(v CreateAuthenticationPayloadGetNameRetType) { + setCreateAuthenticationPayloadGetNameAttributeType(&o.Name, v) +} + +// GetProvider returns the Provider 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 *CreateAuthenticationPayload) GetProvider() (res CreateAuthenticationPayloadGetProviderRetType) { + res, _ = o.GetProviderOk() + return +} + +// GetProviderOk returns a tuple with the Provider 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 *CreateAuthenticationPayload) GetProviderOk() (ret CreateAuthenticationPayloadGetProviderRetType, ok bool) { + return getCreateAuthenticationPayloadGetProviderAttributeTypeOk(o.Provider) +} + +// HasProvider 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 *CreateAuthenticationPayload) HasProvider() bool { + _, ok := o.GetProviderOk() + return ok +} + +// SetProvider gets a reference to the given string and assigns it to the Provider field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) SetProvider(v CreateAuthenticationPayloadGetProviderRetType) { + setCreateAuthenticationPayloadGetProviderAttributeType(&o.Provider, v) +} + +// GetScopes returns the Scopes 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 *CreateAuthenticationPayload) GetScopes() (res CreateAuthenticationPayloadGetScopesRetType) { + res, _ = o.GetScopesOk() + return +} + +// GetScopesOk returns a tuple with the Scopes 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 *CreateAuthenticationPayload) GetScopesOk() (ret CreateAuthenticationPayloadGetScopesRetType, ok bool) { + return getCreateAuthenticationPayloadGetScopesAttributeTypeOk(o.Scopes) +} + +// HasScopes 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 *CreateAuthenticationPayload) HasScopes() bool { + _, ok := o.GetScopesOk() + return ok +} + +// SetScopes gets a reference to the given string and assigns it to the Scopes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateAuthenticationPayload) SetScopes(v CreateAuthenticationPayloadGetScopesRetType) { + setCreateAuthenticationPayloadGetScopesAttributeType(&o.Scopes, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateAuthenticationPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateAuthenticationPayloadGetAutoDiscoverUrlAttributeTypeOk(o.AutoDiscoverUrl); ok { + toSerialize["AutoDiscoverUrl"] = val + } + if val, ok := getCreateAuthenticationPayloadGetClientIdAttributeTypeOk(o.ClientId); ok { + toSerialize["ClientId"] = val + } + if val, ok := getCreateAuthenticationPayloadGetClientSecretAttributeTypeOk(o.ClientSecret); ok { + toSerialize["ClientSecret"] = val + } + if val, ok := getCreateAuthenticationPayloadGetIconUrlAttributeTypeOk(o.IconUrl); ok { + toSerialize["IconUrl"] = val + } + if val, ok := getCreateAuthenticationPayloadGetNameAttributeTypeOk(o.Name); ok { + toSerialize["Name"] = val + } + if val, ok := getCreateAuthenticationPayloadGetProviderAttributeTypeOk(o.Provider); ok { + toSerialize["Provider"] = val + } + if val, ok := getCreateAuthenticationPayloadGetScopesAttributeTypeOk(o.Scopes); ok { + toSerialize["Scopes"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateAuthenticationPayload struct { + value *CreateAuthenticationPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateAuthenticationPayload) Get() *CreateAuthenticationPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateAuthenticationPayload) Set(val *CreateAuthenticationPayload) { + 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 NullableCreateAuthenticationPayload) 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 *NullableCreateAuthenticationPayload) 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 NewNullableCreateAuthenticationPayload(val *CreateAuthenticationPayload) *NullableCreateAuthenticationPayload { + return &NullableCreateAuthenticationPayload{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 NullableCreateAuthenticationPayload) 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 *NullableCreateAuthenticationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_create_authentication_payload_test.go b/services/git/model_create_authentication_payload_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_create_authentication_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_create_instance_payload.go b/services/git/model_create_instance_payload.go index 408be85f5..40926a74d 100644 --- a/services/git/model_create_instance_payload.go +++ b/services/git/model_create_instance_payload.go @@ -8,10 +8,12 @@ API version: 1beta.0.4 // 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 git import ( "encoding/json" + "fmt" ) // checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time @@ -22,10 +24,16 @@ var _ MappedNullable = &CreateInstancePayload{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetAclAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetAclArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetAclRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetAclAttributeTypeOk(arg CreateInstancePayloadGetAclAttributeType) (ret CreateInstancePayloadGetAclRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +41,7 @@ func getCreateInstancePayloadGetAclAttributeTypeOk(arg CreateInstancePayloadGetA return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetAclAttributeType(arg *CreateInstancePayloadGetAclAttributeType, val CreateInstancePayloadGetAclRetType) { *arg = &val } @@ -41,11 +50,137 @@ func setCreateInstancePayloadGetAclAttributeType(arg *CreateInstancePayloadGetAc types and functions for flavor */ -// isEnumRef -type CreateInstancePayloadGetFlavorAttributeType = *InstanceFlavor -type CreateInstancePayloadGetFlavorArgType = InstanceFlavor -type CreateInstancePayloadGetFlavorRetType = InstanceFlavor +// isEnum + +// CreateInstancePayloadFlavor the model 'CreateInstancePayload' +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateInstancePayloadFlavor string + +// List of Flavor +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CREATEINSTANCEPAYLOADFLAVOR__10 CreateInstancePayloadFlavor = "git-10" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + CREATEINSTANCEPAYLOADFLAVOR__100 CreateInstancePayloadFlavor = "git-100" +) + +// All allowed values of CreateInstancePayload enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedCreateInstancePayloadFlavorEnumValues = []CreateInstancePayloadFlavor{ + "git-10", + "git-100", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *CreateInstancePayloadFlavor) 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 CreateInstancePayloadFlavor + 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 := CreateInstancePayloadFlavor(value) + for _, existing := range AllowedCreateInstancePayloadFlavorEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid CreateInstancePayload", value) +} + +// NewCreateInstancePayloadFlavorFromValue returns a pointer to a valid CreateInstancePayloadFlavor +// 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 NewCreateInstancePayloadFlavorFromValue(v CreateInstancePayloadFlavor) (*CreateInstancePayloadFlavor, error) { + ev := CreateInstancePayloadFlavor(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for CreateInstancePayloadFlavor: valid values are %v", v, AllowedCreateInstancePayloadFlavorEnumValues) + } +} +// 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 CreateInstancePayloadFlavor) IsValid() bool { + for _, existing := range AllowedCreateInstancePayloadFlavorEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to FlavorFlavor value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v CreateInstancePayloadFlavor) Ptr() *CreateInstancePayloadFlavor { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateInstancePayloadFlavor struct { + value *CreateInstancePayloadFlavor + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateInstancePayloadFlavor) Get() *CreateInstancePayloadFlavor { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateInstancePayloadFlavor) Set(val *CreateInstancePayloadFlavor) { + 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 NullableCreateInstancePayloadFlavor) 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 *NullableCreateInstancePayloadFlavor) 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 NewNullableCreateInstancePayloadFlavor(val *CreateInstancePayloadFlavor) *NullableCreateInstancePayloadFlavor { + return &NullableCreateInstancePayloadFlavor{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 NullableCreateInstancePayloadFlavor) 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 *NullableCreateInstancePayloadFlavor) 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 CreateInstancePayloadGetFlavorAttributeType = *CreateInstancePayloadFlavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateInstancePayloadGetFlavorArgType = CreateInstancePayloadFlavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateInstancePayloadGetFlavorRetType = CreateInstancePayloadFlavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetFlavorAttributeTypeOk(arg CreateInstancePayloadGetFlavorAttributeType) (ret CreateInstancePayloadGetFlavorRetType, ok bool) { if arg == nil { return ret, false @@ -53,6 +188,7 @@ func getCreateInstancePayloadGetFlavorAttributeTypeOk(arg CreateInstancePayloadG return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetFlavorAttributeType(arg *CreateInstancePayloadGetFlavorAttributeType, val CreateInstancePayloadGetFlavorRetType) { *arg = &val } @@ -62,8 +198,10 @@ func setCreateInstancePayloadGetFlavorAttributeType(arg *CreateInstancePayloadGe */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getCreateInstancePayloadGetNameAttributeTypeOk(arg CreateInstancePayloadGetNameAttributeType) (ret CreateInstancePayloadGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -71,14 +209,19 @@ func getCreateInstancePayloadGetNameAttributeTypeOk(arg CreateInstancePayloadGet return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setCreateInstancePayloadGetNameAttributeType(arg *CreateInstancePayloadGetNameAttributeType, val CreateInstancePayloadGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayloadGetNameRetType = string // CreateInstancePayload Request a STACKIT Git instance to be created with these properties. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type CreateInstancePayload struct { // A list of CIDR network addresses that are allowed to access the instance. Acl CreateInstancePayloadGetAclAttributeType `json:"acl,omitempty"` @@ -88,12 +231,14 @@ type CreateInstancePayload struct { Name CreateInstancePayloadGetNameAttributeType `json:"name" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _CreateInstancePayload CreateInstancePayload // NewCreateInstancePayload instantiates a new CreateInstancePayload object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateInstancePayload(name CreateInstancePayloadGetNameArgType) *CreateInstancePayload { this := CreateInstancePayload{} setCreateInstancePayloadGetNameAttributeType(&this.Name, name) @@ -103,12 +248,14 @@ func NewCreateInstancePayload(name CreateInstancePayloadGetNameArgType) *CreateI // NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { this := CreateInstancePayload{} return &this } // 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 *CreateInstancePayload) GetAcl() (res CreateInstancePayloadGetAclRetType) { res, _ = o.GetAclOk() return @@ -116,22 +263,26 @@ func (o *CreateInstancePayload) GetAcl() (res CreateInstancePayloadGetAclRetType // 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 *CreateInstancePayload) GetAclOk() (ret CreateInstancePayloadGetAclRetType, ok bool) { return getCreateInstancePayloadGetAclAttributeTypeOk(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 *CreateInstancePayload) 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 *CreateInstancePayload) SetAcl(v CreateInstancePayloadGetAclRetType) { setCreateInstancePayloadGetAclAttributeType(&o.Acl, v) } // GetFlavor returns the Flavor field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetFlavor() (res CreateInstancePayloadGetFlavorRetType) { res, _ = o.GetFlavorOk() return @@ -139,22 +290,26 @@ func (o *CreateInstancePayload) GetFlavor() (res CreateInstancePayloadGetFlavorR // GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetFlavorOk() (ret CreateInstancePayloadGetFlavorRetType, ok bool) { return getCreateInstancePayloadGetFlavorAttributeTypeOk(o.Flavor) } // HasFlavor returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) HasFlavor() bool { _, ok := o.GetFlavorOk() return ok } -// SetFlavor gets a reference to the given InstanceFlavor and assigns it to the Flavor field. +// SetFlavor gets a reference to the given string and assigns it to the Flavor field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetFlavor(v CreateInstancePayloadGetFlavorRetType) { setCreateInstancePayloadGetFlavorAttributeType(&o.Flavor, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetName() (ret CreateInstancePayloadGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -162,15 +317,18 @@ func (o *CreateInstancePayload) GetName() (ret CreateInstancePayloadGetNameRetTy // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) GetNameOk() (ret CreateInstancePayloadGetNameRetType, ok bool) { return getCreateInstancePayloadGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *CreateInstancePayload) SetName(v CreateInstancePayloadGetNameRetType) { setCreateInstancePayloadGetNameAttributeType(&o.Name, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getCreateInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { @@ -185,37 +343,45 @@ func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableCreateInstancePayload struct { value *CreateInstancePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateInstancePayload) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateInstancePayload) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { return &NullableCreateInstancePayload{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_create_instance_payload_test.go b/services/git/model_create_instance_payload_test.go index e39c866ed..f0259f88f 100644 --- a/services/git/model_create_instance_payload_test.go +++ b/services/git/model_create_instance_payload_test.go @@ -9,3 +9,50 @@ API version: 1beta.0.4 // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package git + +import ( + "testing" +) + +// isEnum + +func TestCreateInstancePayloadFlavor_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(`"git-10"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"git-100"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := CreateInstancePayloadFlavor("") + 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/git/model_create_runner_payload.go b/services/git/model_create_runner_payload.go new file mode 100644 index 000000000..9e57f8da0 --- /dev/null +++ b/services/git/model_create_runner_payload.go @@ -0,0 +1,149 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the CreateRunnerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateRunnerPayload{} + +/* + types and functions for labels +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateRunnerPayloadGetLabelsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateRunnerPayloadGetLabelsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateRunnerPayloadGetLabelsRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getCreateRunnerPayloadGetLabelsAttributeTypeOk(arg CreateRunnerPayloadGetLabelsAttributeType) (ret CreateRunnerPayloadGetLabelsRetType, 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 setCreateRunnerPayloadGetLabelsAttributeType(arg *CreateRunnerPayloadGetLabelsAttributeType, val CreateRunnerPayloadGetLabelsRetType) { + *arg = &val +} + +// CreateRunnerPayload Request a runner to be created supporting the requested list of runtime labels. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type CreateRunnerPayload struct { + // REQUIRED + Labels CreateRunnerPayloadGetLabelsAttributeType `json:"labels" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _CreateRunnerPayload CreateRunnerPayload + +// NewCreateRunnerPayload instantiates a new CreateRunnerPayload 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 NewCreateRunnerPayload(labels CreateRunnerPayloadGetLabelsArgType) *CreateRunnerPayload { + this := CreateRunnerPayload{} + setCreateRunnerPayloadGetLabelsAttributeType(&this.Labels, labels) + return &this +} + +// NewCreateRunnerPayloadWithDefaults instantiates a new CreateRunnerPayload 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 NewCreateRunnerPayloadWithDefaults() *CreateRunnerPayload { + this := CreateRunnerPayload{} + return &this +} + +// GetLabels returns the Labels field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateRunnerPayload) GetLabels() (ret CreateRunnerPayloadGetLabelsRetType) { + ret, _ = o.GetLabelsOk() + return ret +} + +// GetLabelsOk returns a tuple with the Labels 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 *CreateRunnerPayload) GetLabelsOk() (ret CreateRunnerPayloadGetLabelsRetType, ok bool) { + return getCreateRunnerPayloadGetLabelsAttributeTypeOk(o.Labels) +} + +// SetLabels sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *CreateRunnerPayload) SetLabels(v CreateRunnerPayloadGetLabelsRetType) { + setCreateRunnerPayloadGetLabelsAttributeType(&o.Labels, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o CreateRunnerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getCreateRunnerPayloadGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableCreateRunnerPayload struct { + value *CreateRunnerPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableCreateRunnerPayload) Get() *CreateRunnerPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableCreateRunnerPayload) Set(val *CreateRunnerPayload) { + 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 NullableCreateRunnerPayload) 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 *NullableCreateRunnerPayload) 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 NewNullableCreateRunnerPayload(val *CreateRunnerPayload) *NullableCreateRunnerPayload { + return &NullableCreateRunnerPayload{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 NullableCreateRunnerPayload) 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 *NullableCreateRunnerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_create_runner_payload_test.go b/services/git/model_create_runner_payload_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_create_runner_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_feature_toggle.go b/services/git/model_feature_toggle.go new file mode 100644 index 000000000..b2255d409 --- /dev/null +++ b/services/git/model_feature_toggle.go @@ -0,0 +1,436 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" + "fmt" +) + +// checks if the FeatureToggle type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FeatureToggle{} + +/* + types and functions for default_email_notifications +*/ + +// isEnum + +// FeatureToggleDefaultEmailNotifications Default email notifications. +// value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureToggleDefaultEmailNotifications string + +// List of DefaultEmailNotifications +const ( + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FEATURETOGGLEDEFAULT_EMAIL_NOTIFICATIONS_ENABLED FeatureToggleDefaultEmailNotifications = "enabled" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FEATURETOGGLEDEFAULT_EMAIL_NOTIFICATIONS_DISABLED FeatureToggleDefaultEmailNotifications = "disabled" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FEATURETOGGLEDEFAULT_EMAIL_NOTIFICATIONS_ONMENTION FeatureToggleDefaultEmailNotifications = "onmention" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FEATURETOGGLEDEFAULT_EMAIL_NOTIFICATIONS_ANDYOUROWN FeatureToggleDefaultEmailNotifications = "andyourown" +) + +// All allowed values of FeatureToggle enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +var AllowedFeatureToggleDefaultEmailNotificationsEnumValues = []FeatureToggleDefaultEmailNotifications{ + "enabled", + "disabled", + "onmention", + "andyourown", +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *FeatureToggleDefaultEmailNotifications) 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 FeatureToggleDefaultEmailNotifications + 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 := FeatureToggleDefaultEmailNotifications(value) + for _, existing := range AllowedFeatureToggleDefaultEmailNotificationsEnumValues { + if existing == enumTypeValue { + *v = enumTypeValue + return nil + } + } + + return fmt.Errorf("%+v is not a valid FeatureToggle", value) +} + +// NewFeatureToggleDefaultEmailNotificationsFromValue returns a pointer to a valid FeatureToggleDefaultEmailNotifications +// 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 NewFeatureToggleDefaultEmailNotificationsFromValue(v FeatureToggleDefaultEmailNotifications) (*FeatureToggleDefaultEmailNotifications, error) { + ev := FeatureToggleDefaultEmailNotifications(v) + if ev.IsValid() { + return &ev, nil + } else { + return nil, fmt.Errorf("invalid value '%v' for FeatureToggleDefaultEmailNotifications: valid values are %v", v, AllowedFeatureToggleDefaultEmailNotificationsEnumValues) + } +} + +// 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 FeatureToggleDefaultEmailNotifications) IsValid() bool { + for _, existing := range AllowedFeatureToggleDefaultEmailNotificationsEnumValues { + if existing == v { + return true + } + } + return false +} + +// Ptr returns reference to DefaultEmailNotificationsDefaultEmailNotifications value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v FeatureToggleDefaultEmailNotifications) Ptr() *FeatureToggleDefaultEmailNotifications { + return &v +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableFeatureToggleDefaultEmailNotifications struct { + value *FeatureToggleDefaultEmailNotifications + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableFeatureToggleDefaultEmailNotifications) Get() *FeatureToggleDefaultEmailNotifications { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableFeatureToggleDefaultEmailNotifications) Set(val *FeatureToggleDefaultEmailNotifications) { + 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 NullableFeatureToggleDefaultEmailNotifications) 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 *NullableFeatureToggleDefaultEmailNotifications) 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 NewNullableFeatureToggleDefaultEmailNotifications(val *FeatureToggleDefaultEmailNotifications) *NullableFeatureToggleDefaultEmailNotifications { + return &NullableFeatureToggleDefaultEmailNotifications{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 NullableFeatureToggleDefaultEmailNotifications) 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 *NullableFeatureToggleDefaultEmailNotifications) 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 FeatureToggleGetDefaultEmailNotificationsAttributeType = *FeatureToggleDefaultEmailNotifications + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureToggleGetDefaultEmailNotificationsArgType = *FeatureToggleDefaultEmailNotifications + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureToggleGetDefaultEmailNotificationsRetType = *FeatureToggleDefaultEmailNotifications + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getFeatureToggleGetDefaultEmailNotificationsAttributeTypeOk(arg FeatureToggleGetDefaultEmailNotificationsAttributeType) (ret FeatureToggleGetDefaultEmailNotificationsRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setFeatureToggleGetDefaultEmailNotificationsAttributeType(arg *FeatureToggleGetDefaultEmailNotificationsAttributeType, val FeatureToggleGetDefaultEmailNotificationsRetType) { + *arg = val +} + +/* + types and functions for enable_commit_signatures +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureTogglegetEnableCommitSignaturesAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureTogglegetEnableCommitSignaturesArgType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureTogglegetEnableCommitSignaturesRetType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getFeatureTogglegetEnableCommitSignaturesAttributeTypeOk(arg FeatureTogglegetEnableCommitSignaturesAttributeType) (ret FeatureTogglegetEnableCommitSignaturesRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setFeatureTogglegetEnableCommitSignaturesAttributeType(arg *FeatureTogglegetEnableCommitSignaturesAttributeType, val FeatureTogglegetEnableCommitSignaturesRetType) { + *arg = val +} + +/* + types and functions for enable_local_login +*/ + +// isBoolean +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureTogglegetEnableLocalLoginAttributeType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureTogglegetEnableLocalLoginArgType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureTogglegetEnableLocalLoginRetType = *bool + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getFeatureTogglegetEnableLocalLoginAttributeTypeOk(arg FeatureTogglegetEnableLocalLoginAttributeType) (ret FeatureTogglegetEnableLocalLoginRetType, ok bool) { + if arg == nil { + return nil, false + } + return arg, true +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func setFeatureTogglegetEnableLocalLoginAttributeType(arg *FeatureTogglegetEnableLocalLoginAttributeType, val FeatureTogglegetEnableLocalLoginRetType) { + *arg = val +} + +// FeatureToggle Feature toggles for the instance. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type FeatureToggle struct { + // Default email notifications. + DefaultEmailNotifications FeatureToggleGetDefaultEmailNotificationsAttributeType `json:"default_email_notifications,omitempty"` + // Enable commit signatures. + EnableCommitSignatures FeatureTogglegetEnableCommitSignaturesAttributeType `json:"enable_commit_signatures,omitempty"` + // Enable local login. + EnableLocalLogin FeatureTogglegetEnableLocalLoginAttributeType `json:"enable_local_login,omitempty"` +} + +// NewFeatureToggle instantiates a new FeatureToggle 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 NewFeatureToggle() *FeatureToggle { + this := FeatureToggle{} + return &this +} + +// NewFeatureToggleWithDefaults instantiates a new FeatureToggle 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 NewFeatureToggleWithDefaults() *FeatureToggle { + this := FeatureToggle{} + return &this +} + +// GetDefaultEmailNotifications returns the DefaultEmailNotifications field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) GetDefaultEmailNotifications() (res FeatureToggleGetDefaultEmailNotificationsRetType) { + res, _ = o.GetDefaultEmailNotificationsOk() + return +} + +// GetDefaultEmailNotificationsOk returns a tuple with the DefaultEmailNotifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) GetDefaultEmailNotificationsOk() (ret FeatureToggleGetDefaultEmailNotificationsRetType, ok bool) { + return getFeatureToggleGetDefaultEmailNotificationsAttributeTypeOk(o.DefaultEmailNotifications) +} + +// HasDefaultEmailNotifications 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 *FeatureToggle) HasDefaultEmailNotifications() bool { + _, ok := o.GetDefaultEmailNotificationsOk() + return ok +} + +// SetDefaultEmailNotifications gets a reference to the given string and assigns it to the DefaultEmailNotifications field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) SetDefaultEmailNotifications(v FeatureToggleGetDefaultEmailNotificationsRetType) { + setFeatureToggleGetDefaultEmailNotificationsAttributeType(&o.DefaultEmailNotifications, v) +} + +// SetDefaultEmailNotificationsNil sets the value for DefaultEmailNotifications to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) SetDefaultEmailNotificationsNil() { + o.DefaultEmailNotifications = nil +} + +// UnsetDefaultEmailNotifications ensures that no value is present for DefaultEmailNotifications, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) UnsetDefaultEmailNotifications() { + o.DefaultEmailNotifications = nil +} + +// GetEnableCommitSignatures returns the EnableCommitSignatures field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) GetEnableCommitSignatures() (res FeatureTogglegetEnableCommitSignaturesRetType) { + res, _ = o.GetEnableCommitSignaturesOk() + return +} + +// GetEnableCommitSignaturesOk returns a tuple with the EnableCommitSignatures field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) GetEnableCommitSignaturesOk() (ret FeatureTogglegetEnableCommitSignaturesRetType, ok bool) { + return getFeatureTogglegetEnableCommitSignaturesAttributeTypeOk(o.EnableCommitSignatures) +} + +// HasEnableCommitSignatures 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 *FeatureToggle) HasEnableCommitSignatures() bool { + _, ok := o.GetEnableCommitSignaturesOk() + return ok +} + +// SetEnableCommitSignatures gets a reference to the given bool and assigns it to the EnableCommitSignatures field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) SetEnableCommitSignatures(v FeatureTogglegetEnableCommitSignaturesRetType) { + setFeatureTogglegetEnableCommitSignaturesAttributeType(&o.EnableCommitSignatures, v) +} + +// SetEnableCommitSignaturesNil sets the value for EnableCommitSignatures to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) SetEnableCommitSignaturesNil() { + o.EnableCommitSignatures = nil +} + +// UnsetEnableCommitSignatures ensures that no value is present for EnableCommitSignatures, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) UnsetEnableCommitSignatures() { + o.EnableCommitSignatures = nil +} + +// GetEnableLocalLogin returns the EnableLocalLogin field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) GetEnableLocalLogin() (res FeatureTogglegetEnableLocalLoginRetType) { + res, _ = o.GetEnableLocalLoginOk() + return +} + +// GetEnableLocalLoginOk returns a tuple with the EnableLocalLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) GetEnableLocalLoginOk() (ret FeatureTogglegetEnableLocalLoginRetType, ok bool) { + return getFeatureTogglegetEnableLocalLoginAttributeTypeOk(o.EnableLocalLogin) +} + +// HasEnableLocalLogin 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 *FeatureToggle) HasEnableLocalLogin() bool { + _, ok := o.GetEnableLocalLoginOk() + return ok +} + +// SetEnableLocalLogin gets a reference to the given bool and assigns it to the EnableLocalLogin field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) SetEnableLocalLogin(v FeatureTogglegetEnableLocalLoginRetType) { + setFeatureTogglegetEnableLocalLoginAttributeType(&o.EnableLocalLogin, v) +} + +// SetEnableLocalLoginNil sets the value for EnableLocalLogin to be an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) SetEnableLocalLoginNil() { + o.EnableLocalLogin = nil +} + +// UnsetEnableLocalLogin ensures that no value is present for EnableLocalLogin, not even an explicit nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *FeatureToggle) UnsetEnableLocalLogin() { + o.EnableLocalLogin = nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o FeatureToggle) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getFeatureToggleGetDefaultEmailNotificationsAttributeTypeOk(o.DefaultEmailNotifications); ok { + toSerialize["DefaultEmailNotifications"] = val + } + if val, ok := getFeatureTogglegetEnableCommitSignaturesAttributeTypeOk(o.EnableCommitSignatures); ok { + toSerialize["EnableCommitSignatures"] = val + } + if val, ok := getFeatureTogglegetEnableLocalLoginAttributeTypeOk(o.EnableLocalLogin); ok { + toSerialize["EnableLocalLogin"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableFeatureToggle struct { + value *FeatureToggle + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableFeatureToggle) Get() *FeatureToggle { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableFeatureToggle) Set(val *FeatureToggle) { + 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 NullableFeatureToggle) 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 *NullableFeatureToggle) 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 NewNullableFeatureToggle(val *FeatureToggle) *NullableFeatureToggle { + return &NullableFeatureToggle{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 NullableFeatureToggle) 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 *NullableFeatureToggle) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_feature_toggle_test.go b/services/git/model_feature_toggle_test.go new file mode 100644 index 000000000..db419df58 --- /dev/null +++ b/services/git/model_feature_toggle_test.go @@ -0,0 +1,72 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git + +import ( + "testing" +) + +// isEnum + +func TestFeatureToggleDefaultEmailNotifications_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(`"enabled"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 2`, + args: args{ + src: []byte(`"disabled"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 3`, + args: args{ + src: []byte(`"onmention"`), + }, + wantErr: false, + }, + { + name: `success - possible enum value no. 4`, + args: args{ + src: []byte(`"andyourown"`), + }, + wantErr: false, + }, + { + name: "fail", + args: args{ + src: []byte("\"FOOBAR\""), + }, + wantErr: true, + }, + } + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + v := FeatureToggleDefaultEmailNotifications("") + 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/git/model_flavor.go b/services/git/model_flavor.go index aae5b2000..692b26c7c 100644 --- a/services/git/model_flavor.go +++ b/services/git/model_flavor.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -26,17 +27,23 @@ var _ MappedNullable = &Flavor{} // FlavorAvailability Defines the flavor availability. // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorAvailability string // List of Availability const ( - FLAVORAVAILABILITY_AVAILABLE FlavorAvailability = "available" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORAVAILABILITY_AVAILABLE FlavorAvailability = "available" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead FLAVORAVAILABILITY_UNAVAILABLE FlavorAvailability = "unavailable" - FLAVORAVAILABILITY_INTERNAL FlavorAvailability = "internal" - FLAVORAVAILABILITY_DEPRECATED FlavorAvailability = "deprecated" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORAVAILABILITY_INTERNAL FlavorAvailability = "internal" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + FLAVORAVAILABILITY_DEPRECATED FlavorAvailability = "deprecated" ) // All allowed values of Flavor enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedFlavorAvailabilityEnumValues = []FlavorAvailability{ "available", "unavailable", @@ -44,6 +51,7 @@ var AllowedFlavorAvailabilityEnumValues = []FlavorAvailability{ "deprecated", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *FlavorAvailability) 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 @@ -71,6 +79,7 @@ func (v *FlavorAvailability) UnmarshalJSON(src []byte) error { // NewFlavorAvailabilityFromValue returns a pointer to a valid FlavorAvailability // 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 NewFlavorAvailabilityFromValue(v FlavorAvailability) (*FlavorAvailability, error) { ev := FlavorAvailability(v) if ev.IsValid() { @@ -81,6 +90,7 @@ func NewFlavorAvailabilityFromValue(v FlavorAvailability) (*FlavorAvailability, } // 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 FlavorAvailability) IsValid() bool { for _, existing := range AllowedFlavorAvailabilityEnumValues { if existing == v { @@ -91,50 +101,65 @@ func (v FlavorAvailability) IsValid() bool { } // Ptr returns reference to AvailabilityAvailability value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v FlavorAvailability) Ptr() *FlavorAvailability { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFlavorAvailability struct { value *FlavorAvailability isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFlavorAvailability) Get() *FlavorAvailability { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFlavorAvailability) Set(val *FlavorAvailability) { 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 NullableFlavorAvailability) 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 *NullableFlavorAvailability) 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 NewNullableFlavorAvailability(val *FlavorAvailability) *NullableFlavorAvailability { return &NullableFlavorAvailability{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 NullableFlavorAvailability) 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 *NullableFlavorAvailability) 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 FlavorGetAvailabilityAttributeType = *FlavorAvailability + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetAvailabilityArgType = FlavorAvailability + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetAvailabilityRetType = FlavorAvailability +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetAvailabilityAttributeTypeOk(arg FlavorGetAvailabilityAttributeType) (ret FlavorGetAvailabilityRetType, ok bool) { if arg == nil { return ret, false @@ -142,6 +167,7 @@ func getFlavorGetAvailabilityAttributeTypeOk(arg FlavorGetAvailabilityAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetAvailabilityAttributeType(arg *FlavorGetAvailabilityAttributeType, val FlavorGetAvailabilityRetType) { *arg = &val } @@ -151,8 +177,10 @@ func setFlavorGetAvailabilityAttributeType(arg *FlavorGetAvailabilityAttributeTy */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDescriptionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetDescriptionAttributeTypeOk(arg FlavorGetDescriptionAttributeType) (ret FlavorGetDescriptionRetType, ok bool) { if arg == nil { return ret, false @@ -160,11 +188,15 @@ func getFlavorGetDescriptionAttributeTypeOk(arg FlavorGetDescriptionAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetDescriptionAttributeType(arg *FlavorGetDescriptionAttributeType, val FlavorGetDescriptionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDescriptionRetType = string /* @@ -172,8 +204,10 @@ type FlavorGetDescriptionRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDisplayNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetDisplayNameAttributeTypeOk(arg FlavorGetDisplayNameAttributeType) (ret FlavorGetDisplayNameRetType, ok bool) { if arg == nil { return ret, false @@ -181,11 +215,15 @@ func getFlavorGetDisplayNameAttributeTypeOk(arg FlavorGetDisplayNameAttributeTyp return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetDisplayNameAttributeType(arg *FlavorGetDisplayNameAttributeType, val FlavorGetDisplayNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDisplayNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetDisplayNameRetType = string /* @@ -193,8 +231,10 @@ type FlavorGetDisplayNameRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetIdAttributeTypeOk(arg FlavorGetIdAttributeType) (ret FlavorGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -202,11 +242,15 @@ func getFlavorGetIdAttributeTypeOk(arg FlavorGetIdAttributeType) (ret FlavorGetI return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetIdAttributeType(arg *FlavorGetIdAttributeType, val FlavorGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetIdRetType = string /* @@ -214,8 +258,10 @@ type FlavorGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetSkuAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getFlavorGetSkuAttributeTypeOk(arg FlavorGetSkuAttributeType) (ret FlavorGetSkuRetType, ok bool) { if arg == nil { return ret, false @@ -223,14 +269,19 @@ func getFlavorGetSkuAttributeTypeOk(arg FlavorGetSkuAttributeType) (ret FlavorGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setFlavorGetSkuAttributeType(arg *FlavorGetSkuAttributeType, val FlavorGetSkuRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetSkuArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type FlavorGetSkuRetType = string // Flavor Describes a STACKIT Git Flavor. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Flavor struct { // Defines the flavor availability. // REQUIRED @@ -249,12 +300,14 @@ type Flavor struct { Sku FlavorGetSkuAttributeType `json:"sku" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Flavor Flavor // NewFlavor instantiates a new Flavor 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 NewFlavor(availability FlavorGetAvailabilityArgType, description FlavorGetDescriptionArgType, displayName FlavorGetDisplayNameArgType, id FlavorGetIdArgType, sku FlavorGetSkuArgType) *Flavor { this := Flavor{} setFlavorGetAvailabilityAttributeType(&this.Availability, availability) @@ -268,12 +321,14 @@ func NewFlavor(availability FlavorGetAvailabilityArgType, description FlavorGetD // NewFlavorWithDefaults instantiates a new Flavor 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 NewFlavorWithDefaults() *Flavor { this := Flavor{} return &this } // GetAvailability returns the Availability field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) GetAvailability() (ret FlavorGetAvailabilityRetType) { ret, _ = o.GetAvailabilityOk() return ret @@ -281,16 +336,19 @@ func (o *Flavor) GetAvailability() (ret FlavorGetAvailabilityRetType) { // GetAvailabilityOk returns a tuple with the Availability 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 *Flavor) GetAvailabilityOk() (ret FlavorGetAvailabilityRetType, ok bool) { return getFlavorGetAvailabilityAttributeTypeOk(o.Availability) } // SetAvailability sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) SetAvailability(v FlavorGetAvailabilityRetType) { setFlavorGetAvailabilityAttributeType(&o.Availability, v) } // GetDescription returns the Description field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) GetDescription() (ret FlavorGetDescriptionRetType) { ret, _ = o.GetDescriptionOk() return ret @@ -298,16 +356,19 @@ func (o *Flavor) GetDescription() (ret FlavorGetDescriptionRetType) { // GetDescriptionOk returns a tuple with the Description 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 *Flavor) GetDescriptionOk() (ret FlavorGetDescriptionRetType, ok bool) { return getFlavorGetDescriptionAttributeTypeOk(o.Description) } // SetDescription sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) SetDescription(v FlavorGetDescriptionRetType) { setFlavorGetDescriptionAttributeType(&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 *Flavor) GetDisplayName() (ret FlavorGetDisplayNameRetType) { ret, _ = o.GetDisplayNameOk() return ret @@ -315,16 +376,19 @@ func (o *Flavor) GetDisplayName() (ret FlavorGetDisplayNameRetType) { // 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 *Flavor) GetDisplayNameOk() (ret FlavorGetDisplayNameRetType, ok bool) { return getFlavorGetDisplayNameAttributeTypeOk(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 *Flavor) SetDisplayName(v FlavorGetDisplayNameRetType) { setFlavorGetDisplayNameAttributeType(&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 *Flavor) GetId() (ret FlavorGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -332,16 +396,19 @@ func (o *Flavor) GetId() (ret FlavorGetIdRetType) { // 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 *Flavor) GetIdOk() (ret FlavorGetIdRetType, ok bool) { return getFlavorGetIdAttributeTypeOk(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 *Flavor) SetId(v FlavorGetIdRetType) { setFlavorGetIdAttributeType(&o.Id, v) } // GetSku returns the Sku field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) GetSku() (ret FlavorGetSkuRetType) { ret, _ = o.GetSkuOk() return ret @@ -349,15 +416,18 @@ func (o *Flavor) GetSku() (ret FlavorGetSkuRetType) { // GetSkuOk returns a tuple with the Sku 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 *Flavor) GetSkuOk() (ret FlavorGetSkuRetType, ok bool) { return getFlavorGetSkuAttributeTypeOk(o.Sku) } // SetSku sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Flavor) SetSku(v FlavorGetSkuRetType) { setFlavorGetSkuAttributeType(&o.Sku, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Flavor) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getFlavorGetAvailabilityAttributeTypeOk(o.Availability); ok { @@ -378,37 +448,45 @@ func (o Flavor) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFlavor struct { value *Flavor isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFlavor) Get() *Flavor { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFlavor) Set(val *Flavor) { 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 NullableFlavor) 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 *NullableFlavor) 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 NewNullableFlavor(val *Flavor) *NullableFlavor { return &NullableFlavor{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 NullableFlavor) 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 *NullableFlavor) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_generic_error_response.go b/services/git/model_generic_error_response.go index 49166a93a..1d2eb1c09 100644 --- a/services/git/model_generic_error_response.go +++ b/services/git/model_generic_error_response.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &GenericErrorResponse{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericErrorResponseGetDetailsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericErrorResponseGetDetailsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericErrorResponseGetDetailsRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGenericErrorResponseGetDetailsAttributeTypeOk(arg GenericErrorResponseGetDetailsAttributeType) (ret GenericErrorResponseGetDetailsRetType, ok bool) { if arg == nil { return ret, false @@ -33,6 +40,7 @@ func getGenericErrorResponseGetDetailsAttributeTypeOk(arg GenericErrorResponseGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGenericErrorResponseGetDetailsAttributeType(arg *GenericErrorResponseGetDetailsAttributeType, val GenericErrorResponseGetDetailsRetType) { *arg = &val } @@ -42,8 +50,10 @@ func setGenericErrorResponseGetDetailsAttributeType(arg *GenericErrorResponseGet */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericErrorResponseGetMessageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getGenericErrorResponseGetMessageAttributeTypeOk(arg GenericErrorResponseGetMessageAttributeType) (ret GenericErrorResponseGetMessageRetType, ok bool) { if arg == nil { return ret, false @@ -51,26 +61,33 @@ func getGenericErrorResponseGetMessageAttributeTypeOk(arg GenericErrorResponseGe return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setGenericErrorResponseGetMessageAttributeType(arg *GenericErrorResponseGetMessageAttributeType, val GenericErrorResponseGetMessageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericErrorResponseGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericErrorResponseGetMessageRetType = string // GenericErrorResponse Generic Error Response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type GenericErrorResponse struct { Details GenericErrorResponseGetDetailsAttributeType `json:"details,omitempty"` // REQUIRED Message GenericErrorResponseGetMessageAttributeType `json:"message" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _GenericErrorResponse GenericErrorResponse // NewGenericErrorResponse instantiates a new GenericErrorResponse 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 NewGenericErrorResponse(message GenericErrorResponseGetMessageArgType) *GenericErrorResponse { this := GenericErrorResponse{} setGenericErrorResponseGetMessageAttributeType(&this.Message, message) @@ -80,12 +97,14 @@ func NewGenericErrorResponse(message GenericErrorResponseGetMessageArgType) *Gen // NewGenericErrorResponseWithDefaults instantiates a new GenericErrorResponse 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 NewGenericErrorResponseWithDefaults() *GenericErrorResponse { this := GenericErrorResponse{} return &this } // GetDetails returns the Details 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 *GenericErrorResponse) GetDetails() (res GenericErrorResponseGetDetailsRetType) { res, _ = o.GetDetailsOk() return @@ -93,22 +112,26 @@ func (o *GenericErrorResponse) GetDetails() (res GenericErrorResponseGetDetailsR // GetDetailsOk returns a tuple with the Details 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 *GenericErrorResponse) GetDetailsOk() (ret GenericErrorResponseGetDetailsRetType, ok bool) { return getGenericErrorResponseGetDetailsAttributeTypeOk(o.Details) } // HasDetails 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 *GenericErrorResponse) HasDetails() bool { _, ok := o.GetDetailsOk() return ok } // SetDetails gets a reference to the given []string and assigns it to the Details field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericErrorResponse) SetDetails(v GenericErrorResponseGetDetailsRetType) { setGenericErrorResponseGetDetailsAttributeType(&o.Details, v) } // GetMessage returns the Message field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericErrorResponse) GetMessage() (ret GenericErrorResponseGetMessageRetType) { ret, _ = o.GetMessageOk() return ret @@ -116,15 +139,18 @@ func (o *GenericErrorResponse) GetMessage() (ret GenericErrorResponseGetMessageR // GetMessageOk returns a tuple with the Message field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericErrorResponse) GetMessageOk() (ret GenericErrorResponseGetMessageRetType, ok bool) { return getGenericErrorResponseGetMessageAttributeTypeOk(o.Message) } // SetMessage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *GenericErrorResponse) SetMessage(v GenericErrorResponseGetMessageRetType) { setGenericErrorResponseGetMessageAttributeType(&o.Message, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o GenericErrorResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getGenericErrorResponseGetDetailsAttributeTypeOk(o.Details); ok { @@ -136,37 +162,45 @@ func (o GenericErrorResponse) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableGenericErrorResponse struct { value *GenericErrorResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableGenericErrorResponse) Get() *GenericErrorResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableGenericErrorResponse) Set(val *GenericErrorResponse) { 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 NullableGenericErrorResponse) 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 *NullableGenericErrorResponse) 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 NewNullableGenericErrorResponse(val *GenericErrorResponse) *NullableGenericErrorResponse { return &NullableGenericErrorResponse{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 NullableGenericErrorResponse) 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 *NullableGenericErrorResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_instance.go b/services/git/model_instance.go index 587308921..661e2d7fa 100644 --- a/services/git/model_instance.go +++ b/services/git/model_instance.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -24,10 +25,16 @@ var _ MappedNullable = &Instance{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetAclAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetAclArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetAclRetType = []string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetAclAttributeTypeOk(arg InstanceGetAclAttributeType) (ret InstanceGetAclRetType, ok bool) { if arg == nil { return ret, false @@ -35,6 +42,7 @@ func getInstanceGetAclAttributeTypeOk(arg InstanceGetAclAttributeType) (ret Inst return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetAclAttributeType(arg *InstanceGetAclAttributeType, val InstanceGetAclRetType) { *arg = &val } @@ -44,8 +52,10 @@ func setInstanceGetAclAttributeType(arg *InstanceGetAclAttributeType, val Instan */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetConsumedDiskAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetConsumedDiskAttributeTypeOk(arg InstanceGetConsumedDiskAttributeType) (ret InstanceGetConsumedDiskRetType, ok bool) { if arg == nil { return ret, false @@ -53,11 +63,15 @@ func getInstanceGetConsumedDiskAttributeTypeOk(arg InstanceGetConsumedDiskAttrib return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetConsumedDiskAttributeType(arg *InstanceGetConsumedDiskAttributeType, val InstanceGetConsumedDiskRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetConsumedDiskArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetConsumedDiskRetType = string /* @@ -65,8 +79,10 @@ type InstanceGetConsumedDiskRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetConsumedObjectStorageAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetConsumedObjectStorageAttributeTypeOk(arg InstanceGetConsumedObjectStorageAttributeType) (ret InstanceGetConsumedObjectStorageRetType, ok bool) { if arg == nil { return ret, false @@ -74,11 +90,15 @@ func getInstanceGetConsumedObjectStorageAttributeTypeOk(arg InstanceGetConsumedO return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetConsumedObjectStorageAttributeType(arg *InstanceGetConsumedObjectStorageAttributeType, val InstanceGetConsumedObjectStorageRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetConsumedObjectStorageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetConsumedObjectStorageRetType = string /* @@ -86,10 +106,16 @@ type InstanceGetConsumedObjectStorageRetType = string */ // isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetCreatedAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetCreatedArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetCreatedRetType = time.Time +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetCreatedAttributeTypeOk(arg InstanceGetCreatedAttributeType) (ret InstanceGetCreatedRetType, ok bool) { if arg == nil { return ret, false @@ -97,17 +123,47 @@ func getInstanceGetCreatedAttributeTypeOk(arg InstanceGetCreatedAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetCreatedAttributeType(arg *InstanceGetCreatedAttributeType, val InstanceGetCreatedRetType) { *arg = &val } +/* + types and functions for feature_toggle +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceGetFeatureToggleAttributeType = *FeatureToggle + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceGetFeatureToggleArgType = FeatureToggle + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InstanceGetFeatureToggleRetType = FeatureToggle + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInstanceGetFeatureToggleAttributeTypeOk(arg InstanceGetFeatureToggleAttributeType) (ret InstanceGetFeatureToggleRetType, 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 setInstanceGetFeatureToggleAttributeType(arg *InstanceGetFeatureToggleAttributeType, val InstanceGetFeatureToggleRetType) { + *arg = &val +} + /* types and functions for flavor */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetFlavorAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetFlavorAttributeTypeOk(arg InstanceGetFlavorAttributeType) (ret InstanceGetFlavorRetType, ok bool) { if arg == nil { return ret, false @@ -115,11 +171,15 @@ func getInstanceGetFlavorAttributeTypeOk(arg InstanceGetFlavorAttributeType) (re return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetFlavorAttributeType(arg *InstanceGetFlavorAttributeType, val InstanceGetFlavorRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetFlavorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetFlavorRetType = string /* @@ -127,8 +187,10 @@ type InstanceGetFlavorRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetIdAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetIdAttributeTypeOk(arg InstanceGetIdAttributeType) (ret InstanceGetIdRetType, ok bool) { if arg == nil { return ret, false @@ -136,11 +198,15 @@ func getInstanceGetIdAttributeTypeOk(arg InstanceGetIdAttributeType) (ret Instan return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetIdAttributeType(arg *InstanceGetIdAttributeType, val InstanceGetIdRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetIdRetType = string /* @@ -148,8 +214,10 @@ type InstanceGetIdRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetNameAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetNameAttributeTypeOk(arg InstanceGetNameAttributeType) (ret InstanceGetNameRetType, ok bool) { if arg == nil { return ret, false @@ -157,11 +225,15 @@ func getInstanceGetNameAttributeTypeOk(arg InstanceGetNameAttributeType) (ret In return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetNameAttributeType(arg *InstanceGetNameAttributeType, val InstanceGetNameRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetNameRetType = string /* @@ -172,19 +244,27 @@ type InstanceGetNameRetType = string // InstanceState The current state of the STACKIT Git 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 InstanceState string // List of State const ( - INSTANCESTATE_CREATING InstanceState = "Creating" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESTATE_CREATING InstanceState = "Creating" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead INSTANCESTATE_WAITING_FOR_RESOURCES InstanceState = "WaitingForResources" - INSTANCESTATE_UPDATING InstanceState = "Updating" - INSTANCESTATE_DELETING InstanceState = "Deleting" - INSTANCESTATE_READY InstanceState = "Ready" - INSTANCESTATE_ERROR InstanceState = "Error" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESTATE_UPDATING InstanceState = "Updating" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESTATE_DELETING InstanceState = "Deleting" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESTATE_READY InstanceState = "Ready" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + INSTANCESTATE_ERROR InstanceState = "Error" ) // All allowed values of Instance enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedInstanceStateEnumValues = []InstanceState{ "Creating", "WaitingForResources", @@ -194,6 +274,7 @@ var AllowedInstanceStateEnumValues = []InstanceState{ "Error", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *InstanceState) 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 @@ -221,6 +302,7 @@ func (v *InstanceState) UnmarshalJSON(src []byte) error { // NewInstanceStateFromValue returns a pointer to a valid InstanceState // 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 NewInstanceStateFromValue(v InstanceState) (*InstanceState, error) { ev := InstanceState(v) if ev.IsValid() { @@ -231,6 +313,7 @@ func NewInstanceStateFromValue(v InstanceState) (*InstanceState, error) { } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v InstanceState) IsValid() bool { for _, existing := range AllowedInstanceStateEnumValues { if existing == v { @@ -241,50 +324,65 @@ func (v InstanceState) IsValid() bool { } // Ptr returns reference to StateState value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v InstanceState) Ptr() *InstanceState { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInstanceState struct { value *InstanceState isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstanceState) Get() *InstanceState { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstanceState) Set(val *InstanceState) { 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 NullableInstanceState) 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 *NullableInstanceState) 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 NewNullableInstanceState(val *InstanceState) *NullableInstanceState { return &NullableInstanceState{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 NullableInstanceState) 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 *NullableInstanceState) 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 InstanceGetStateAttributeType = *InstanceState + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetStateArgType = InstanceState + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetStateRetType = InstanceState +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetStateAttributeTypeOk(arg InstanceGetStateAttributeType) (ret InstanceGetStateRetType, ok bool) { if arg == nil { return ret, false @@ -292,6 +390,7 @@ func getInstanceGetStateAttributeTypeOk(arg InstanceGetStateAttributeType) (ret return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetStateAttributeType(arg *InstanceGetStateAttributeType, val InstanceGetStateRetType) { *arg = &val } @@ -301,8 +400,10 @@ func setInstanceGetStateAttributeType(arg *InstanceGetStateAttributeType, val In */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetUrlAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetUrlAttributeTypeOk(arg InstanceGetUrlAttributeType) (ret InstanceGetUrlRetType, ok bool) { if arg == nil { return ret, false @@ -310,11 +411,15 @@ func getInstanceGetUrlAttributeTypeOk(arg InstanceGetUrlAttributeType) (ret Inst return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetUrlAttributeType(arg *InstanceGetUrlAttributeType, val InstanceGetUrlRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetUrlRetType = string /* @@ -322,8 +427,10 @@ type InstanceGetUrlRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetVersionAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInstanceGetVersionAttributeTypeOk(arg InstanceGetVersionAttributeType) (ret InstanceGetVersionRetType, ok bool) { if arg == nil { return ret, false @@ -331,14 +438,19 @@ func getInstanceGetVersionAttributeTypeOk(arg InstanceGetVersionAttributeType) ( return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInstanceGetVersionAttributeType(arg *InstanceGetVersionAttributeType, val InstanceGetVersionRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetVersionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InstanceGetVersionRetType = string // Instance Describes a STACKIT Git instance. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type Instance struct { // Restricted ACL for instance access. // REQUIRED @@ -352,7 +464,9 @@ type Instance struct { // The date and time the creation of the STACKIT Git instance was triggered. // REQUIRED Created InstanceGetCreatedAttributeType `json:"created" required:"true"` - // Desired instance flavor. Must be one of the defined enum values + // REQUIRED + FeatureToggle InstanceGetFeatureToggleAttributeType `json:"feature_toggle" required:"true"` + // Instance flavor. // REQUIRED Flavor InstanceGetFlavorAttributeType `json:"flavor" required:"true"` // A auto generated unique id which identifies the STACKIT Git instances. @@ -372,18 +486,21 @@ type Instance struct { Version InstanceGetVersionAttributeType `json:"version" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _Instance Instance // NewInstance instantiates a new Instance object // This constructor will assign default values to properties that have it defined, // and makes sure properties required by API are set, but the set of arguments // will change when the set of required properties is changed -func NewInstance(acl InstanceGetAclArgType, consumedDisk InstanceGetConsumedDiskArgType, consumedObjectStorage InstanceGetConsumedObjectStorageArgType, created InstanceGetCreatedArgType, flavor InstanceGetFlavorArgType, id InstanceGetIdArgType, name InstanceGetNameArgType, state InstanceGetStateArgType, url InstanceGetUrlArgType, version InstanceGetVersionArgType) *Instance { +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func NewInstance(acl InstanceGetAclArgType, consumedDisk InstanceGetConsumedDiskArgType, consumedObjectStorage InstanceGetConsumedObjectStorageArgType, created InstanceGetCreatedArgType, featureToggle InstanceGetFeatureToggleArgType, flavor InstanceGetFlavorArgType, id InstanceGetIdArgType, name InstanceGetNameArgType, state InstanceGetStateArgType, url InstanceGetUrlArgType, version InstanceGetVersionArgType) *Instance { this := Instance{} setInstanceGetAclAttributeType(&this.Acl, acl) setInstanceGetConsumedDiskAttributeType(&this.ConsumedDisk, consumedDisk) setInstanceGetConsumedObjectStorageAttributeType(&this.ConsumedObjectStorage, consumedObjectStorage) setInstanceGetCreatedAttributeType(&this.Created, created) + setInstanceGetFeatureToggleAttributeType(&this.FeatureToggle, featureToggle) setInstanceGetFlavorAttributeType(&this.Flavor, flavor) setInstanceGetIdAttributeType(&this.Id, id) setInstanceGetNameAttributeType(&this.Name, name) @@ -396,12 +513,14 @@ func NewInstance(acl InstanceGetAclArgType, consumedDisk InstanceGetConsumedDisk // NewInstanceWithDefaults instantiates a new Instance object // This constructor will only assign default values to properties that have it defined, // but it doesn't guarantee that properties required by API are set +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewInstanceWithDefaults() *Instance { this := Instance{} return &this } // GetAcl returns the Acl field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetAcl() (ret InstanceGetAclRetType) { ret, _ = o.GetAclOk() return ret @@ -409,16 +528,19 @@ func (o *Instance) GetAcl() (ret InstanceGetAclRetType) { // GetAclOk returns a tuple with the Acl field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetAclOk() (ret InstanceGetAclRetType, ok bool) { return getInstanceGetAclAttributeTypeOk(o.Acl) } // SetAcl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetAcl(v InstanceGetAclRetType) { setInstanceGetAclAttributeType(&o.Acl, v) } // GetConsumedDisk returns the ConsumedDisk field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetConsumedDisk() (ret InstanceGetConsumedDiskRetType) { ret, _ = o.GetConsumedDiskOk() return ret @@ -426,16 +548,19 @@ func (o *Instance) GetConsumedDisk() (ret InstanceGetConsumedDiskRetType) { // GetConsumedDiskOk returns a tuple with the ConsumedDisk field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetConsumedDiskOk() (ret InstanceGetConsumedDiskRetType, ok bool) { return getInstanceGetConsumedDiskAttributeTypeOk(o.ConsumedDisk) } // SetConsumedDisk sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetConsumedDisk(v InstanceGetConsumedDiskRetType) { setInstanceGetConsumedDiskAttributeType(&o.ConsumedDisk, v) } // GetConsumedObjectStorage returns the ConsumedObjectStorage field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetConsumedObjectStorage() (ret InstanceGetConsumedObjectStorageRetType) { ret, _ = o.GetConsumedObjectStorageOk() return ret @@ -443,16 +568,19 @@ func (o *Instance) GetConsumedObjectStorage() (ret InstanceGetConsumedObjectStor // GetConsumedObjectStorageOk returns a tuple with the ConsumedObjectStorage field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetConsumedObjectStorageOk() (ret InstanceGetConsumedObjectStorageRetType, ok bool) { return getInstanceGetConsumedObjectStorageAttributeTypeOk(o.ConsumedObjectStorage) } // SetConsumedObjectStorage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetConsumedObjectStorage(v InstanceGetConsumedObjectStorageRetType) { setInstanceGetConsumedObjectStorageAttributeType(&o.ConsumedObjectStorage, v) } // GetCreated returns the Created field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetCreated() (ret InstanceGetCreatedRetType) { ret, _ = o.GetCreatedOk() return ret @@ -460,16 +588,39 @@ func (o *Instance) GetCreated() (ret InstanceGetCreatedRetType) { // GetCreatedOk returns a tuple with the Created field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetCreatedOk() (ret InstanceGetCreatedRetType, ok bool) { return getInstanceGetCreatedAttributeTypeOk(o.Created) } // SetCreated sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetCreated(v InstanceGetCreatedRetType) { setInstanceGetCreatedAttributeType(&o.Created, v) } +// GetFeatureToggle returns the FeatureToggle field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Instance) GetFeatureToggle() (ret InstanceGetFeatureToggleRetType) { + ret, _ = o.GetFeatureToggleOk() + return ret +} + +// GetFeatureToggleOk returns a tuple with the FeatureToggle field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Instance) GetFeatureToggleOk() (ret InstanceGetFeatureToggleRetType, ok bool) { + return getInstanceGetFeatureToggleAttributeTypeOk(o.FeatureToggle) +} + +// SetFeatureToggle sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Instance) SetFeatureToggle(v InstanceGetFeatureToggleRetType) { + setInstanceGetFeatureToggleAttributeType(&o.FeatureToggle, v) +} + // GetFlavor returns the Flavor field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetFlavor() (ret InstanceGetFlavorRetType) { ret, _ = o.GetFlavorOk() return ret @@ -477,16 +628,19 @@ func (o *Instance) GetFlavor() (ret InstanceGetFlavorRetType) { // GetFlavorOk returns a tuple with the Flavor field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetFlavorOk() (ret InstanceGetFlavorRetType, ok bool) { return getInstanceGetFlavorAttributeTypeOk(o.Flavor) } // SetFlavor sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetFlavor(v InstanceGetFlavorRetType) { setInstanceGetFlavorAttributeType(&o.Flavor, v) } // GetId returns the Id field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetId() (ret InstanceGetIdRetType) { ret, _ = o.GetIdOk() return ret @@ -494,16 +648,19 @@ func (o *Instance) GetId() (ret InstanceGetIdRetType) { // GetIdOk returns a tuple with the Id field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetIdOk() (ret InstanceGetIdRetType, ok bool) { return getInstanceGetIdAttributeTypeOk(o.Id) } // SetId sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetId(v InstanceGetIdRetType) { setInstanceGetIdAttributeType(&o.Id, v) } // GetName returns the Name field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetName() (ret InstanceGetNameRetType) { ret, _ = o.GetNameOk() return ret @@ -511,16 +668,19 @@ func (o *Instance) GetName() (ret InstanceGetNameRetType) { // GetNameOk returns a tuple with the Name field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetNameOk() (ret InstanceGetNameRetType, ok bool) { return getInstanceGetNameAttributeTypeOk(o.Name) } // SetName sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetName(v InstanceGetNameRetType) { setInstanceGetNameAttributeType(&o.Name, v) } // GetState returns the State field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetState() (ret InstanceGetStateRetType) { ret, _ = o.GetStateOk() return ret @@ -528,16 +688,19 @@ func (o *Instance) GetState() (ret InstanceGetStateRetType) { // GetStateOk returns a tuple with the State field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetStateOk() (ret InstanceGetStateRetType, ok bool) { return getInstanceGetStateAttributeTypeOk(o.State) } // SetState sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetState(v InstanceGetStateRetType) { setInstanceGetStateAttributeType(&o.State, v) } // GetUrl returns the Url field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetUrl() (ret InstanceGetUrlRetType) { ret, _ = o.GetUrlOk() return ret @@ -545,16 +708,19 @@ func (o *Instance) GetUrl() (ret InstanceGetUrlRetType) { // GetUrlOk returns a tuple with the Url field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetUrlOk() (ret InstanceGetUrlRetType, ok bool) { return getInstanceGetUrlAttributeTypeOk(o.Url) } // SetUrl sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetUrl(v InstanceGetUrlRetType) { setInstanceGetUrlAttributeType(&o.Url, v) } // GetVersion returns the Version field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetVersion() (ret InstanceGetVersionRetType) { ret, _ = o.GetVersionOk() return ret @@ -562,15 +728,18 @@ func (o *Instance) GetVersion() (ret InstanceGetVersionRetType) { // GetVersionOk returns a tuple with the Version field value // and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) GetVersionOk() (ret InstanceGetVersionRetType, ok bool) { return getInstanceGetVersionAttributeTypeOk(o.Version) } // SetVersion sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *Instance) SetVersion(v InstanceGetVersionRetType) { setInstanceGetVersionAttributeType(&o.Version, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o Instance) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getInstanceGetAclAttributeTypeOk(o.Acl); ok { @@ -585,6 +754,9 @@ func (o Instance) ToMap() (map[string]interface{}, error) { if val, ok := getInstanceGetCreatedAttributeTypeOk(o.Created); ok { toSerialize["Created"] = val } + if val, ok := getInstanceGetFeatureToggleAttributeTypeOk(o.FeatureToggle); ok { + toSerialize["FeatureToggle"] = val + } if val, ok := getInstanceGetFlavorAttributeTypeOk(o.Flavor); ok { toSerialize["Flavor"] = val } @@ -606,37 +778,45 @@ func (o Instance) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInstance struct { value *Instance isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstance) Get() *Instance { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstance) Set(val *Instance) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstance) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstance) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInstance(val *Instance) *NullableInstance { return &NullableInstance{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInstance) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInstance) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_instance_flavor.go b/services/git/model_instance_flavor.go deleted file mode 100644 index 4439a8c76..000000000 --- a/services/git/model_instance_flavor.go +++ /dev/null @@ -1,115 +0,0 @@ -/* -STACKIT Git API - -STACKIT Git management API. - -API version: 1beta.0.4 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package git - -import ( - "encoding/json" - "fmt" -) - -// InstanceFlavor Desired instance flavor. Must be one of the defined enum values. -type InstanceFlavor string - -// List of InstanceFlavor -const ( - INSTANCEFLAVOR__10 InstanceFlavor = "git-10" - INSTANCEFLAVOR__100 InstanceFlavor = "git-100" -) - -// All allowed values of InstanceFlavor enum -var AllowedInstanceFlavorEnumValues = []InstanceFlavor{ - "git-10", - "git-100", -} - -func (v *InstanceFlavor) UnmarshalJSON(src []byte) error { - var value string - err := json.Unmarshal(src, &value) - if err != nil { - return err - } - // Allow unmarshalling zero value for testing purposes - var zeroValue string - if value == zeroValue { - return nil - } - enumTypeValue := InstanceFlavor(value) - for _, existing := range AllowedInstanceFlavorEnumValues { - if existing == enumTypeValue { - *v = enumTypeValue - return nil - } - } - - return fmt.Errorf("%+v is not a valid InstanceFlavor", value) -} - -// NewInstanceFlavorFromValue returns a pointer to a valid InstanceFlavor -// for the value passed as argument, or an error if the value passed is not allowed by the enum -func NewInstanceFlavorFromValue(v string) (*InstanceFlavor, error) { - ev := InstanceFlavor(v) - if ev.IsValid() { - return &ev, nil - } else { - return nil, fmt.Errorf("invalid value '%v' for InstanceFlavor: valid values are %v", v, AllowedInstanceFlavorEnumValues) - } -} - -// IsValid return true if the value is valid for the enum, false otherwise -func (v InstanceFlavor) IsValid() bool { - for _, existing := range AllowedInstanceFlavorEnumValues { - if existing == v { - return true - } - } - return false -} - -// Ptr returns reference to InstanceFlavor value -func (v InstanceFlavor) Ptr() *InstanceFlavor { - return &v -} - -type NullableInstanceFlavor struct { - value *InstanceFlavor - isSet bool -} - -func (v NullableInstanceFlavor) Get() *InstanceFlavor { - return v.value -} - -func (v *NullableInstanceFlavor) Set(val *InstanceFlavor) { - v.value = val - v.isSet = true -} - -func (v NullableInstanceFlavor) IsSet() bool { - return v.isSet -} - -func (v *NullableInstanceFlavor) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableInstanceFlavor(val *InstanceFlavor) *NullableInstanceFlavor { - return &NullableInstanceFlavor{value: val, isSet: true} -} - -func (v NullableInstanceFlavor) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableInstanceFlavor) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/git/model_internal_server_error_response.go b/services/git/model_internal_server_error_response.go index cbccba460..6fb77d485 100644 --- a/services/git/model_internal_server_error_response.go +++ b/services/git/model_internal_server_error_response.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -17,13 +18,42 @@ import ( // checks if the InternalServerErrorResponse type satisfies the MappedNullable interface at compile time var _ MappedNullable = &InternalServerErrorResponse{} +/* + types and functions for details +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InternalServerErrorResponseGetDetailsAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getInternalServerErrorResponseGetDetailsAttributeTypeOk(arg InternalServerErrorResponseGetDetailsAttributeType) (ret InternalServerErrorResponseGetDetailsRetType, 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 setInternalServerErrorResponseGetDetailsAttributeType(arg *InternalServerErrorResponseGetDetailsAttributeType, val InternalServerErrorResponseGetDetailsRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InternalServerErrorResponseGetDetailsArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type InternalServerErrorResponseGetDetailsRetType = string + /* types and functions for error */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InternalServerErrorResponseGetErrorAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getInternalServerErrorResponseGetErrorAttributeTypeOk(arg InternalServerErrorResponseGetErrorAttributeType) (ret InternalServerErrorResponseGetErrorRetType, ok bool) { if arg == nil { return ret, false @@ -31,22 +61,29 @@ func getInternalServerErrorResponseGetErrorAttributeTypeOk(arg InternalServerErr return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setInternalServerErrorResponseGetErrorAttributeType(arg *InternalServerErrorResponseGetErrorAttributeType, val InternalServerErrorResponseGetErrorRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InternalServerErrorResponseGetErrorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InternalServerErrorResponseGetErrorRetType = string // InternalServerErrorResponse Internal server error. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type InternalServerErrorResponse struct { - Error InternalServerErrorResponseGetErrorAttributeType `json:"error,omitempty"` + Details InternalServerErrorResponseGetDetailsAttributeType `json:"details,omitempty"` + Error InternalServerErrorResponseGetErrorAttributeType `json:"error,omitempty"` } // NewInternalServerErrorResponse instantiates a new InternalServerErrorResponse 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 NewInternalServerErrorResponse() *InternalServerErrorResponse { this := InternalServerErrorResponse{} return &this @@ -55,12 +92,41 @@ func NewInternalServerErrorResponse() *InternalServerErrorResponse { // NewInternalServerErrorResponseWithDefaults instantiates a new InternalServerErrorResponse 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 NewInternalServerErrorResponseWithDefaults() *InternalServerErrorResponse { this := InternalServerErrorResponse{} return &this } +// GetDetails returns the Details 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 *InternalServerErrorResponse) GetDetails() (res InternalServerErrorResponseGetDetailsRetType) { + res, _ = o.GetDetailsOk() + return +} + +// GetDetailsOk returns a tuple with the Details 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 *InternalServerErrorResponse) GetDetailsOk() (ret InternalServerErrorResponseGetDetailsRetType, ok bool) { + return getInternalServerErrorResponseGetDetailsAttributeTypeOk(o.Details) +} + +// HasDetails 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 *InternalServerErrorResponse) HasDetails() bool { + _, ok := o.GetDetailsOk() + return ok +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *InternalServerErrorResponse) SetDetails(v InternalServerErrorResponseGetDetailsRetType) { + setInternalServerErrorResponseGetDetailsAttributeType(&o.Details, v) +} + // GetError returns the Error 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 *InternalServerErrorResponse) GetError() (res InternalServerErrorResponseGetErrorRetType) { res, _ = o.GetErrorOk() return @@ -68,60 +134,75 @@ func (o *InternalServerErrorResponse) GetError() (res InternalServerErrorRespons // GetErrorOk returns a tuple with the Error 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 *InternalServerErrorResponse) GetErrorOk() (ret InternalServerErrorResponseGetErrorRetType, ok bool) { return getInternalServerErrorResponseGetErrorAttributeTypeOk(o.Error) } // HasError 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 *InternalServerErrorResponse) HasError() bool { _, ok := o.GetErrorOk() return ok } // SetError gets a reference to the given string and assigns it to the Error field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *InternalServerErrorResponse) SetError(v InternalServerErrorResponseGetErrorRetType) { setInternalServerErrorResponseGetErrorAttributeType(&o.Error, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o InternalServerErrorResponse) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} + if val, ok := getInternalServerErrorResponseGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val + } if val, ok := getInternalServerErrorResponseGetErrorAttributeTypeOk(o.Error); ok { toSerialize["Error"] = val } return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInternalServerErrorResponse struct { value *InternalServerErrorResponse isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInternalServerErrorResponse) Get() *InternalServerErrorResponse { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInternalServerErrorResponse) Set(val *InternalServerErrorResponse) { 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 NullableInternalServerErrorResponse) 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 *NullableInternalServerErrorResponse) 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 NewNullableInternalServerErrorResponse(val *InternalServerErrorResponse) *NullableInternalServerErrorResponse { return &NullableInternalServerErrorResponse{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 NullableInternalServerErrorResponse) 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 *NullableInternalServerErrorResponse) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_list_flavors.go b/services/git/model_list_flavors.go index e516f42e2..449521d5d 100644 --- a/services/git/model_list_flavors.go +++ b/services/git/model_list_flavors.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListFlavors{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsGetFlavorsAttributeType = *[]Flavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsGetFlavorsArgType = []Flavor + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavorsGetFlavorsRetType = []Flavor +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListFlavorsGetFlavorsAttributeTypeOk(arg ListFlavorsGetFlavorsAttributeType) (ret ListFlavorsGetFlavorsRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getListFlavorsGetFlavorsAttributeTypeOk(arg ListFlavorsGetFlavorsAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListFlavorsGetFlavorsAttributeType(arg *ListFlavorsGetFlavorsAttributeType, val ListFlavorsGetFlavorsRetType) { *arg = &val } // ListFlavors A list of STACKIT Git Flavors. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListFlavors struct { // REQUIRED Flavors ListFlavorsGetFlavorsAttributeType `json:"flavors" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ListFlavors ListFlavors // NewListFlavors instantiates a new ListFlavors 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 NewListFlavors(flavors ListFlavorsGetFlavorsArgType) *ListFlavors { this := ListFlavors{} setListFlavorsGetFlavorsAttributeType(&this.Flavors, flavors) @@ -58,12 +69,14 @@ func NewListFlavors(flavors ListFlavorsGetFlavorsArgType) *ListFlavors { // NewListFlavorsWithDefaults instantiates a new ListFlavors 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 NewListFlavorsWithDefaults() *ListFlavors { this := ListFlavors{} return &this } // GetFlavors returns the Flavors field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListFlavors) GetFlavors() (ret ListFlavorsGetFlavorsRetType) { ret, _ = o.GetFlavorsOk() return ret @@ -71,15 +84,18 @@ func (o *ListFlavors) GetFlavors() (ret ListFlavorsGetFlavorsRetType) { // GetFlavorsOk returns a tuple with the Flavors 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 *ListFlavors) GetFlavorsOk() (ret ListFlavorsGetFlavorsRetType, ok bool) { return getListFlavorsGetFlavorsAttributeTypeOk(o.Flavors) } // SetFlavors sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *ListFlavors) SetFlavors(v ListFlavorsGetFlavorsRetType) { setListFlavorsGetFlavorsAttributeType(&o.Flavors, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListFlavors) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListFlavorsGetFlavorsAttributeTypeOk(o.Flavors); ok { @@ -88,37 +104,45 @@ func (o ListFlavors) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableListFlavors struct { value *ListFlavors isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListFlavors) Get() *ListFlavors { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListFlavors) Set(val *ListFlavors) { 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 NullableListFlavors) 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 *NullableListFlavors) 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 NewNullableListFlavors(val *ListFlavors) *NullableListFlavors { return &NullableListFlavors{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 NullableListFlavors) 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 *NullableListFlavors) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_list_instances.go b/services/git/model_list_instances.go index 193fb2536..f00c25c42 100644 --- a/services/git/model_list_instances.go +++ b/services/git/model_list_instances.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &ListInstances{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesGetInstancesAttributeType = *[]Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesGetInstancesArgType = []Instance + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstancesGetInstancesRetType = []Instance +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getListInstancesGetInstancesAttributeTypeOk(arg ListInstancesGetInstancesAttributeType) (ret ListInstancesGetInstancesRetType, ok bool) { if arg == nil { return ret, false @@ -33,22 +40,26 @@ func getListInstancesGetInstancesAttributeTypeOk(arg ListInstancesGetInstancesAt return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setListInstancesGetInstancesAttributeType(arg *ListInstancesGetInstancesAttributeType, val ListInstancesGetInstancesRetType) { *arg = &val } // ListInstances A list of STACKIT Git instances. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type ListInstances struct { // REQUIRED Instances ListInstancesGetInstancesAttributeType `json:"instances" required:"true"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _ListInstances ListInstances // NewListInstances instantiates a new ListInstances 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 NewListInstances(instances ListInstancesGetInstancesArgType) *ListInstances { this := ListInstances{} setListInstancesGetInstancesAttributeType(&this.Instances, instances) @@ -58,12 +69,14 @@ func NewListInstances(instances ListInstancesGetInstancesArgType) *ListInstances // NewListInstancesWithDefaults instantiates a new ListInstances 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 NewListInstancesWithDefaults() *ListInstances { this := ListInstances{} 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 *ListInstances) GetInstances() (ret ListInstancesGetInstancesRetType) { ret, _ = o.GetInstancesOk() return ret @@ -71,15 +84,18 @@ func (o *ListInstances) GetInstances() (ret ListInstancesGetInstancesRetType) { // 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 *ListInstances) GetInstancesOk() (ret ListInstancesGetInstancesRetType, ok bool) { return getListInstancesGetInstancesAttributeTypeOk(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 *ListInstances) SetInstances(v ListInstancesGetInstancesRetType) { setListInstancesGetInstancesAttributeType(&o.Instances, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o ListInstances) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getListInstancesGetInstancesAttributeTypeOk(o.Instances); ok { @@ -88,37 +104,45 @@ func (o ListInstances) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableListInstances struct { value *ListInstances isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableListInstances) Get() *ListInstances { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableListInstances) Set(val *ListInstances) { 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 NullableListInstances) 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 *NullableListInstances) 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 NewNullableListInstances(val *ListInstances) *NullableListInstances { return &NullableListInstances{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 NullableListInstances) 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 *NullableListInstances) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_list_runner_labels.go b/services/git/model_list_runner_labels.go deleted file mode 100644 index d1643372f..000000000 --- a/services/git/model_list_runner_labels.go +++ /dev/null @@ -1,125 +0,0 @@ -/* -STACKIT Git API - -STACKIT Git management API. - -API version: 1beta.0.4 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package git - -import ( - "encoding/json" -) - -// checks if the ListRunnerLabels type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &ListRunnerLabels{} - -/* - types and functions for runner-labels -*/ - -// isArray -type ListRunnerLabelsGetRunnerLabelsAttributeType = *[]RunnerLabel -type ListRunnerLabelsGetRunnerLabelsArgType = []RunnerLabel -type ListRunnerLabelsGetRunnerLabelsRetType = []RunnerLabel - -func getListRunnerLabelsGetRunnerLabelsAttributeTypeOk(arg ListRunnerLabelsGetRunnerLabelsAttributeType) (ret ListRunnerLabelsGetRunnerLabelsRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setListRunnerLabelsGetRunnerLabelsAttributeType(arg *ListRunnerLabelsGetRunnerLabelsAttributeType, val ListRunnerLabelsGetRunnerLabelsRetType) { - *arg = &val -} - -// ListRunnerLabels A list of STACKIT Git RunnerLabels. -type ListRunnerLabels struct { - // REQUIRED - RunnerLabels ListRunnerLabelsGetRunnerLabelsAttributeType `json:"runner-labels" required:"true"` -} - -type _ListRunnerLabels ListRunnerLabels - -// NewListRunnerLabels instantiates a new ListRunnerLabels object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewListRunnerLabels(runnerLabels ListRunnerLabelsGetRunnerLabelsArgType) *ListRunnerLabels { - this := ListRunnerLabels{} - setListRunnerLabelsGetRunnerLabelsAttributeType(&this.RunnerLabels, runnerLabels) - return &this -} - -// NewListRunnerLabelsWithDefaults instantiates a new ListRunnerLabels object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewListRunnerLabelsWithDefaults() *ListRunnerLabels { - this := ListRunnerLabels{} - return &this -} - -// GetRunnerLabels returns the RunnerLabels field value -func (o *ListRunnerLabels) GetRunnerLabels() (ret ListRunnerLabelsGetRunnerLabelsRetType) { - ret, _ = o.GetRunnerLabelsOk() - return ret -} - -// GetRunnerLabelsOk returns a tuple with the RunnerLabels field value -// and a boolean to check if the value has been set. -func (o *ListRunnerLabels) GetRunnerLabelsOk() (ret ListRunnerLabelsGetRunnerLabelsRetType, ok bool) { - return getListRunnerLabelsGetRunnerLabelsAttributeTypeOk(o.RunnerLabels) -} - -// SetRunnerLabels sets field value -func (o *ListRunnerLabels) SetRunnerLabels(v ListRunnerLabelsGetRunnerLabelsRetType) { - setListRunnerLabelsGetRunnerLabelsAttributeType(&o.RunnerLabels, v) -} - -func (o ListRunnerLabels) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getListRunnerLabelsGetRunnerLabelsAttributeTypeOk(o.RunnerLabels); ok { - toSerialize["RunnerLabels"] = val - } - return toSerialize, nil -} - -type NullableListRunnerLabels struct { - value *ListRunnerLabels - isSet bool -} - -func (v NullableListRunnerLabels) Get() *ListRunnerLabels { - return v.value -} - -func (v *NullableListRunnerLabels) Set(val *ListRunnerLabels) { - v.value = val - v.isSet = true -} - -func (v NullableListRunnerLabels) IsSet() bool { - return v.isSet -} - -func (v *NullableListRunnerLabels) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableListRunnerLabels(val *ListRunnerLabels) *NullableListRunnerLabels { - return &NullableListRunnerLabels{value: val, isSet: true} -} - -func (v NullableListRunnerLabels) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableListRunnerLabels) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/git/model_not_found_error_response.go b/services/git/model_not_found_error_response.go new file mode 100644 index 000000000..f63584c15 --- /dev/null +++ b/services/git/model_not_found_error_response.go @@ -0,0 +1,209 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the NotFoundErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotFoundErrorResponse{} + +/* + types and functions for details +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NotFoundErrorResponseGetDetailsAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getNotFoundErrorResponseGetDetailsAttributeTypeOk(arg NotFoundErrorResponseGetDetailsAttributeType) (ret NotFoundErrorResponseGetDetailsRetType, 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 setNotFoundErrorResponseGetDetailsAttributeType(arg *NotFoundErrorResponseGetDetailsAttributeType, val NotFoundErrorResponseGetDetailsRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NotFoundErrorResponseGetDetailsArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NotFoundErrorResponseGetDetailsRetType = string + +/* + types and functions for error +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NotFoundErrorResponseGetErrorAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getNotFoundErrorResponseGetErrorAttributeTypeOk(arg NotFoundErrorResponseGetErrorAttributeType) (ret NotFoundErrorResponseGetErrorRetType, 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 setNotFoundErrorResponseGetErrorAttributeType(arg *NotFoundErrorResponseGetErrorAttributeType, val NotFoundErrorResponseGetErrorRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NotFoundErrorResponseGetErrorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NotFoundErrorResponseGetErrorRetType = string + +// NotFoundErrorResponse 404 Error Response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NotFoundErrorResponse struct { + Details NotFoundErrorResponseGetDetailsAttributeType `json:"details,omitempty"` + Error NotFoundErrorResponseGetErrorAttributeType `json:"error,omitempty"` +} + +// NewNotFoundErrorResponse instantiates a new NotFoundErrorResponse 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 NewNotFoundErrorResponse() *NotFoundErrorResponse { + this := NotFoundErrorResponse{} + return &this +} + +// NewNotFoundErrorResponseWithDefaults instantiates a new NotFoundErrorResponse 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 NewNotFoundErrorResponseWithDefaults() *NotFoundErrorResponse { + this := NotFoundErrorResponse{} + return &this +} + +// GetDetails returns the Details 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 *NotFoundErrorResponse) GetDetails() (res NotFoundErrorResponseGetDetailsRetType) { + res, _ = o.GetDetailsOk() + return +} + +// GetDetailsOk returns a tuple with the Details 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 *NotFoundErrorResponse) GetDetailsOk() (ret NotFoundErrorResponseGetDetailsRetType, ok bool) { + return getNotFoundErrorResponseGetDetailsAttributeTypeOk(o.Details) +} + +// HasDetails 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 *NotFoundErrorResponse) HasDetails() bool { + _, ok := o.GetDetailsOk() + return ok +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *NotFoundErrorResponse) SetDetails(v NotFoundErrorResponseGetDetailsRetType) { + setNotFoundErrorResponseGetDetailsAttributeType(&o.Details, v) +} + +// GetError returns the Error 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 *NotFoundErrorResponse) GetError() (res NotFoundErrorResponseGetErrorRetType) { + res, _ = o.GetErrorOk() + return +} + +// GetErrorOk returns a tuple with the Error 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 *NotFoundErrorResponse) GetErrorOk() (ret NotFoundErrorResponseGetErrorRetType, ok bool) { + return getNotFoundErrorResponseGetErrorAttributeTypeOk(o.Error) +} + +// HasError 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 *NotFoundErrorResponse) HasError() bool { + _, ok := o.GetErrorOk() + return ok +} + +// SetError gets a reference to the given string and assigns it to the Error field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *NotFoundErrorResponse) SetError(v NotFoundErrorResponseGetErrorRetType) { + setNotFoundErrorResponseGetErrorAttributeType(&o.Error, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o NotFoundErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getNotFoundErrorResponseGetDetailsAttributeTypeOk(o.Details); ok { + toSerialize["Details"] = val + } + if val, ok := getNotFoundErrorResponseGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableNotFoundErrorResponse struct { + value *NotFoundErrorResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableNotFoundErrorResponse) Get() *NotFoundErrorResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableNotFoundErrorResponse) Set(val *NotFoundErrorResponse) { + 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 NullableNotFoundErrorResponse) 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 *NullableNotFoundErrorResponse) 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 NewNullableNotFoundErrorResponse(val *NotFoundErrorResponse) *NullableNotFoundErrorResponse { + return &NullableNotFoundErrorResponse{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 NullableNotFoundErrorResponse) 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 *NullableNotFoundErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_not_found_error_response_test.go b/services/git/model_not_found_error_response_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_not_found_error_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_patch_authentication_payload.go b/services/git/model_patch_authentication_payload.go new file mode 100644 index 000000000..0821c772e --- /dev/null +++ b/services/git/model_patch_authentication_payload.go @@ -0,0 +1,447 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the PatchAuthenticationPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchAuthenticationPayload{} + +/* + types and functions for auto_discover_url +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetAutoDiscoverUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchAuthenticationPayloadGetAutoDiscoverUrlAttributeTypeOk(arg PatchAuthenticationPayloadGetAutoDiscoverUrlAttributeType) (ret PatchAuthenticationPayloadGetAutoDiscoverUrlRetType, 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 setPatchAuthenticationPayloadGetAutoDiscoverUrlAttributeType(arg *PatchAuthenticationPayloadGetAutoDiscoverUrlAttributeType, val PatchAuthenticationPayloadGetAutoDiscoverUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetAutoDiscoverUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetAutoDiscoverUrlRetType = string + +/* + types and functions for client_id +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetClientIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchAuthenticationPayloadGetClientIdAttributeTypeOk(arg PatchAuthenticationPayloadGetClientIdAttributeType) (ret PatchAuthenticationPayloadGetClientIdRetType, 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 setPatchAuthenticationPayloadGetClientIdAttributeType(arg *PatchAuthenticationPayloadGetClientIdAttributeType, val PatchAuthenticationPayloadGetClientIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetClientIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetClientIdRetType = string + +/* + types and functions for client_secret +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetClientSecretAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchAuthenticationPayloadGetClientSecretAttributeTypeOk(arg PatchAuthenticationPayloadGetClientSecretAttributeType) (ret PatchAuthenticationPayloadGetClientSecretRetType, 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 setPatchAuthenticationPayloadGetClientSecretAttributeType(arg *PatchAuthenticationPayloadGetClientSecretAttributeType, val PatchAuthenticationPayloadGetClientSecretRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetClientSecretArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetClientSecretRetType = string + +/* + types and functions for icon_url +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetIconUrlAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchAuthenticationPayloadGetIconUrlAttributeTypeOk(arg PatchAuthenticationPayloadGetIconUrlAttributeType) (ret PatchAuthenticationPayloadGetIconUrlRetType, 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 setPatchAuthenticationPayloadGetIconUrlAttributeType(arg *PatchAuthenticationPayloadGetIconUrlAttributeType, val PatchAuthenticationPayloadGetIconUrlRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetIconUrlArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetIconUrlRetType = string + +/* + types and functions for provider +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetProviderAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchAuthenticationPayloadGetProviderAttributeTypeOk(arg PatchAuthenticationPayloadGetProviderAttributeType) (ret PatchAuthenticationPayloadGetProviderRetType, 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 setPatchAuthenticationPayloadGetProviderAttributeType(arg *PatchAuthenticationPayloadGetProviderAttributeType, val PatchAuthenticationPayloadGetProviderRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetProviderArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetProviderRetType = string + +/* + types and functions for scopes +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetScopesAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchAuthenticationPayloadGetScopesAttributeTypeOk(arg PatchAuthenticationPayloadGetScopesAttributeType) (ret PatchAuthenticationPayloadGetScopesRetType, 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 setPatchAuthenticationPayloadGetScopesAttributeType(arg *PatchAuthenticationPayloadGetScopesAttributeType, val PatchAuthenticationPayloadGetScopesRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetScopesArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayloadGetScopesRetType = string + +// PatchAuthenticationPayload Properties to patch on an authentication. All fields are optional. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchAuthenticationPayload struct { + // The well-known configuration url to use for this authentication definition. + AutoDiscoverUrl PatchAuthenticationPayloadGetAutoDiscoverUrlAttributeType `json:"auto_discover_url,omitempty"` + // The IDP client id to use. + ClientId PatchAuthenticationPayloadGetClientIdAttributeType `json:"client_id,omitempty"` + // The IDP client secret to use. + ClientSecret PatchAuthenticationPayloadGetClientSecretAttributeType `json:"client_secret,omitempty"` + // The url of the icon to use for this authentication definition. + IconUrl PatchAuthenticationPayloadGetIconUrlAttributeType `json:"icon_url,omitempty"` + // The Oauth2 provider to use. + Provider PatchAuthenticationPayloadGetProviderAttributeType `json:"provider,omitempty"` + // Scopes defines the OIDC scopes to request. + Scopes PatchAuthenticationPayloadGetScopesAttributeType `json:"scopes,omitempty"` +} + +// NewPatchAuthenticationPayload instantiates a new PatchAuthenticationPayload 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 NewPatchAuthenticationPayload() *PatchAuthenticationPayload { + this := PatchAuthenticationPayload{} + return &this +} + +// NewPatchAuthenticationPayloadWithDefaults instantiates a new PatchAuthenticationPayload 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 NewPatchAuthenticationPayloadWithDefaults() *PatchAuthenticationPayload { + this := PatchAuthenticationPayload{} + return &this +} + +// GetAutoDiscoverUrl returns the AutoDiscoverUrl 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 *PatchAuthenticationPayload) GetAutoDiscoverUrl() (res PatchAuthenticationPayloadGetAutoDiscoverUrlRetType) { + res, _ = o.GetAutoDiscoverUrlOk() + return +} + +// GetAutoDiscoverUrlOk returns a tuple with the AutoDiscoverUrl 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 *PatchAuthenticationPayload) GetAutoDiscoverUrlOk() (ret PatchAuthenticationPayloadGetAutoDiscoverUrlRetType, ok bool) { + return getPatchAuthenticationPayloadGetAutoDiscoverUrlAttributeTypeOk(o.AutoDiscoverUrl) +} + +// HasAutoDiscoverUrl 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 *PatchAuthenticationPayload) HasAutoDiscoverUrl() bool { + _, ok := o.GetAutoDiscoverUrlOk() + return ok +} + +// SetAutoDiscoverUrl gets a reference to the given string and assigns it to the AutoDiscoverUrl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchAuthenticationPayload) SetAutoDiscoverUrl(v PatchAuthenticationPayloadGetAutoDiscoverUrlRetType) { + setPatchAuthenticationPayloadGetAutoDiscoverUrlAttributeType(&o.AutoDiscoverUrl, v) +} + +// GetClientId returns the ClientId 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 *PatchAuthenticationPayload) GetClientId() (res PatchAuthenticationPayloadGetClientIdRetType) { + res, _ = o.GetClientIdOk() + return +} + +// GetClientIdOk returns a tuple with the ClientId 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 *PatchAuthenticationPayload) GetClientIdOk() (ret PatchAuthenticationPayloadGetClientIdRetType, ok bool) { + return getPatchAuthenticationPayloadGetClientIdAttributeTypeOk(o.ClientId) +} + +// HasClientId 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 *PatchAuthenticationPayload) HasClientId() bool { + _, ok := o.GetClientIdOk() + return ok +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchAuthenticationPayload) SetClientId(v PatchAuthenticationPayloadGetClientIdRetType) { + setPatchAuthenticationPayloadGetClientIdAttributeType(&o.ClientId, v) +} + +// GetClientSecret returns the ClientSecret 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 *PatchAuthenticationPayload) GetClientSecret() (res PatchAuthenticationPayloadGetClientSecretRetType) { + res, _ = o.GetClientSecretOk() + return +} + +// GetClientSecretOk returns a tuple with the ClientSecret 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 *PatchAuthenticationPayload) GetClientSecretOk() (ret PatchAuthenticationPayloadGetClientSecretRetType, ok bool) { + return getPatchAuthenticationPayloadGetClientSecretAttributeTypeOk(o.ClientSecret) +} + +// HasClientSecret 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 *PatchAuthenticationPayload) HasClientSecret() bool { + _, ok := o.GetClientSecretOk() + return ok +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchAuthenticationPayload) SetClientSecret(v PatchAuthenticationPayloadGetClientSecretRetType) { + setPatchAuthenticationPayloadGetClientSecretAttributeType(&o.ClientSecret, v) +} + +// GetIconUrl returns the IconUrl 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 *PatchAuthenticationPayload) GetIconUrl() (res PatchAuthenticationPayloadGetIconUrlRetType) { + res, _ = o.GetIconUrlOk() + return +} + +// GetIconUrlOk returns a tuple with the IconUrl 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 *PatchAuthenticationPayload) GetIconUrlOk() (ret PatchAuthenticationPayloadGetIconUrlRetType, ok bool) { + return getPatchAuthenticationPayloadGetIconUrlAttributeTypeOk(o.IconUrl) +} + +// HasIconUrl 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 *PatchAuthenticationPayload) HasIconUrl() bool { + _, ok := o.GetIconUrlOk() + return ok +} + +// SetIconUrl gets a reference to the given string and assigns it to the IconUrl field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchAuthenticationPayload) SetIconUrl(v PatchAuthenticationPayloadGetIconUrlRetType) { + setPatchAuthenticationPayloadGetIconUrlAttributeType(&o.IconUrl, v) +} + +// GetProvider returns the Provider 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 *PatchAuthenticationPayload) GetProvider() (res PatchAuthenticationPayloadGetProviderRetType) { + res, _ = o.GetProviderOk() + return +} + +// GetProviderOk returns a tuple with the Provider 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 *PatchAuthenticationPayload) GetProviderOk() (ret PatchAuthenticationPayloadGetProviderRetType, ok bool) { + return getPatchAuthenticationPayloadGetProviderAttributeTypeOk(o.Provider) +} + +// HasProvider 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 *PatchAuthenticationPayload) HasProvider() bool { + _, ok := o.GetProviderOk() + return ok +} + +// SetProvider gets a reference to the given string and assigns it to the Provider field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchAuthenticationPayload) SetProvider(v PatchAuthenticationPayloadGetProviderRetType) { + setPatchAuthenticationPayloadGetProviderAttributeType(&o.Provider, v) +} + +// GetScopes returns the Scopes 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 *PatchAuthenticationPayload) GetScopes() (res PatchAuthenticationPayloadGetScopesRetType) { + res, _ = o.GetScopesOk() + return +} + +// GetScopesOk returns a tuple with the Scopes 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 *PatchAuthenticationPayload) GetScopesOk() (ret PatchAuthenticationPayloadGetScopesRetType, ok bool) { + return getPatchAuthenticationPayloadGetScopesAttributeTypeOk(o.Scopes) +} + +// HasScopes 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 *PatchAuthenticationPayload) HasScopes() bool { + _, ok := o.GetScopesOk() + return ok +} + +// SetScopes gets a reference to the given string and assigns it to the Scopes field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchAuthenticationPayload) SetScopes(v PatchAuthenticationPayloadGetScopesRetType) { + setPatchAuthenticationPayloadGetScopesAttributeType(&o.Scopes, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o PatchAuthenticationPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getPatchAuthenticationPayloadGetAutoDiscoverUrlAttributeTypeOk(o.AutoDiscoverUrl); ok { + toSerialize["AutoDiscoverUrl"] = val + } + if val, ok := getPatchAuthenticationPayloadGetClientIdAttributeTypeOk(o.ClientId); ok { + toSerialize["ClientId"] = val + } + if val, ok := getPatchAuthenticationPayloadGetClientSecretAttributeTypeOk(o.ClientSecret); ok { + toSerialize["ClientSecret"] = val + } + if val, ok := getPatchAuthenticationPayloadGetIconUrlAttributeTypeOk(o.IconUrl); ok { + toSerialize["IconUrl"] = val + } + if val, ok := getPatchAuthenticationPayloadGetProviderAttributeTypeOk(o.Provider); ok { + toSerialize["Provider"] = val + } + if val, ok := getPatchAuthenticationPayloadGetScopesAttributeTypeOk(o.Scopes); ok { + toSerialize["Scopes"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullablePatchAuthenticationPayload struct { + value *PatchAuthenticationPayload + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullablePatchAuthenticationPayload) Get() *PatchAuthenticationPayload { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullablePatchAuthenticationPayload) Set(val *PatchAuthenticationPayload) { + 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 NullablePatchAuthenticationPayload) 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 *NullablePatchAuthenticationPayload) 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 NewNullablePatchAuthenticationPayload(val *PatchAuthenticationPayload) *NullablePatchAuthenticationPayload { + return &NullablePatchAuthenticationPayload{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 NullablePatchAuthenticationPayload) 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 *NullablePatchAuthenticationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_patch_authentication_payload_test.go b/services/git/model_patch_authentication_payload_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_patch_authentication_payload_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_patch_instance_payload.go b/services/git/model_patch_instance_payload.go index 87e9c3aa4..dd514da4a 100644 --- a/services/git/model_patch_instance_payload.go +++ b/services/git/model_patch_instance_payload.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -22,10 +23,16 @@ var _ MappedNullable = &PatchInstancePayload{} */ // isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchInstancePayloadGetAclAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchInstancePayloadGetAclArgType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchInstancePayloadGetAclRetType = *[]string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPatchInstancePayloadGetAclAttributeTypeOk(arg PatchInstancePayloadGetAclAttributeType) (ret PatchInstancePayloadGetAclRetType, ok bool) { if arg == nil { return nil, false @@ -33,20 +40,51 @@ func getPatchInstancePayloadGetAclAttributeTypeOk(arg PatchInstancePayloadGetAcl return arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPatchInstancePayloadGetAclAttributeType(arg *PatchInstancePayloadGetAclAttributeType, val PatchInstancePayloadGetAclRetType) { *arg = val } +/* + types and functions for feature_toggle +*/ + +// isModel +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadGetFeatureToggleAttributeType = *FeatureToggle + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadGetFeatureToggleArgType = FeatureToggle + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type PatchInstancePayloadGetFeatureToggleRetType = FeatureToggle + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getPatchInstancePayloadGetFeatureToggleAttributeTypeOk(arg PatchInstancePayloadGetFeatureToggleAttributeType) (ret PatchInstancePayloadGetFeatureToggleRetType, 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 setPatchInstancePayloadGetFeatureToggleAttributeType(arg *PatchInstancePayloadGetFeatureToggleAttributeType, val PatchInstancePayloadGetFeatureToggleRetType) { + *arg = &val +} + // PatchInstancePayload Properties to patch on an instance. All fields are optional. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchInstancePayload struct { // A list of CIDR network addresses that are allowed to access the instance. - Acl PatchInstancePayloadGetAclAttributeType `json:"acl,omitempty"` + Acl PatchInstancePayloadGetAclAttributeType `json:"acl,omitempty"` + FeatureToggle PatchInstancePayloadGetFeatureToggleAttributeType `json:"feature_toggle,omitempty"` } // NewPatchInstancePayload instantiates a new PatchInstancePayload 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 NewPatchInstancePayload() *PatchInstancePayload { this := PatchInstancePayload{} return &this @@ -55,12 +93,14 @@ func NewPatchInstancePayload() *PatchInstancePayload { // NewPatchInstancePayloadWithDefaults instantiates a new PatchInstancePayload 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 NewPatchInstancePayloadWithDefaults() *PatchInstancePayload { this := PatchInstancePayload{} return &this } // GetAcl returns the Acl field value if set, zero value otherwise (both if not set or set to explicit null). +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchInstancePayload) GetAcl() (res PatchInstancePayloadGetAclRetType) { res, _ = o.GetAclOk() return @@ -69,60 +109,102 @@ func (o *PatchInstancePayload) GetAcl() (res PatchInstancePayloadGetAclRetType) // GetAclOk returns a tuple with the Acl field value if set, nil otherwise // and a boolean to check if the value has been set. // NOTE: If the value is an explicit nil, `nil, true` will be returned +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchInstancePayload) GetAclOk() (ret PatchInstancePayloadGetAclRetType, ok bool) { return getPatchInstancePayloadGetAclAttributeTypeOk(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 *PatchInstancePayload) 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 *PatchInstancePayload) SetAcl(v PatchInstancePayloadGetAclRetType) { setPatchInstancePayloadGetAclAttributeType(&o.Acl, v) } +// GetFeatureToggle returns the FeatureToggle 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 *PatchInstancePayload) GetFeatureToggle() (res PatchInstancePayloadGetFeatureToggleRetType) { + res, _ = o.GetFeatureToggleOk() + return +} + +// GetFeatureToggleOk returns a tuple with the FeatureToggle 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 *PatchInstancePayload) GetFeatureToggleOk() (ret PatchInstancePayloadGetFeatureToggleRetType, ok bool) { + return getPatchInstancePayloadGetFeatureToggleAttributeTypeOk(o.FeatureToggle) +} + +// HasFeatureToggle 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 *PatchInstancePayload) HasFeatureToggle() bool { + _, ok := o.GetFeatureToggleOk() + return ok +} + +// SetFeatureToggle gets a reference to the given FeatureToggle and assigns it to the FeatureToggle field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *PatchInstancePayload) SetFeatureToggle(v PatchInstancePayloadGetFeatureToggleRetType) { + setPatchInstancePayloadGetFeatureToggleAttributeType(&o.FeatureToggle, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PatchInstancePayload) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPatchInstancePayloadGetAclAttributeTypeOk(o.Acl); ok { toSerialize["Acl"] = val } + if val, ok := getPatchInstancePayloadGetFeatureToggleAttributeTypeOk(o.FeatureToggle); ok { + toSerialize["FeatureToggle"] = val + } return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePatchInstancePayload struct { value *PatchInstancePayload isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchInstancePayload) Get() *PatchInstancePayload { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchInstancePayload) Set(val *PatchInstancePayload) { 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 NullablePatchInstancePayload) 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 *NullablePatchInstancePayload) 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 NewNullablePatchInstancePayload(val *PatchInstancePayload) *NullablePatchInstancePayload { return &NullablePatchInstancePayload{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 NullablePatchInstancePayload) 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 *NullablePatchInstancePayload) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_patch_operation.go b/services/git/model_patch_operation.go index f6b4dd6c4..67b48a104 100644 --- a/services/git/model_patch_operation.go +++ b/services/git/model_patch_operation.go @@ -8,6 +8,7 @@ API version: 1beta.0.4 // 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 git import ( @@ -26,20 +27,25 @@ var _ MappedNullable = &PatchOperation{} // PatchOperationOp The patch operation to perform. // value type for enums +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationOp string // List of Op const ( - PATCHOPERATIONOP_ADD PatchOperationOp = "add" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead + PATCHOPERATIONOP_ADD PatchOperationOp = "add" + // Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead PATCHOPERATIONOP_REMOVE PatchOperationOp = "remove" ) // All allowed values of PatchOperation enum +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead var AllowedPatchOperationOpEnumValues = []PatchOperationOp{ "add", "remove", } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *PatchOperationOp) 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 @@ -67,6 +73,7 @@ func (v *PatchOperationOp) UnmarshalJSON(src []byte) error { // NewPatchOperationOpFromValue returns a pointer to a valid PatchOperationOp // 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 NewPatchOperationOpFromValue(v PatchOperationOp) (*PatchOperationOp, error) { ev := PatchOperationOp(v) if ev.IsValid() { @@ -77,6 +84,7 @@ func NewPatchOperationOpFromValue(v PatchOperationOp) (*PatchOperationOp, error) } // IsValid return true if the value is valid for the enum, false otherwise +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v PatchOperationOp) IsValid() bool { for _, existing := range AllowedPatchOperationOpEnumValues { if existing == v { @@ -87,50 +95,65 @@ func (v PatchOperationOp) IsValid() bool { } // Ptr returns reference to OpOp value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v PatchOperationOp) Ptr() *PatchOperationOp { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePatchOperationOp struct { value *PatchOperationOp isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchOperationOp) Get() *PatchOperationOp { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchOperationOp) Set(val *PatchOperationOp) { 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 NullablePatchOperationOp) 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 *NullablePatchOperationOp) 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 NewNullablePatchOperationOp(val *PatchOperationOp) *NullablePatchOperationOp { return &NullablePatchOperationOp{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 NullablePatchOperationOp) 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 *NullablePatchOperationOp) 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 PatchOperationGetOpAttributeType = *PatchOperationOp + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationGetOpArgType = PatchOperationOp + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationGetOpRetType = PatchOperationOp +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPatchOperationGetOpAttributeTypeOk(arg PatchOperationGetOpAttributeType) (ret PatchOperationGetOpRetType, ok bool) { if arg == nil { return ret, false @@ -138,6 +161,7 @@ func getPatchOperationGetOpAttributeTypeOk(arg PatchOperationGetOpAttributeType) return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPatchOperationGetOpAttributeType(arg *PatchOperationGetOpAttributeType, val PatchOperationGetOpRetType) { *arg = &val } @@ -147,8 +171,10 @@ func setPatchOperationGetOpAttributeType(arg *PatchOperationGetOpAttributeType, */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationGetPathAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPatchOperationGetPathAttributeTypeOk(arg PatchOperationGetPathAttributeType) (ret PatchOperationGetPathRetType, ok bool) { if arg == nil { return ret, false @@ -156,11 +182,15 @@ func getPatchOperationGetPathAttributeTypeOk(arg PatchOperationGetPathAttributeT return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPatchOperationGetPathAttributeType(arg *PatchOperationGetPathAttributeType, val PatchOperationGetPathRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationGetPathArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationGetPathRetType = string /* @@ -168,8 +198,10 @@ type PatchOperationGetPathRetType = string */ // isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationGetValueAttributeType = *string +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func getPatchOperationGetValueAttributeTypeOk(arg PatchOperationGetValueAttributeType) (ret PatchOperationGetValueRetType, ok bool) { if arg == nil { return ret, false @@ -177,14 +209,19 @@ func getPatchOperationGetValueAttributeTypeOk(arg PatchOperationGetValueAttribut return *arg, true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func setPatchOperationGetValueAttributeType(arg *PatchOperationGetValueAttributeType, val PatchOperationGetValueRetType) { *arg = &val } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationGetValueArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperationGetValueRetType = string // PatchOperation Request a STACKIT Git instance to be patch with these properties. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type PatchOperation struct { // The patch operation to perform. // REQUIRED @@ -196,12 +233,14 @@ type PatchOperation struct { Value PatchOperationGetValueAttributeType `json:"value,omitempty"` } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type _PatchOperation PatchOperation // NewPatchOperation instantiates a new PatchOperation 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 NewPatchOperation(op PatchOperationGetOpArgType, path PatchOperationGetPathArgType) *PatchOperation { this := PatchOperation{} setPatchOperationGetOpAttributeType(&this.Op, op) @@ -212,12 +251,14 @@ func NewPatchOperation(op PatchOperationGetOpArgType, path PatchOperationGetPath // NewPatchOperationWithDefaults instantiates a new PatchOperation 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 NewPatchOperationWithDefaults() *PatchOperation { this := PatchOperation{} return &this } // GetOp returns the Op field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchOperation) GetOp() (ret PatchOperationGetOpRetType) { ret, _ = o.GetOpOk() return ret @@ -225,16 +266,19 @@ func (o *PatchOperation) GetOp() (ret PatchOperationGetOpRetType) { // GetOpOk returns a tuple with the Op 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 *PatchOperation) GetOpOk() (ret PatchOperationGetOpRetType, ok bool) { return getPatchOperationGetOpAttributeTypeOk(o.Op) } // SetOp sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchOperation) SetOp(v PatchOperationGetOpRetType) { setPatchOperationGetOpAttributeType(&o.Op, v) } // GetPath returns the Path field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchOperation) GetPath() (ret PatchOperationGetPathRetType) { ret, _ = o.GetPathOk() return ret @@ -242,16 +286,19 @@ func (o *PatchOperation) GetPath() (ret PatchOperationGetPathRetType) { // GetPathOk returns a tuple with the Path 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 *PatchOperation) GetPathOk() (ret PatchOperationGetPathRetType, ok bool) { return getPatchOperationGetPathAttributeTypeOk(o.Path) } // SetPath sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchOperation) SetPath(v PatchOperationGetPathRetType) { setPatchOperationGetPathAttributeType(&o.Path, v) } // GetValue returns the Value 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 *PatchOperation) GetValue() (res PatchOperationGetValueRetType) { res, _ = o.GetValueOk() return @@ -259,21 +306,25 @@ func (o *PatchOperation) GetValue() (res PatchOperationGetValueRetType) { // GetValueOk returns a tuple with the Value 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 *PatchOperation) GetValueOk() (ret PatchOperationGetValueRetType, ok bool) { return getPatchOperationGetValueAttributeTypeOk(o.Value) } // HasValue 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 *PatchOperation) HasValue() bool { _, ok := o.GetValueOk() return ok } // SetValue gets a reference to the given string and assigns it to the Value field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o *PatchOperation) SetValue(v PatchOperationGetValueRetType) { setPatchOperationGetValueAttributeType(&o.Value, v) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (o PatchOperation) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPatchOperationGetOpAttributeTypeOk(o.Op); ok { @@ -288,37 +339,45 @@ func (o PatchOperation) ToMap() (map[string]interface{}, error) { return toSerialize, nil } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullablePatchOperation struct { value *PatchOperation isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullablePatchOperation) Get() *PatchOperation { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullablePatchOperation) Set(val *PatchOperation) { 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 NullablePatchOperation) 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 *NullablePatchOperation) 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 NewNullablePatchOperation(val *PatchOperation) *NullablePatchOperation { return &NullablePatchOperation{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 NullablePatchOperation) 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 *NullablePatchOperation) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) diff --git a/services/git/model_runner.go b/services/git/model_runner.go new file mode 100644 index 000000000..f93e66c98 --- /dev/null +++ b/services/git/model_runner.go @@ -0,0 +1,310 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" + "time" +) + +// checks if the Runner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Runner{} + +/* + types and functions for created_at +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetCreatedAtAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetCreatedAtArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetCreatedAtRetType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerGetCreatedAtAttributeTypeOk(arg RunnerGetCreatedAtAttributeType) (ret RunnerGetCreatedAtRetType, 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 setRunnerGetCreatedAtAttributeType(arg *RunnerGetCreatedAtAttributeType, val RunnerGetCreatedAtRetType) { + *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 RunnerGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerGetIdAttributeTypeOk(arg RunnerGetIdAttributeType) (ret RunnerGetIdRetType, 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 setRunnerGetIdAttributeType(arg *RunnerGetIdAttributeType, val RunnerGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetIdRetType = string + +/* + types and functions for labels +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetLabelsAttributeType = *[]string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetLabelsArgType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetLabelsRetType = []string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerGetLabelsAttributeTypeOk(arg RunnerGetLabelsAttributeType) (ret RunnerGetLabelsRetType, 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 setRunnerGetLabelsAttributeType(arg *RunnerGetLabelsAttributeType, val RunnerGetLabelsRetType) { + *arg = &val +} + +/* + types and functions for status +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetStatusAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerGetStatusAttributeTypeOk(arg RunnerGetStatusAttributeType) (ret RunnerGetStatusRetType, 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 setRunnerGetStatusAttributeType(arg *RunnerGetStatusAttributeType, val RunnerGetStatusRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetStatusArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerGetStatusRetType = string + +// Runner Describes a runner associated to a STACKIT Git instance. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type Runner struct { + // REQUIRED + CreatedAt RunnerGetCreatedAtAttributeType `json:"created_at" required:"true"` + // REQUIRED + Id RunnerGetIdAttributeType `json:"id" required:"true"` + // REQUIRED + Labels RunnerGetLabelsAttributeType `json:"labels" required:"true"` + // The current status of the runner. + // REQUIRED + Status RunnerGetStatusAttributeType `json:"status" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _Runner Runner + +// NewRunner instantiates a new Runner 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 NewRunner(createdAt RunnerGetCreatedAtArgType, id RunnerGetIdArgType, labels RunnerGetLabelsArgType, status RunnerGetStatusArgType) *Runner { + this := Runner{} + setRunnerGetCreatedAtAttributeType(&this.CreatedAt, createdAt) + setRunnerGetIdAttributeType(&this.Id, id) + setRunnerGetLabelsAttributeType(&this.Labels, labels) + setRunnerGetStatusAttributeType(&this.Status, status) + return &this +} + +// NewRunnerWithDefaults instantiates a new Runner 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 NewRunnerWithDefaults() *Runner { + this := Runner{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Runner) GetCreatedAt() (ret RunnerGetCreatedAtRetType) { + ret, _ = o.GetCreatedAtOk() + return ret +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Runner) GetCreatedAtOk() (ret RunnerGetCreatedAtRetType, ok bool) { + return getRunnerGetCreatedAtAttributeTypeOk(o.CreatedAt) +} + +// SetCreatedAt sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Runner) SetCreatedAt(v RunnerGetCreatedAtRetType) { + setRunnerGetCreatedAtAttributeType(&o.CreatedAt, 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 *Runner) GetId() (ret RunnerGetIdRetType) { + 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 *Runner) GetIdOk() (ret RunnerGetIdRetType, ok bool) { + return getRunnerGetIdAttributeTypeOk(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 *Runner) SetId(v RunnerGetIdRetType) { + setRunnerGetIdAttributeType(&o.Id, v) +} + +// GetLabels returns the Labels field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Runner) GetLabels() (ret RunnerGetLabelsRetType) { + ret, _ = o.GetLabelsOk() + return ret +} + +// GetLabelsOk returns a tuple with the Labels 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 *Runner) GetLabelsOk() (ret RunnerGetLabelsRetType, ok bool) { + return getRunnerGetLabelsAttributeTypeOk(o.Labels) +} + +// SetLabels sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *Runner) SetLabels(v RunnerGetLabelsRetType) { + setRunnerGetLabelsAttributeType(&o.Labels, 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 *Runner) GetStatus() (ret RunnerGetStatusRetType) { + 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 *Runner) GetStatusOk() (ret RunnerGetStatusRetType, ok bool) { + return getRunnerGetStatusAttributeTypeOk(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 *Runner) SetStatus(v RunnerGetStatusRetType) { + setRunnerGetStatusAttributeType(&o.Status, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o Runner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRunnerGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { + toSerialize["CreatedAt"] = val + } + if val, ok := getRunnerGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getRunnerGetLabelsAttributeTypeOk(o.Labels); ok { + toSerialize["Labels"] = val + } + if val, ok := getRunnerGetStatusAttributeTypeOk(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 NullableRunner struct { + value *Runner + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableRunner) Get() *Runner { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableRunner) Set(val *Runner) { + 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 NullableRunner) 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 *NullableRunner) 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 NewNullableRunner(val *Runner) *NullableRunner { + return &NullableRunner{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 NullableRunner) 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 *NullableRunner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_runner_label.go b/services/git/model_runner_label.go deleted file mode 100644 index 79036859c..000000000 --- a/services/git/model_runner_label.go +++ /dev/null @@ -1,217 +0,0 @@ -/* -STACKIT Git API - -STACKIT Git management API. - -API version: 1beta.0.4 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package git - -import ( - "encoding/json" -) - -// checks if the RunnerLabel type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &RunnerLabel{} - -/* - types and functions for description -*/ - -// isNotNullableString -type RunnerLabelGetDescriptionAttributeType = *string - -func getRunnerLabelGetDescriptionAttributeTypeOk(arg RunnerLabelGetDescriptionAttributeType) (ret RunnerLabelGetDescriptionRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRunnerLabelGetDescriptionAttributeType(arg *RunnerLabelGetDescriptionAttributeType, val RunnerLabelGetDescriptionRetType) { - *arg = &val -} - -type RunnerLabelGetDescriptionArgType = string -type RunnerLabelGetDescriptionRetType = string - -/* - types and functions for id -*/ - -// isNotNullableString -type RunnerLabelGetIdAttributeType = *string - -func getRunnerLabelGetIdAttributeTypeOk(arg RunnerLabelGetIdAttributeType) (ret RunnerLabelGetIdRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRunnerLabelGetIdAttributeType(arg *RunnerLabelGetIdAttributeType, val RunnerLabelGetIdRetType) { - *arg = &val -} - -type RunnerLabelGetIdArgType = string -type RunnerLabelGetIdRetType = string - -/* - types and functions for label -*/ - -// isNotNullableString -type RunnerLabelGetLabelAttributeType = *string - -func getRunnerLabelGetLabelAttributeTypeOk(arg RunnerLabelGetLabelAttributeType) (ret RunnerLabelGetLabelRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setRunnerLabelGetLabelAttributeType(arg *RunnerLabelGetLabelAttributeType, val RunnerLabelGetLabelRetType) { - *arg = &val -} - -type RunnerLabelGetLabelArgType = string -type RunnerLabelGetLabelRetType = string - -// RunnerLabel Describes a STACKIT Git RunnerLabel. -type RunnerLabel struct { - // RunnerLabel description. - // REQUIRED - Description RunnerLabelGetDescriptionAttributeType `json:"description" required:"true"` - // RunnerLabel id. - // REQUIRED - Id RunnerLabelGetIdAttributeType `json:"id" required:"true"` - // RunnerLabel label. - // REQUIRED - Label RunnerLabelGetLabelAttributeType `json:"label" required:"true"` -} - -type _RunnerLabel RunnerLabel - -// NewRunnerLabel instantiates a new RunnerLabel object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewRunnerLabel(description RunnerLabelGetDescriptionArgType, id RunnerLabelGetIdArgType, label RunnerLabelGetLabelArgType) *RunnerLabel { - this := RunnerLabel{} - setRunnerLabelGetDescriptionAttributeType(&this.Description, description) - setRunnerLabelGetIdAttributeType(&this.Id, id) - setRunnerLabelGetLabelAttributeType(&this.Label, label) - return &this -} - -// NewRunnerLabelWithDefaults instantiates a new RunnerLabel object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewRunnerLabelWithDefaults() *RunnerLabel { - this := RunnerLabel{} - return &this -} - -// GetDescription returns the Description field value -func (o *RunnerLabel) GetDescription() (ret RunnerLabelGetDescriptionRetType) { - ret, _ = o.GetDescriptionOk() - return ret -} - -// GetDescriptionOk returns a tuple with the Description field value -// and a boolean to check if the value has been set. -func (o *RunnerLabel) GetDescriptionOk() (ret RunnerLabelGetDescriptionRetType, ok bool) { - return getRunnerLabelGetDescriptionAttributeTypeOk(o.Description) -} - -// SetDescription sets field value -func (o *RunnerLabel) SetDescription(v RunnerLabelGetDescriptionRetType) { - setRunnerLabelGetDescriptionAttributeType(&o.Description, v) -} - -// GetId returns the Id field value -func (o *RunnerLabel) GetId() (ret RunnerLabelGetIdRetType) { - 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. -func (o *RunnerLabel) GetIdOk() (ret RunnerLabelGetIdRetType, ok bool) { - return getRunnerLabelGetIdAttributeTypeOk(o.Id) -} - -// SetId sets field value -func (o *RunnerLabel) SetId(v RunnerLabelGetIdRetType) { - setRunnerLabelGetIdAttributeType(&o.Id, v) -} - -// GetLabel returns the Label field value -func (o *RunnerLabel) GetLabel() (ret RunnerLabelGetLabelRetType) { - ret, _ = o.GetLabelOk() - return ret -} - -// GetLabelOk returns a tuple with the Label field value -// and a boolean to check if the value has been set. -func (o *RunnerLabel) GetLabelOk() (ret RunnerLabelGetLabelRetType, ok bool) { - return getRunnerLabelGetLabelAttributeTypeOk(o.Label) -} - -// SetLabel sets field value -func (o *RunnerLabel) SetLabel(v RunnerLabelGetLabelRetType) { - setRunnerLabelGetLabelAttributeType(&o.Label, v) -} - -func (o RunnerLabel) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getRunnerLabelGetDescriptionAttributeTypeOk(o.Description); ok { - toSerialize["Description"] = val - } - if val, ok := getRunnerLabelGetIdAttributeTypeOk(o.Id); ok { - toSerialize["Id"] = val - } - if val, ok := getRunnerLabelGetLabelAttributeTypeOk(o.Label); ok { - toSerialize["Label"] = val - } - return toSerialize, nil -} - -type NullableRunnerLabel struct { - value *RunnerLabel - isSet bool -} - -func (v NullableRunnerLabel) Get() *RunnerLabel { - return v.value -} - -func (v *NullableRunnerLabel) Set(val *RunnerLabel) { - v.value = val - v.isSet = true -} - -func (v NullableRunnerLabel) IsSet() bool { - return v.isSet -} - -func (v *NullableRunnerLabel) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableRunnerLabel(val *RunnerLabel) *NullableRunnerLabel { - return &NullableRunnerLabel{value: val, isSet: true} -} - -func (v NullableRunnerLabel) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableRunnerLabel) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/git/model_runner_runtime.go b/services/git/model_runner_runtime.go new file mode 100644 index 000000000..36e2e7c98 --- /dev/null +++ b/services/git/model_runner_runtime.go @@ -0,0 +1,366 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the RunnerRuntime type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunnerRuntime{} + +/* + types and functions for availability +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetAvailabilityAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerRuntimeGetAvailabilityAttributeTypeOk(arg RunnerRuntimeGetAvailabilityAttributeType) (ret RunnerRuntimeGetAvailabilityRetType, 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 setRunnerRuntimeGetAvailabilityAttributeType(arg *RunnerRuntimeGetAvailabilityAttributeType, val RunnerRuntimeGetAvailabilityRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetAvailabilityArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetAvailabilityRetType = 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 RunnerRuntimeGetDescriptionAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerRuntimeGetDescriptionAttributeTypeOk(arg RunnerRuntimeGetDescriptionAttributeType) (ret RunnerRuntimeGetDescriptionRetType, 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 setRunnerRuntimeGetDescriptionAttributeType(arg *RunnerRuntimeGetDescriptionAttributeType, val RunnerRuntimeGetDescriptionRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetDescriptionArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetDescriptionRetType = string + +/* + types and functions for display_name +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetDisplayNameAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerRuntimeGetDisplayNameAttributeTypeOk(arg RunnerRuntimeGetDisplayNameAttributeType) (ret RunnerRuntimeGetDisplayNameRetType, 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 setRunnerRuntimeGetDisplayNameAttributeType(arg *RunnerRuntimeGetDisplayNameAttributeType, val RunnerRuntimeGetDisplayNameRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetDisplayNameArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetDisplayNameRetType = 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 RunnerRuntimeGetIdAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerRuntimeGetIdAttributeTypeOk(arg RunnerRuntimeGetIdAttributeType) (ret RunnerRuntimeGetIdRetType, 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 setRunnerRuntimeGetIdAttributeType(arg *RunnerRuntimeGetIdAttributeType, val RunnerRuntimeGetIdRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetIdArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetIdRetType = string + +/* + types and functions for label +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetLabelAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerRuntimeGetLabelAttributeTypeOk(arg RunnerRuntimeGetLabelAttributeType) (ret RunnerRuntimeGetLabelRetType, 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 setRunnerRuntimeGetLabelAttributeType(arg *RunnerRuntimeGetLabelAttributeType, val RunnerRuntimeGetLabelRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetLabelArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeGetLabelRetType = string + +// RunnerRuntime Describes a STACKIT Git Runner runtime. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntime struct { + // Indicates the availability of the runner label + // REQUIRED + Availability RunnerRuntimeGetAvailabilityAttributeType `json:"availability" required:"true"` + // Human-friendly description of the runtime and it's capabilities. + // REQUIRED + Description RunnerRuntimeGetDescriptionAttributeType `json:"description" required:"true"` + // Human-friendly name of the runtime. + // REQUIRED + DisplayName RunnerRuntimeGetDisplayNameAttributeType `json:"display_name" required:"true"` + // Runtime identifier. + // REQUIRED + Id RunnerRuntimeGetIdAttributeType `json:"id" required:"true"` + // Runtime label. + // REQUIRED + Label RunnerRuntimeGetLabelAttributeType `json:"label" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _RunnerRuntime RunnerRuntime + +// NewRunnerRuntime instantiates a new RunnerRuntime 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 NewRunnerRuntime(availability RunnerRuntimeGetAvailabilityArgType, description RunnerRuntimeGetDescriptionArgType, displayName RunnerRuntimeGetDisplayNameArgType, id RunnerRuntimeGetIdArgType, label RunnerRuntimeGetLabelArgType) *RunnerRuntime { + this := RunnerRuntime{} + setRunnerRuntimeGetAvailabilityAttributeType(&this.Availability, availability) + setRunnerRuntimeGetDescriptionAttributeType(&this.Description, description) + setRunnerRuntimeGetDisplayNameAttributeType(&this.DisplayName, displayName) + setRunnerRuntimeGetIdAttributeType(&this.Id, id) + setRunnerRuntimeGetLabelAttributeType(&this.Label, label) + return &this +} + +// NewRunnerRuntimeWithDefaults instantiates a new RunnerRuntime 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 NewRunnerRuntimeWithDefaults() *RunnerRuntime { + this := RunnerRuntime{} + return &this +} + +// GetAvailability returns the Availability field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *RunnerRuntime) GetAvailability() (ret RunnerRuntimeGetAvailabilityRetType) { + ret, _ = o.GetAvailabilityOk() + return ret +} + +// GetAvailabilityOk returns a tuple with the Availability 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 *RunnerRuntime) GetAvailabilityOk() (ret RunnerRuntimeGetAvailabilityRetType, ok bool) { + return getRunnerRuntimeGetAvailabilityAttributeTypeOk(o.Availability) +} + +// SetAvailability sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *RunnerRuntime) SetAvailability(v RunnerRuntimeGetAvailabilityRetType) { + setRunnerRuntimeGetAvailabilityAttributeType(&o.Availability, v) +} + +// GetDescription returns the Description field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *RunnerRuntime) GetDescription() (ret RunnerRuntimeGetDescriptionRetType) { + ret, _ = o.GetDescriptionOk() + return ret +} + +// GetDescriptionOk returns a tuple with the Description 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 *RunnerRuntime) GetDescriptionOk() (ret RunnerRuntimeGetDescriptionRetType, ok bool) { + return getRunnerRuntimeGetDescriptionAttributeTypeOk(o.Description) +} + +// SetDescription sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *RunnerRuntime) SetDescription(v RunnerRuntimeGetDescriptionRetType) { + setRunnerRuntimeGetDescriptionAttributeType(&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 *RunnerRuntime) GetDisplayName() (ret RunnerRuntimeGetDisplayNameRetType) { + 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 *RunnerRuntime) GetDisplayNameOk() (ret RunnerRuntimeGetDisplayNameRetType, ok bool) { + return getRunnerRuntimeGetDisplayNameAttributeTypeOk(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 *RunnerRuntime) SetDisplayName(v RunnerRuntimeGetDisplayNameRetType) { + setRunnerRuntimeGetDisplayNameAttributeType(&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 *RunnerRuntime) GetId() (ret RunnerRuntimeGetIdRetType) { + 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 *RunnerRuntime) GetIdOk() (ret RunnerRuntimeGetIdRetType, ok bool) { + return getRunnerRuntimeGetIdAttributeTypeOk(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 *RunnerRuntime) SetId(v RunnerRuntimeGetIdRetType) { + setRunnerRuntimeGetIdAttributeType(&o.Id, v) +} + +// GetLabel returns the Label field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *RunnerRuntime) GetLabel() (ret RunnerRuntimeGetLabelRetType) { + ret, _ = o.GetLabelOk() + return ret +} + +// GetLabelOk returns a tuple with the Label 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 *RunnerRuntime) GetLabelOk() (ret RunnerRuntimeGetLabelRetType, ok bool) { + return getRunnerRuntimeGetLabelAttributeTypeOk(o.Label) +} + +// SetLabel sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *RunnerRuntime) SetLabel(v RunnerRuntimeGetLabelRetType) { + setRunnerRuntimeGetLabelAttributeType(&o.Label, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o RunnerRuntime) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRunnerRuntimeGetAvailabilityAttributeTypeOk(o.Availability); ok { + toSerialize["Availability"] = val + } + if val, ok := getRunnerRuntimeGetDescriptionAttributeTypeOk(o.Description); ok { + toSerialize["Description"] = val + } + if val, ok := getRunnerRuntimeGetDisplayNameAttributeTypeOk(o.DisplayName); ok { + toSerialize["DisplayName"] = val + } + if val, ok := getRunnerRuntimeGetIdAttributeTypeOk(o.Id); ok { + toSerialize["Id"] = val + } + if val, ok := getRunnerRuntimeGetLabelAttributeTypeOk(o.Label); ok { + toSerialize["Label"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableRunnerRuntime struct { + value *RunnerRuntime + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableRunnerRuntime) Get() *RunnerRuntime { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableRunnerRuntime) Set(val *RunnerRuntime) { + 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 NullableRunnerRuntime) 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 *NullableRunnerRuntime) 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 NewNullableRunnerRuntime(val *RunnerRuntime) *NullableRunnerRuntime { + return &NullableRunnerRuntime{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 NullableRunnerRuntime) 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 *NullableRunnerRuntime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_runner_runtime_list.go b/services/git/model_runner_runtime_list.go new file mode 100644 index 000000000..63ba57688 --- /dev/null +++ b/services/git/model_runner_runtime_list.go @@ -0,0 +1,149 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" +) + +// checks if the RunnerRuntimeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunnerRuntimeList{} + +/* + types and functions for items +*/ + +// isArray +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeListGetItemsAttributeType = *[]RunnerRuntime + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeListGetItemsArgType = []RunnerRuntime + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeListGetItemsRetType = []RunnerRuntime + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getRunnerRuntimeListGetItemsAttributeTypeOk(arg RunnerRuntimeListGetItemsAttributeType) (ret RunnerRuntimeListGetItemsRetType, 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 setRunnerRuntimeListGetItemsAttributeType(arg *RunnerRuntimeListGetItemsAttributeType, val RunnerRuntimeListGetItemsRetType) { + *arg = &val +} + +// RunnerRuntimeList A list of STACKIT Git RunnerLabels. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type RunnerRuntimeList struct { + // REQUIRED + Items RunnerRuntimeListGetItemsAttributeType `json:"items" required:"true"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _RunnerRuntimeList RunnerRuntimeList + +// NewRunnerRuntimeList instantiates a new RunnerRuntimeList 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 NewRunnerRuntimeList(items RunnerRuntimeListGetItemsArgType) *RunnerRuntimeList { + this := RunnerRuntimeList{} + setRunnerRuntimeListGetItemsAttributeType(&this.Items, items) + return &this +} + +// NewRunnerRuntimeListWithDefaults instantiates a new RunnerRuntimeList 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 NewRunnerRuntimeListWithDefaults() *RunnerRuntimeList { + this := RunnerRuntimeList{} + return &this +} + +// GetItems returns the Items field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *RunnerRuntimeList) GetItems() (ret RunnerRuntimeListGetItemsRetType) { + ret, _ = o.GetItemsOk() + return ret +} + +// GetItemsOk returns a tuple with the Items 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 *RunnerRuntimeList) GetItemsOk() (ret RunnerRuntimeListGetItemsRetType, ok bool) { + return getRunnerRuntimeListGetItemsAttributeTypeOk(o.Items) +} + +// SetItems sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *RunnerRuntimeList) SetItems(v RunnerRuntimeListGetItemsRetType) { + setRunnerRuntimeListGetItemsAttributeType(&o.Items, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o RunnerRuntimeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getRunnerRuntimeListGetItemsAttributeTypeOk(o.Items); ok { + toSerialize["Items"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableRunnerRuntimeList struct { + value *RunnerRuntimeList + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableRunnerRuntimeList) Get() *RunnerRuntimeList { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableRunnerRuntimeList) Set(val *RunnerRuntimeList) { + 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 NullableRunnerRuntimeList) 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 *NullableRunnerRuntimeList) 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 NewNullableRunnerRuntimeList(val *RunnerRuntimeList) *NullableRunnerRuntimeList { + return &NullableRunnerRuntimeList{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 NullableRunnerRuntimeList) 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 *NullableRunnerRuntimeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_runner_runtime_list_test.go b/services/git/model_runner_runtime_list_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_runner_runtime_list_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_runner_runtime_test.go b/services/git/model_runner_runtime_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_runner_runtime_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_runner_test.go b/services/git/model_runner_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_runner_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_unauthorized_error_response.go b/services/git/model_unauthorized_error_response.go new file mode 100644 index 000000000..1ebe28ac2 --- /dev/null +++ b/services/git/model_unauthorized_error_response.go @@ -0,0 +1,382 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// 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 git + +import ( + "encoding/json" + "time" +) + +// checks if the UnauthorizedErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UnauthorizedErrorResponse{} + +/* + types and functions for error +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetErrorAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUnauthorizedErrorResponseGetErrorAttributeTypeOk(arg UnauthorizedErrorResponseGetErrorAttributeType) (ret UnauthorizedErrorResponseGetErrorRetType, 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 setUnauthorizedErrorResponseGetErrorAttributeType(arg *UnauthorizedErrorResponseGetErrorAttributeType, val UnauthorizedErrorResponseGetErrorRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetErrorArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetErrorRetType = string + +/* + types and functions for message +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetMessageAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUnauthorizedErrorResponseGetMessageAttributeTypeOk(arg UnauthorizedErrorResponseGetMessageAttributeType) (ret UnauthorizedErrorResponseGetMessageRetType, 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 setUnauthorizedErrorResponseGetMessageAttributeType(arg *UnauthorizedErrorResponseGetMessageAttributeType, val UnauthorizedErrorResponseGetMessageRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetMessageArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetMessageRetType = string + +/* + types and functions for path +*/ + +// isNotNullableString +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetPathAttributeType = *string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUnauthorizedErrorResponseGetPathAttributeTypeOk(arg UnauthorizedErrorResponseGetPathAttributeType) (ret UnauthorizedErrorResponseGetPathRetType, 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 setUnauthorizedErrorResponseGetPathAttributeType(arg *UnauthorizedErrorResponseGetPathAttributeType, val UnauthorizedErrorResponseGetPathRetType) { + *arg = &val +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetPathArgType = string + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetPathRetType = string + +/* + types and functions for status +*/ + +// isInteger +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetStatusAttributeType = *int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetStatusArgType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetStatusRetType = int64 + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUnauthorizedErrorResponseGetStatusAttributeTypeOk(arg UnauthorizedErrorResponseGetStatusAttributeType) (ret UnauthorizedErrorResponseGetStatusRetType, 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 setUnauthorizedErrorResponseGetStatusAttributeType(arg *UnauthorizedErrorResponseGetStatusAttributeType, val UnauthorizedErrorResponseGetStatusRetType) { + *arg = &val +} + +/* + types and functions for timestamp +*/ + +// isDateTime +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetTimestampAttributeType = *time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetTimestampArgType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponseGetTimestampRetType = time.Time + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func getUnauthorizedErrorResponseGetTimestampAttributeTypeOk(arg UnauthorizedErrorResponseGetTimestampAttributeType) (ret UnauthorizedErrorResponseGetTimestampRetType, 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 setUnauthorizedErrorResponseGetTimestampAttributeType(arg *UnauthorizedErrorResponseGetTimestampAttributeType, val UnauthorizedErrorResponseGetTimestampRetType) { + *arg = &val +} + +// UnauthorizedErrorResponse Unauthorized Error Response. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type UnauthorizedErrorResponse struct { + Error UnauthorizedErrorResponseGetErrorAttributeType `json:"error,omitempty"` + // REQUIRED + Message UnauthorizedErrorResponseGetMessageAttributeType `json:"message" required:"true"` + Path UnauthorizedErrorResponseGetPathAttributeType `json:"path,omitempty"` + Status UnauthorizedErrorResponseGetStatusAttributeType `json:"status,omitempty"` + Timestamp UnauthorizedErrorResponseGetTimestampAttributeType `json:"timestamp,omitempty"` +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type _UnauthorizedErrorResponse UnauthorizedErrorResponse + +// NewUnauthorizedErrorResponse instantiates a new UnauthorizedErrorResponse 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 NewUnauthorizedErrorResponse(message UnauthorizedErrorResponseGetMessageArgType) *UnauthorizedErrorResponse { + this := UnauthorizedErrorResponse{} + setUnauthorizedErrorResponseGetMessageAttributeType(&this.Message, message) + return &this +} + +// NewUnauthorizedErrorResponseWithDefaults instantiates a new UnauthorizedErrorResponse 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 NewUnauthorizedErrorResponseWithDefaults() *UnauthorizedErrorResponse { + this := UnauthorizedErrorResponse{} + return &this +} + +// GetError returns the Error 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 *UnauthorizedErrorResponse) GetError() (res UnauthorizedErrorResponseGetErrorRetType) { + res, _ = o.GetErrorOk() + return +} + +// GetErrorOk returns a tuple with the Error 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 *UnauthorizedErrorResponse) GetErrorOk() (ret UnauthorizedErrorResponseGetErrorRetType, ok bool) { + return getUnauthorizedErrorResponseGetErrorAttributeTypeOk(o.Error) +} + +// HasError 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 *UnauthorizedErrorResponse) HasError() bool { + _, ok := o.GetErrorOk() + return ok +} + +// SetError gets a reference to the given string and assigns it to the Error field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) SetError(v UnauthorizedErrorResponseGetErrorRetType) { + setUnauthorizedErrorResponseGetErrorAttributeType(&o.Error, v) +} + +// GetMessage returns the Message field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) GetMessage() (ret UnauthorizedErrorResponseGetMessageRetType) { + ret, _ = o.GetMessageOk() + return ret +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) GetMessageOk() (ret UnauthorizedErrorResponseGetMessageRetType, ok bool) { + return getUnauthorizedErrorResponseGetMessageAttributeTypeOk(o.Message) +} + +// SetMessage sets field value +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) SetMessage(v UnauthorizedErrorResponseGetMessageRetType) { + setUnauthorizedErrorResponseGetMessageAttributeType(&o.Message, v) +} + +// GetPath returns the Path 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 *UnauthorizedErrorResponse) GetPath() (res UnauthorizedErrorResponseGetPathRetType) { + res, _ = o.GetPathOk() + return +} + +// GetPathOk returns a tuple with the Path 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 *UnauthorizedErrorResponse) GetPathOk() (ret UnauthorizedErrorResponseGetPathRetType, ok bool) { + return getUnauthorizedErrorResponseGetPathAttributeTypeOk(o.Path) +} + +// HasPath 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 *UnauthorizedErrorResponse) HasPath() bool { + _, ok := o.GetPathOk() + return ok +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) SetPath(v UnauthorizedErrorResponseGetPathRetType) { + setUnauthorizedErrorResponseGetPathAttributeType(&o.Path, v) +} + +// GetStatus returns the Status field value if set, zero value otherwise. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) GetStatus() (res UnauthorizedErrorResponseGetStatusRetType) { + res, _ = o.GetStatusOk() + return +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) GetStatusOk() (ret UnauthorizedErrorResponseGetStatusRetType, ok bool) { + return getUnauthorizedErrorResponseGetStatusAttributeTypeOk(o.Status) +} + +// HasStatus returns a boolean if a field has been set. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) HasStatus() bool { + _, ok := o.GetStatusOk() + return ok +} + +// SetStatus gets a reference to the given int64 and assigns it to the Status field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) SetStatus(v UnauthorizedErrorResponseGetStatusRetType) { + setUnauthorizedErrorResponseGetStatusAttributeType(&o.Status, v) +} + +// GetTimestamp returns the Timestamp 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 *UnauthorizedErrorResponse) GetTimestamp() (res UnauthorizedErrorResponseGetTimestampRetType) { + res, _ = o.GetTimestampOk() + return +} + +// GetTimestampOk returns a tuple with the Timestamp 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 *UnauthorizedErrorResponse) GetTimestampOk() (ret UnauthorizedErrorResponseGetTimestampRetType, ok bool) { + return getUnauthorizedErrorResponseGetTimestampAttributeTypeOk(o.Timestamp) +} + +// HasTimestamp 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 *UnauthorizedErrorResponse) HasTimestamp() bool { + _, ok := o.GetTimestampOk() + return ok +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o *UnauthorizedErrorResponse) SetTimestamp(v UnauthorizedErrorResponseGetTimestampRetType) { + setUnauthorizedErrorResponseGetTimestampAttributeType(&o.Timestamp, v) +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (o UnauthorizedErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if val, ok := getUnauthorizedErrorResponseGetErrorAttributeTypeOk(o.Error); ok { + toSerialize["Error"] = val + } + if val, ok := getUnauthorizedErrorResponseGetMessageAttributeTypeOk(o.Message); ok { + toSerialize["Message"] = val + } + if val, ok := getUnauthorizedErrorResponseGetPathAttributeTypeOk(o.Path); ok { + toSerialize["Path"] = val + } + if val, ok := getUnauthorizedErrorResponseGetStatusAttributeTypeOk(o.Status); ok { + toSerialize["Status"] = val + } + if val, ok := getUnauthorizedErrorResponseGetTimestampAttributeTypeOk(o.Timestamp); ok { + toSerialize["Timestamp"] = val + } + return toSerialize, nil +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +type NullableUnauthorizedErrorResponse struct { + value *UnauthorizedErrorResponse + isSet bool +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v NullableUnauthorizedErrorResponse) Get() *UnauthorizedErrorResponse { + return v.value +} + +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +func (v *NullableUnauthorizedErrorResponse) Set(val *UnauthorizedErrorResponse) { + 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 NullableUnauthorizedErrorResponse) 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 *NullableUnauthorizedErrorResponse) 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 NewNullableUnauthorizedErrorResponse(val *UnauthorizedErrorResponse) *NullableUnauthorizedErrorResponse { + return &NullableUnauthorizedErrorResponse{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 NullableUnauthorizedErrorResponse) 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 *NullableUnauthorizedErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/model_unauthorized_error_response_test.go b/services/git/model_unauthorized_error_response_test.go new file mode 100644 index 000000000..e39c866ed --- /dev/null +++ b/services/git/model_unauthorized_error_response_test.go @@ -0,0 +1,11 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package git diff --git a/services/git/model_unauthorized_response.go b/services/git/model_unauthorized_response.go deleted file mode 100644 index 853468a95..000000000 --- a/services/git/model_unauthorized_response.go +++ /dev/null @@ -1,128 +0,0 @@ -/* -STACKIT Git API - -STACKIT Git management API. - -API version: 1beta.0.4 -*/ - -// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. - -package git - -import ( - "encoding/json" -) - -// checks if the UnauthorizedResponse type satisfies the MappedNullable interface at compile time -var _ MappedNullable = &UnauthorizedResponse{} - -/* - types and functions for error -*/ - -// isNotNullableString -type UnauthorizedResponseGetErrorAttributeType = *string - -func getUnauthorizedResponseGetErrorAttributeTypeOk(arg UnauthorizedResponseGetErrorAttributeType) (ret UnauthorizedResponseGetErrorRetType, ok bool) { - if arg == nil { - return ret, false - } - return *arg, true -} - -func setUnauthorizedResponseGetErrorAttributeType(arg *UnauthorizedResponseGetErrorAttributeType, val UnauthorizedResponseGetErrorRetType) { - *arg = &val -} - -type UnauthorizedResponseGetErrorArgType = string -type UnauthorizedResponseGetErrorRetType = string - -// UnauthorizedResponse The request could not be authorized. -type UnauthorizedResponse struct { - Error UnauthorizedResponseGetErrorAttributeType `json:"error,omitempty"` -} - -// NewUnauthorizedResponse instantiates a new UnauthorizedResponse object -// This constructor will assign default values to properties that have it defined, -// and makes sure properties required by API are set, but the set of arguments -// will change when the set of required properties is changed -func NewUnauthorizedResponse() *UnauthorizedResponse { - this := UnauthorizedResponse{} - return &this -} - -// NewUnauthorizedResponseWithDefaults instantiates a new UnauthorizedResponse object -// This constructor will only assign default values to properties that have it defined, -// but it doesn't guarantee that properties required by API are set -func NewUnauthorizedResponseWithDefaults() *UnauthorizedResponse { - this := UnauthorizedResponse{} - return &this -} - -// GetError returns the Error field value if set, zero value otherwise. -func (o *UnauthorizedResponse) GetError() (res UnauthorizedResponseGetErrorRetType) { - res, _ = o.GetErrorOk() - return -} - -// GetErrorOk returns a tuple with the Error field value if set, nil otherwise -// and a boolean to check if the value has been set. -func (o *UnauthorizedResponse) GetErrorOk() (ret UnauthorizedResponseGetErrorRetType, ok bool) { - return getUnauthorizedResponseGetErrorAttributeTypeOk(o.Error) -} - -// HasError returns a boolean if a field has been set. -func (o *UnauthorizedResponse) HasError() bool { - _, ok := o.GetErrorOk() - return ok -} - -// SetError gets a reference to the given string and assigns it to the Error field. -func (o *UnauthorizedResponse) SetError(v UnauthorizedResponseGetErrorRetType) { - setUnauthorizedResponseGetErrorAttributeType(&o.Error, v) -} - -func (o UnauthorizedResponse) ToMap() (map[string]interface{}, error) { - toSerialize := map[string]interface{}{} - if val, ok := getUnauthorizedResponseGetErrorAttributeTypeOk(o.Error); ok { - toSerialize["Error"] = val - } - return toSerialize, nil -} - -type NullableUnauthorizedResponse struct { - value *UnauthorizedResponse - isSet bool -} - -func (v NullableUnauthorizedResponse) Get() *UnauthorizedResponse { - return v.value -} - -func (v *NullableUnauthorizedResponse) Set(val *UnauthorizedResponse) { - v.value = val - v.isSet = true -} - -func (v NullableUnauthorizedResponse) IsSet() bool { - return v.isSet -} - -func (v *NullableUnauthorizedResponse) Unset() { - v.value = nil - v.isSet = false -} - -func NewNullableUnauthorizedResponse(val *UnauthorizedResponse) *NullableUnauthorizedResponse { - return &NullableUnauthorizedResponse{value: val, isSet: true} -} - -func (v NullableUnauthorizedResponse) MarshalJSON() ([]byte, error) { - return json.Marshal(v.value) -} - -func (v *NullableUnauthorizedResponse) UnmarshalJSON(src []byte) error { - v.isSet = true - return json.Unmarshal(src, &v.value) -} diff --git a/services/git/oas_commit b/services/git/oas_commit new file mode 100644 index 000000000..f5e4510f9 --- /dev/null +++ b/services/git/oas_commit @@ -0,0 +1 @@ +73b7457504497158e2836857f5ca4d2e6186ee5d diff --git a/services/git/utils.go b/services/git/utils.go index 46c89fe2a..a9f4a804b 100644 --- a/services/git/utils.go +++ b/services/git/utils.go @@ -18,341 +18,419 @@ import ( ) // PtrBool is a helper routine that returns a pointer to given boolean value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrBool(v bool) *bool { return &v } // PtrInt is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt(v int) *int { return &v } // PtrInt32 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt32(v int32) *int32 { return &v } // PtrInt64 is a helper routine that returns a pointer to given integer value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrInt64(v int64) *int64 { return &v } // PtrFloat32 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat32(v float32) *float32 { return &v } // PtrFloat64 is a helper routine that returns a pointer to given float value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrFloat64(v float64) *float64 { return &v } // PtrString is a helper routine that returns a pointer to given string value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrString(v string) *string { return &v } // PtrTime is helper routine that returns a pointer to given Time value. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func PtrTime(v time.Time) *time.Time { return &v } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableValue[T any] struct { value *T isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) Get() *T { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Set(val *T) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableValue[T]) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableValue[T]) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableBool struct { value *bool isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) Get() *bool { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Set(val *bool) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableBool(val *bool) *NullableBool { return &NullableBool{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableBool) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableBool) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt struct { value *int isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) Get() *int { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Set(val *int) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt(val *int) *NullableInt { return &NullableInt{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt32 struct { value *int32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) Get() *int32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Set(val *int32) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt32(val *int32) *NullableInt32 { return &NullableInt32{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableInt64 struct { value *int64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) Get() *int64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Set(val *int64) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableInt64(val *int64) *NullableInt64 { return &NullableInt64{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableInt64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableInt64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat32 struct { value *float32 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) Get() *float32 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Set(val *float32) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFloat32(val *float32) *NullableFloat32 { return &NullableFloat32{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat32) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat32) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableFloat64 struct { value *float64 isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) Get() *float64 { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Set(val *float64) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableFloat64(val *float64) *NullableFloat64 { return &NullableFloat64{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableFloat64) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableFloat64) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableString struct { value *string isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) Get() *string { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Set(val *string) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableString(val *string) *NullableString { return &NullableString{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableString) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableString) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type NullableTime struct { value *time.Time isSet bool } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) Get() *time.Time { return v.value } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Set(val *time.Time) { v.value = val v.isSet = true } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) IsSet() bool { return v.isSet } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) Unset() { v.value = nil v.isSet = false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func NewNullableTime(val *time.Time) *NullableTime { return &NullableTime{value: val, isSet: true} } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v NullableTime) MarshalJSON() ([]byte, error) { return v.value.MarshalJSON() } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func (v *NullableTime) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } // IsNil checks if an input is nil +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func IsNil(i interface{}) bool { if i == nil { return true @@ -369,13 +447,16 @@ func IsNil(i interface{}) bool { return false } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead type MappedNullable interface { ToMap() (map[string]interface{}, error) } +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead const letterRunes = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" // randString returns a random string with a specified length. It panics if n <= 0. +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead func randString(n int) string { b := make([]byte, n) for i := range b { diff --git a/services/git/v1betaapi/api_default.go b/services/git/v1betaapi/api_default.go new file mode 100644 index 000000000..b3d59aa78 --- /dev/null +++ b/services/git/v1betaapi/api_default.go @@ -0,0 +1,2789 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "bytes" + "context" + "io" + "net/http" + "net/url" + "strings" + + "github.com/stackitcloud/stackit-sdk-go/core/config" + "github.com/stackitcloud/stackit-sdk-go/core/oapierror" +) + +type DefaultAPI interface { + + /* + CreateAuthentication Creates an authentication source + + Creates an authentication source for the corresponding STACKIT Git instance + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiCreateAuthenticationRequest + */ + CreateAuthentication(ctx context.Context, projectId string, instanceId string) ApiCreateAuthenticationRequest + + // CreateAuthenticationExecute executes the request + // @return Authentication + CreateAuthenticationExecute(r ApiCreateAuthenticationRequest) (*Authentication, error) + + /* + CreateInstance Create an Instance. + + Creates a new STACKIT Git instance as a project resource. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiCreateInstanceRequest + */ + CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest + + // CreateInstanceExecute executes the request + // @return Instance + CreateInstanceExecute(r ApiCreateInstanceRequest) (*Instance, error) + + /* + CreateRunner Create the runner associated to this instance. + + Creates the runner associated to this STACKIT Git instance. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiCreateRunnerRequest + */ + CreateRunner(ctx context.Context, projectId string, instanceId string) ApiCreateRunnerRequest + + // CreateRunnerExecute executes the request + // @return Runner + CreateRunnerExecute(r ApiCreateRunnerRequest) (*Runner, error) + + /* + DeleteAuthentication Delete Authentication Source + + Deletes the authentication source associated to this STACKIT Git instance. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiDeleteAuthenticationRequest + */ + DeleteAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiDeleteAuthenticationRequest + + // DeleteAuthenticationExecute executes the request + DeleteAuthenticationExecute(r ApiDeleteAuthenticationRequest) error + + /* + DeleteInstance Delete Instance. + + Deletes a STACKIT Git instance and destroys all associated data. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiDeleteInstanceRequest + */ + DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest + + // DeleteInstanceExecute executes the request + DeleteInstanceExecute(r ApiDeleteInstanceRequest) error + + /* + DeleteRunner Delete Runner. + + Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiDeleteRunnerRequest + */ + DeleteRunner(ctx context.Context, projectId string, instanceId string) ApiDeleteRunnerRequest + + // DeleteRunnerExecute executes the request + DeleteRunnerExecute(r ApiDeleteRunnerRequest) error + + /* + GetAuthentication Get authentication provider + + Get authentication provider + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiGetAuthenticationRequest + */ + GetAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiGetAuthenticationRequest + + // GetAuthenticationExecute executes the request + // @return Authentication + GetAuthenticationExecute(r ApiGetAuthenticationRequest) (*Authentication, error) + + /* + GetInstance Get Instance information. + + Retrieves information about a STACKIT Git instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiGetInstanceRequest + */ + GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest + + // GetInstanceExecute executes the request + // @return Instance + GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) + + /* + GetRunner Get Runner information. + + Retrieves information about a runner in a STACKIT Git instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiGetRunnerRequest + */ + GetRunner(ctx context.Context, projectId string, instanceId string) ApiGetRunnerRequest + + // GetRunnerExecute executes the request + // @return Runner + GetRunnerExecute(r ApiGetRunnerRequest) (*Runner, error) + + /* + ListAuthentication List authentication sources + + Lists all authentication sources belonging to a specific instance + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiListAuthenticationRequest + */ + ListAuthentication(ctx context.Context, projectId string, instanceId string) ApiListAuthenticationRequest + + // ListAuthenticationExecute executes the request + // @return AuthenticationList + ListAuthenticationExecute(r ApiListAuthenticationRequest) (*AuthenticationList, error) + + /* + ListFlavors Returns the details for the given STACKIT Git flavors. + + Provides detailed information about possible Git Flavors. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiListFlavorsRequest + */ + ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest + + // ListFlavorsExecute executes the request + // @return ListFlavors + ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavors, error) + + /* + ListInstances List Instances. + + Lists all STACKIT Git instances within a project. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiListInstancesRequest + */ + ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest + + // ListInstancesExecute executes the request + // @return ListInstances + ListInstancesExecute(r ApiListInstancesRequest) (*ListInstances, error) + + /* + ListRunnerRuntimes Method for ListRunnerRuntimes + + A list of runner runtimes that are available to be enabled for the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiListRunnerRuntimesRequest + */ + ListRunnerRuntimes(ctx context.Context, projectId string) ApiListRunnerRuntimesRequest + + // ListRunnerRuntimesExecute executes the request + // @return RunnerRuntimeList + ListRunnerRuntimesExecute(r ApiListRunnerRuntimesRequest) (*RunnerRuntimeList, error) + + /* + PatchAuthentication Patch Authentication. + + Patches the Authentication Provider. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiPatchAuthenticationRequest + */ + PatchAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiPatchAuthenticationRequest + + // PatchAuthenticationExecute executes the request + // @return Authentication + PatchAuthenticationExecute(r ApiPatchAuthenticationRequest) (*Authentication, error) + + /* + PatchInstance Patch Instance. + + Patches the Instance. + + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiPatchInstanceRequest + */ + PatchInstance(ctx context.Context, projectId string, instanceId string) ApiPatchInstanceRequest + + // PatchInstanceExecute executes the request + // @return Instance + PatchInstanceExecute(r ApiPatchInstanceRequest) (*Instance, error) +} + +// DefaultAPIService DefaultAPI service +type DefaultAPIService service + +type ApiCreateAuthenticationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createAuthenticationPayload *CreateAuthenticationPayload +} + +// Authentication Definition configuration data. +func (r ApiCreateAuthenticationRequest) CreateAuthenticationPayload(createAuthenticationPayload CreateAuthenticationPayload) ApiCreateAuthenticationRequest { + r.createAuthenticationPayload = &createAuthenticationPayload + return r +} + +func (r ApiCreateAuthenticationRequest) Execute() (*Authentication, error) { + return r.ApiService.CreateAuthenticationExecute(r) +} + +/* +CreateAuthentication Creates an authentication source + +# Creates an authentication source for the corresponding STACKIT Git instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiCreateAuthenticationRequest +*/ +func (a *DefaultAPIService) CreateAuthentication(ctx context.Context, projectId string, instanceId string) ApiCreateAuthenticationRequest { + return ApiCreateAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Authentication +func (a *DefaultAPIService) CreateAuthenticationExecute(r ApiCreateAuthenticationRequest) (*Authentication, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Authentication + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateAuthentication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, reportError("instanceId must have less than 36 elements") + } + if r.createAuthenticationPayload == nil { + return localVarReturnValue, reportError("createAuthenticationPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createAuthenticationPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v UnauthorizedErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotFoundErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v ConflictErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InternalServerErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + createInstancePayload *CreateInstancePayload +} + +// Instance configuration options. +func (r ApiCreateInstanceRequest) CreateInstancePayload(createInstancePayload CreateInstancePayload) ApiCreateInstanceRequest { + r.createInstancePayload = &createInstancePayload + return r +} + +func (r ApiCreateInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.CreateInstanceExecute(r) +} + +/* +CreateInstance Create an Instance. + +Creates a new STACKIT Git instance as a project resource. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiCreateInstanceRequest +*/ +func (a *DefaultAPIService) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) CreateInstanceExecute(r ApiCreateInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if r.createInstancePayload == nil { + return localVarReturnValue, reportError("createInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiCreateRunnerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + createRunnerPayload *CreateRunnerPayload +} + +// Runner configuration options. +func (r ApiCreateRunnerRequest) CreateRunnerPayload(createRunnerPayload CreateRunnerPayload) ApiCreateRunnerRequest { + r.createRunnerPayload = &createRunnerPayload + return r +} + +func (r ApiCreateRunnerRequest) Execute() (*Runner, error) { + return r.ApiService.CreateRunnerExecute(r) +} + +/* +CreateRunner Create the runner associated to this instance. + +Creates the runner associated to this STACKIT Git instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiCreateRunnerRequest +*/ +func (a *DefaultAPIService) CreateRunner(ctx context.Context, projectId string, instanceId string) ApiCreateRunnerRequest { + return ApiCreateRunnerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Runner +func (a *DefaultAPIService) CreateRunnerExecute(r ApiCreateRunnerRequest) (*Runner, error) { + var ( + localVarHTTPMethod = http.MethodPost + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Runner + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.CreateRunner") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/runner" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, reportError("instanceId must have less than 36 elements") + } + if r.createRunnerPayload == nil { + return localVarReturnValue, reportError("createRunnerPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.createRunnerPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v AlreadyExistsError + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiDeleteAuthenticationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + authenticationId string +} + +func (r ApiDeleteAuthenticationRequest) Execute() error { + return r.ApiService.DeleteAuthenticationExecute(r) +} + +/* +DeleteAuthentication Delete Authentication Source + +Deletes the authentication source associated to this STACKIT Git instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiDeleteAuthenticationRequest +*/ +func (a *DefaultAPIService) DeleteAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiDeleteAuthenticationRequest { + return ApiDeleteAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteAuthenticationExecute(r ApiDeleteAuthenticationRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteAuthentication") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authenticationId"+"}", url.PathEscape(parameterValueToString(r.authenticationId, "authenticationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return reportError("instanceId must have less than 36 elements") + } + if strlen(r.authenticationId) < 36 { + return reportError("authenticationId must have at least 36 elements") + } + if strlen(r.authenticationId) > 36 { + return reportError("authenticationId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v UnauthorizedErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiDeleteInstanceRequest) Execute() error { + return r.ApiService.DeleteInstanceExecute(r) +} + +/* +DeleteInstance Delete Instance. + +Deletes a STACKIT Git instance and destroys all associated data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiDeleteInstanceRequest +*/ +func (a *DefaultAPIService) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteInstance") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return reportError("instanceId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 409 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiDeleteRunnerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiDeleteRunnerRequest) Execute() error { + return r.ApiService.DeleteRunnerExecute(r) +} + +/* +DeleteRunner Delete Runner. + +Deletes the runner associated to this STACKIT Git instance and destroys all associated data. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiDeleteRunnerRequest +*/ +func (a *DefaultAPIService) DeleteRunner(ctx context.Context, projectId string, instanceId string) ApiDeleteRunnerRequest { + return ApiDeleteRunnerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +func (a *DefaultAPIService) DeleteRunnerExecute(r ApiDeleteRunnerRequest) error { + var ( + localVarHTTPMethod = http.MethodDelete + localVarPostBody interface{} + formFiles []formFile + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.DeleteRunner") + if err != nil { + return &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/runner" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return reportError("instanceId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + return newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return newErr + } + return newErr + } + + return nil +} + +type ApiGetAuthenticationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + authenticationId string +} + +func (r ApiGetAuthenticationRequest) Execute() (*Authentication, error) { + return r.ApiService.GetAuthenticationExecute(r) +} + +/* +GetAuthentication Get authentication provider + +# Get authentication provider + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiGetAuthenticationRequest +*/ +func (a *DefaultAPIService) GetAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiGetAuthenticationRequest { + return ApiGetAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } +} + +// Execute executes the request +// +// @return Authentication +func (a *DefaultAPIService) GetAuthenticationExecute(r ApiGetAuthenticationRequest) (*Authentication, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Authentication + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetAuthentication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authenticationId"+"}", url.PathEscape(parameterValueToString(r.authenticationId, "authenticationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, reportError("instanceId must have less than 36 elements") + } + if strlen(r.authenticationId) < 36 { + return localVarReturnValue, reportError("authenticationId must have at least 36 elements") + } + if strlen(r.authenticationId) > 36 { + return localVarReturnValue, reportError("authenticationId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v UnauthorizedErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InternalServerErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiGetInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.GetInstanceExecute(r) +} + +/* +GetInstance Get Instance information. + +Retrieves information about a STACKIT Git instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiGetInstanceRequest +*/ +func (a *DefaultAPIService) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, reportError("instanceId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiGetRunnerRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiGetRunnerRequest) Execute() (*Runner, error) { + return r.ApiService.GetRunnerExecute(r) +} + +/* +GetRunner Get Runner information. + +Retrieves information about a runner in a STACKIT Git instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiGetRunnerRequest +*/ +func (a *DefaultAPIService) GetRunner(ctx context.Context, projectId string, instanceId string) ApiGetRunnerRequest { + return ApiGetRunnerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Runner +func (a *DefaultAPIService) GetRunnerExecute(r ApiGetRunnerRequest) (*Runner, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Runner + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.GetRunner") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/runner" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, reportError("instanceId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListAuthenticationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string +} + +func (r ApiListAuthenticationRequest) Execute() (*AuthenticationList, error) { + return r.ApiService.ListAuthenticationExecute(r) +} + +/* +ListAuthentication List authentication sources + +# Lists all authentication sources belonging to a specific instance + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiListAuthenticationRequest +*/ +func (a *DefaultAPIService) ListAuthentication(ctx context.Context, projectId string, instanceId string) ApiListAuthenticationRequest { + return ApiListAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return AuthenticationList +func (a *DefaultAPIService) ListAuthenticationExecute(r ApiListAuthenticationRequest) (*AuthenticationList, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *AuthenticationList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListAuthentication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, reportError("instanceId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v UnauthorizedErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InternalServerErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListFlavorsRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListFlavorsRequest) Execute() (*ListFlavors, error) { + return r.ApiService.ListFlavorsExecute(r) +} + +/* +ListFlavors Returns the details for the given STACKIT Git flavors. + +Provides detailed information about possible Git Flavors. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiListFlavorsRequest +*/ +func (a *DefaultAPIService) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { + return ApiListFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListFlavors +func (a *DefaultAPIService) ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavors, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListFlavors + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListFlavors") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/flavors" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListInstancesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListInstancesRequest) Execute() (*ListInstances, error) { + return r.ApiService.ListInstancesExecute(r) +} + +/* +ListInstances List Instances. + +Lists all STACKIT Git instances within a project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiListInstancesRequest +*/ +func (a *DefaultAPIService) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return ListInstances +func (a *DefaultAPIService) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstances, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *ListInstances + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListInstances") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiListRunnerRuntimesRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string +} + +func (r ApiListRunnerRuntimesRequest) Execute() (*RunnerRuntimeList, error) { + return r.ApiService.ListRunnerRuntimesExecute(r) +} + +/* +ListRunnerRuntimes Method for ListRunnerRuntimes + +A list of runner runtimes that are available to be enabled for the project. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @return ApiListRunnerRuntimesRequest +*/ +func (a *DefaultAPIService) ListRunnerRuntimes(ctx context.Context, projectId string) ApiListRunnerRuntimesRequest { + return ApiListRunnerRuntimesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// Execute executes the request +// +// @return RunnerRuntimeList +func (a *DefaultAPIService) ListRunnerRuntimesExecute(r ApiListRunnerRuntimesRequest) (*RunnerRuntimeList, error) { + var ( + localVarHTTPMethod = http.MethodGet + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *RunnerRuntimeList + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.ListRunnerRuntimes") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/runner-runtimes" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPatchAuthenticationRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + authenticationId string + patchAuthenticationPayload *PatchAuthenticationPayload +} + +// Authentication Definition configuration data. +func (r ApiPatchAuthenticationRequest) PatchAuthenticationPayload(patchAuthenticationPayload PatchAuthenticationPayload) ApiPatchAuthenticationRequest { + r.patchAuthenticationPayload = &patchAuthenticationPayload + return r +} + +func (r ApiPatchAuthenticationRequest) Execute() (*Authentication, error) { + return r.ApiService.PatchAuthenticationExecute(r) +} + +/* +PatchAuthentication Patch Authentication. + +Patches the Authentication Provider. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @param authenticationId Authentication Source identifier. + @return ApiPatchAuthenticationRequest +*/ +func (a *DefaultAPIService) PatchAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiPatchAuthenticationRequest { + return ApiPatchAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } +} + +// Execute executes the request +// +// @return Authentication +func (a *DefaultAPIService) PatchAuthenticationExecute(r ApiPatchAuthenticationRequest) (*Authentication, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Authentication + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchAuthentication") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}/authentications/{authenticationId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"authenticationId"+"}", url.PathEscape(parameterValueToString(r.authenticationId, "authenticationId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, reportError("instanceId must have less than 36 elements") + } + if strlen(r.authenticationId) < 36 { + return localVarReturnValue, reportError("authenticationId must have at least 36 elements") + } + if strlen(r.authenticationId) > 36 { + return localVarReturnValue, reportError("authenticationId must have less than 36 elements") + } + if r.patchAuthenticationPayload == nil { + return localVarReturnValue, reportError("patchAuthenticationPayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchAuthenticationPayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v BadErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 401 { + var v UnauthorizedErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 404 { + var v NotFoundErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v InternalServerErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} + +type ApiPatchInstanceRequest struct { + ctx context.Context + ApiService DefaultAPI + projectId string + instanceId string + patchInstancePayload *PatchInstancePayload +} + +func (r ApiPatchInstanceRequest) PatchInstancePayload(patchInstancePayload PatchInstancePayload) ApiPatchInstanceRequest { + r.patchInstancePayload = &patchInstancePayload + return r +} + +func (r ApiPatchInstanceRequest) Execute() (*Instance, error) { + return r.ApiService.PatchInstanceExecute(r) +} + +/* +PatchInstance Patch Instance. + +Patches the Instance. + + @param ctx context.Context - for authentication, logging, cancellation, deadlines, tracing, etc. Passed from http.Request or context.Background(). + @param projectId Project identifier. + @param instanceId Instance identifier. + @return ApiPatchInstanceRequest +*/ +func (a *DefaultAPIService) PatchInstance(ctx context.Context, projectId string, instanceId string) ApiPatchInstanceRequest { + return ApiPatchInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// Execute executes the request +// +// @return Instance +func (a *DefaultAPIService) PatchInstanceExecute(r ApiPatchInstanceRequest) (*Instance, error) { + var ( + localVarHTTPMethod = http.MethodPatch + localVarPostBody interface{} + formFiles []formFile + localVarReturnValue *Instance + ) + + localBasePath, err := a.client.cfg.ServerURLWithContext(r.ctx, "DefaultAPIService.PatchInstance") + if err != nil { + return localVarReturnValue, &oapierror.GenericOpenAPIError{ErrorMessage: err.Error()} + } + + localVarPath := localBasePath + "/v1beta/projects/{projectId}/instances/{instanceId}" + localVarPath = strings.Replace(localVarPath, "{"+"projectId"+"}", url.PathEscape(parameterValueToString(r.projectId, "projectId")), -1) + localVarPath = strings.Replace(localVarPath, "{"+"instanceId"+"}", url.PathEscape(parameterValueToString(r.instanceId, "instanceId")), -1) + + localVarHeaderParams := make(map[string]string) + localVarQueryParams := url.Values{} + localVarFormParams := url.Values{} + if strlen(r.projectId) < 36 { + return localVarReturnValue, reportError("projectId must have at least 36 elements") + } + if strlen(r.projectId) > 36 { + return localVarReturnValue, reportError("projectId must have less than 36 elements") + } + if strlen(r.instanceId) < 36 { + return localVarReturnValue, reportError("instanceId must have at least 36 elements") + } + if strlen(r.instanceId) > 36 { + return localVarReturnValue, reportError("instanceId must have less than 36 elements") + } + if r.patchInstancePayload == nil { + return localVarReturnValue, reportError("patchInstancePayload is required and must be specified") + } + + // to determine the Content-Type header + localVarHTTPContentTypes := []string{"application/json", "application/json-patch+json"} + + // set Content-Type header + localVarHTTPContentType := selectHeaderContentType(localVarHTTPContentTypes) + if localVarHTTPContentType != "" { + localVarHeaderParams["Content-Type"] = localVarHTTPContentType + } + + // to determine the Accept header + localVarHTTPHeaderAccepts := []string{"application/json"} + + // set Accept header + localVarHTTPHeaderAccept := selectHeaderAccept(localVarHTTPHeaderAccepts) + if localVarHTTPHeaderAccept != "" { + localVarHeaderParams["Accept"] = localVarHTTPHeaderAccept + } + // body params + localVarPostBody = r.patchInstancePayload + req, err := a.client.prepareRequest(r.ctx, localVarPath, localVarHTTPMethod, localVarPostBody, localVarHeaderParams, localVarQueryParams, localVarFormParams, formFiles) + if err != nil { + return localVarReturnValue, err + } + + contextHTTPRequest, ok := r.ctx.Value(config.ContextHTTPRequest).(**http.Request) + if ok { + *contextHTTPRequest = req + } + + localVarHTTPResponse, err := a.client.callAPI(req) + contextHTTPResponse, ok := r.ctx.Value(config.ContextHTTPResponse).(**http.Response) + if ok { + *contextHTTPResponse = localVarHTTPResponse + } + if err != nil || localVarHTTPResponse == nil { + return localVarReturnValue, err + } + + localVarBody, err := io.ReadAll(localVarHTTPResponse.Body) + localVarHTTPResponse.Body.Close() + localVarHTTPResponse.Body = io.NopCloser(bytes.NewBuffer(localVarBody)) + if err != nil { + return localVarReturnValue, err + } + + if localVarHTTPResponse.StatusCode >= 300 { + newErr := &oapierror.GenericOpenAPIError{ + Body: localVarBody, + ErrorMessage: localVarHTTPResponse.Status, + StatusCode: localVarHTTPResponse.StatusCode, + } + if localVarHTTPResponse.StatusCode == 400 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + return localVarReturnValue, newErr + } + if localVarHTTPResponse.StatusCode == 500 { + var v GenericErrorResponse + err = a.client.decode(&v, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr.ErrorMessage = err.Error() + return localVarReturnValue, newErr + } + newErr.ErrorMessage = oapierror.FormatErrorMessage(localVarHTTPResponse.Status, &v) + newErr.Model = v + return localVarReturnValue, newErr + } + return localVarReturnValue, newErr + } + + err = a.client.decode(&localVarReturnValue, localVarBody, localVarHTTPResponse.Header.Get("Content-Type")) + if err != nil { + newErr := &oapierror.GenericOpenAPIError{ + StatusCode: localVarHTTPResponse.StatusCode, + Body: localVarBody, + ErrorMessage: err.Error(), + } + return localVarReturnValue, newErr + } + + return localVarReturnValue, nil +} diff --git a/services/git/v1betaapi/api_default_mock.go b/services/git/v1betaapi/api_default_mock.go new file mode 100644 index 000000000..8bfd62212 --- /dev/null +++ b/services/git/v1betaapi/api_default_mock.go @@ -0,0 +1,335 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "context" +) + +// assert the implementation matches the interface +var _ DefaultAPI = &DefaultAPIServiceMock{} + +// DefaultAPIServiceMock is meant to be used for testing only as a replacement for DefaultAPIService. +// By default all FooExecute() implementations are a no-op. Behavior of the mock can be customized by populating the callbacks in this struct. +type DefaultAPIServiceMock struct { + // CreateAuthenticationExecuteMock can be populated to implement the behavior of the CreateAuthenticationExecute function of this mock + CreateAuthenticationExecuteMock *func(r ApiCreateAuthenticationRequest) (*Authentication, error) + // CreateInstanceExecuteMock can be populated to implement the behavior of the CreateInstanceExecute function of this mock + CreateInstanceExecuteMock *func(r ApiCreateInstanceRequest) (*Instance, error) + // CreateRunnerExecuteMock can be populated to implement the behavior of the CreateRunnerExecute function of this mock + CreateRunnerExecuteMock *func(r ApiCreateRunnerRequest) (*Runner, error) + // DeleteAuthenticationExecuteMock can be populated to implement the behavior of the DeleteAuthenticationExecute function of this mock + DeleteAuthenticationExecuteMock *func(r ApiDeleteAuthenticationRequest) error + // DeleteInstanceExecuteMock can be populated to implement the behavior of the DeleteInstanceExecute function of this mock + DeleteInstanceExecuteMock *func(r ApiDeleteInstanceRequest) error + // DeleteRunnerExecuteMock can be populated to implement the behavior of the DeleteRunnerExecute function of this mock + DeleteRunnerExecuteMock *func(r ApiDeleteRunnerRequest) error + // GetAuthenticationExecuteMock can be populated to implement the behavior of the GetAuthenticationExecute function of this mock + GetAuthenticationExecuteMock *func(r ApiGetAuthenticationRequest) (*Authentication, error) + // GetInstanceExecuteMock can be populated to implement the behavior of the GetInstanceExecute function of this mock + GetInstanceExecuteMock *func(r ApiGetInstanceRequest) (*Instance, error) + // GetRunnerExecuteMock can be populated to implement the behavior of the GetRunnerExecute function of this mock + GetRunnerExecuteMock *func(r ApiGetRunnerRequest) (*Runner, error) + // ListAuthenticationExecuteMock can be populated to implement the behavior of the ListAuthenticationExecute function of this mock + ListAuthenticationExecuteMock *func(r ApiListAuthenticationRequest) (*AuthenticationList, error) + // ListFlavorsExecuteMock can be populated to implement the behavior of the ListFlavorsExecute function of this mock + ListFlavorsExecuteMock *func(r ApiListFlavorsRequest) (*ListFlavors, error) + // ListInstancesExecuteMock can be populated to implement the behavior of the ListInstancesExecute function of this mock + ListInstancesExecuteMock *func(r ApiListInstancesRequest) (*ListInstances, error) + // ListRunnerRuntimesExecuteMock can be populated to implement the behavior of the ListRunnerRuntimesExecute function of this mock + ListRunnerRuntimesExecuteMock *func(r ApiListRunnerRuntimesRequest) (*RunnerRuntimeList, error) + // PatchAuthenticationExecuteMock can be populated to implement the behavior of the PatchAuthenticationExecute function of this mock + PatchAuthenticationExecuteMock *func(r ApiPatchAuthenticationRequest) (*Authentication, error) + // PatchInstanceExecuteMock can be populated to implement the behavior of the PatchInstanceExecute function of this mock + PatchInstanceExecuteMock *func(r ApiPatchInstanceRequest) (*Instance, error) +} + +func (a DefaultAPIServiceMock) CreateAuthentication(ctx context.Context, projectId string, instanceId string) ApiCreateAuthenticationRequest { + return ApiCreateAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// CreateAuthenticationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateAuthenticationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateAuthenticationExecute(r ApiCreateAuthenticationRequest) (*Authentication, error) { + if a.CreateAuthenticationExecuteMock == nil { + var localVarReturnValue *Authentication + return localVarReturnValue, nil + } + + return (*a.CreateAuthenticationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateInstance(ctx context.Context, projectId string) ApiCreateInstanceRequest { + return ApiCreateInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// CreateInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateInstanceExecute(r ApiCreateInstanceRequest) (*Instance, error) { + if a.CreateInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.CreateInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) CreateRunner(ctx context.Context, projectId string, instanceId string) ApiCreateRunnerRequest { + return ApiCreateRunnerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// CreateRunnerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the CreateRunnerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) CreateRunnerExecute(r ApiCreateRunnerRequest) (*Runner, error) { + if a.CreateRunnerExecuteMock == nil { + var localVarReturnValue *Runner + return localVarReturnValue, nil + } + + return (*a.CreateRunnerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiDeleteAuthenticationRequest { + return ApiDeleteAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } +} + +// DeleteAuthenticationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteAuthenticationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteAuthenticationExecute(r ApiDeleteAuthenticationRequest) error { + if a.DeleteAuthenticationExecuteMock == nil { + return nil + } + + return (*a.DeleteAuthenticationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteInstance(ctx context.Context, projectId string, instanceId string) ApiDeleteInstanceRequest { + return ApiDeleteInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// DeleteInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteInstanceExecute(r ApiDeleteInstanceRequest) error { + if a.DeleteInstanceExecuteMock == nil { + return nil + } + + return (*a.DeleteInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) DeleteRunner(ctx context.Context, projectId string, instanceId string) ApiDeleteRunnerRequest { + return ApiDeleteRunnerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// DeleteRunnerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the DeleteRunnerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) DeleteRunnerExecute(r ApiDeleteRunnerRequest) error { + if a.DeleteRunnerExecuteMock == nil { + return nil + } + + return (*a.DeleteRunnerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiGetAuthenticationRequest { + return ApiGetAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } +} + +// GetAuthenticationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetAuthenticationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetAuthenticationExecute(r ApiGetAuthenticationRequest) (*Authentication, error) { + if a.GetAuthenticationExecuteMock == nil { + var localVarReturnValue *Authentication + return localVarReturnValue, nil + } + + return (*a.GetAuthenticationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetInstance(ctx context.Context, projectId string, instanceId string) ApiGetInstanceRequest { + return ApiGetInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// GetInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetInstanceExecute(r ApiGetInstanceRequest) (*Instance, error) { + if a.GetInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.GetInstanceExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) GetRunner(ctx context.Context, projectId string, instanceId string) ApiGetRunnerRequest { + return ApiGetRunnerRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// GetRunnerExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the GetRunnerExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) GetRunnerExecute(r ApiGetRunnerRequest) (*Runner, error) { + if a.GetRunnerExecuteMock == nil { + var localVarReturnValue *Runner + return localVarReturnValue, nil + } + + return (*a.GetRunnerExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListAuthentication(ctx context.Context, projectId string, instanceId string) ApiListAuthenticationRequest { + return ApiListAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// ListAuthenticationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListAuthenticationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListAuthenticationExecute(r ApiListAuthenticationRequest) (*AuthenticationList, error) { + if a.ListAuthenticationExecuteMock == nil { + var localVarReturnValue *AuthenticationList + return localVarReturnValue, nil + } + + return (*a.ListAuthenticationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListFlavors(ctx context.Context, projectId string) ApiListFlavorsRequest { + return ApiListFlavorsRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListFlavorsExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListFlavorsExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListFlavorsExecute(r ApiListFlavorsRequest) (*ListFlavors, error) { + if a.ListFlavorsExecuteMock == nil { + var localVarReturnValue *ListFlavors + return localVarReturnValue, nil + } + + return (*a.ListFlavorsExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListInstances(ctx context.Context, projectId string) ApiListInstancesRequest { + return ApiListInstancesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListInstancesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListInstancesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListInstancesExecute(r ApiListInstancesRequest) (*ListInstances, error) { + if a.ListInstancesExecuteMock == nil { + var localVarReturnValue *ListInstances + return localVarReturnValue, nil + } + + return (*a.ListInstancesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) ListRunnerRuntimes(ctx context.Context, projectId string) ApiListRunnerRuntimesRequest { + return ApiListRunnerRuntimesRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + } +} + +// ListRunnerRuntimesExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the ListRunnerRuntimesExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) ListRunnerRuntimesExecute(r ApiListRunnerRuntimesRequest) (*RunnerRuntimeList, error) { + if a.ListRunnerRuntimesExecuteMock == nil { + var localVarReturnValue *RunnerRuntimeList + return localVarReturnValue, nil + } + + return (*a.ListRunnerRuntimesExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PatchAuthentication(ctx context.Context, projectId string, instanceId string, authenticationId string) ApiPatchAuthenticationRequest { + return ApiPatchAuthenticationRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + authenticationId: authenticationId, + } +} + +// PatchAuthenticationExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchAuthenticationExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PatchAuthenticationExecute(r ApiPatchAuthenticationRequest) (*Authentication, error) { + if a.PatchAuthenticationExecuteMock == nil { + var localVarReturnValue *Authentication + return localVarReturnValue, nil + } + + return (*a.PatchAuthenticationExecuteMock)(r) +} + +func (a DefaultAPIServiceMock) PatchInstance(ctx context.Context, projectId string, instanceId string) ApiPatchInstanceRequest { + return ApiPatchInstanceRequest{ + ApiService: a, + ctx: ctx, + projectId: projectId, + instanceId: instanceId, + } +} + +// PatchInstanceExecute is a no-op by default and will return only return nil values. Behavior can be controlled by populating the PatchInstanceExecuteMock field in the DefaultAPIServiceMock struct. +func (a DefaultAPIServiceMock) PatchInstanceExecute(r ApiPatchInstanceRequest) (*Instance, error) { + if a.PatchInstanceExecuteMock == nil { + var localVarReturnValue *Instance + return localVarReturnValue, nil + } + + return (*a.PatchInstanceExecuteMock)(r) +} diff --git a/services/git/v1betaapi/client.go b/services/git/v1betaapi/client.go new file mode 100644 index 000000000..842e742a6 --- /dev/null +++ b/services/git/v1betaapi/client.go @@ -0,0 +1,659 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "bytes" + "context" + "encoding/json" + "encoding/xml" + "errors" + "fmt" + "io" + "log" + "mime/multipart" + "net/http" + "net/http/httputil" + "net/url" + "os" + "path/filepath" + "reflect" + "regexp" + "strconv" + "strings" + "time" + "unicode/utf8" + + "github.com/stackitcloud/stackit-sdk-go/core/auth" + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +var ( + JsonCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?json)`) + XmlCheck = regexp.MustCompile(`(?i:(?:application|text)/(?:[^;]+\+)?xml)`) + queryParamSplit = regexp.MustCompile(`(^|&)([^&]+)`) + queryDescape = strings.NewReplacer("%5B", "[", "%5D", "]") +) + +// APIClient manages communication with the STACKIT Git API API v1beta.0.4 +// In most cases there should be only one, shared, APIClient. +type APIClient struct { + cfg *config.Configuration + common service // Reuse a single struct instead of allocating one for each service on the heap. + + // API Services + + DefaultAPI DefaultAPI +} + +type service struct { + client *APIClient +} + +// NewAPIClient creates a new API client. Requires a userAgent string describing your application. +// optionally a custom http.Client to allow for advanced features such as caching. +func NewAPIClient(opts ...config.ConfigurationOption) (*APIClient, error) { + cfg := NewConfiguration() + + for _, option := range opts { + err := option(cfg) + if err != nil { + return nil, fmt.Errorf("configuring the client: %w", err) + } + } + + err := config.ConfigureRegion(cfg) + if err != nil { + return nil, fmt.Errorf("configuring region: %w", err) + } + + if cfg.HTTPClient == nil { + cfg.HTTPClient = &http.Client{} + } + + authRoundTripper, err := auth.SetupAuth(cfg) + if err != nil { + return nil, fmt.Errorf("setting up authentication: %w", err) + } + + roundTripper := authRoundTripper + if cfg.Middleware != nil { + roundTripper = config.ChainMiddleware(roundTripper, cfg.Middleware...) + } + + cfg.HTTPClient.Transport = roundTripper + + c := &APIClient{} + c.cfg = cfg + c.common.client = c + + // API Services + c.DefaultAPI = (*DefaultAPIService)(&c.common) + + return c, nil +} + +func atoi(in string) (int, error) { + return strconv.Atoi(in) +} + +// selectHeaderContentType select a content type from the available list. +func selectHeaderContentType(contentTypes []string) string { + if len(contentTypes) == 0 { + return "" + } + if contains(contentTypes, "application/json") { + return "application/json" + } + return contentTypes[0] // use the first content type specified in 'consumes' +} + +// selectHeaderAccept join all accept types and return +func selectHeaderAccept(accepts []string) string { + if len(accepts) == 0 { + return "" + } + + if contains(accepts, "application/json") { + return "application/json" + } + + return strings.Join(accepts, ",") +} + +// contains is a case insensitive match, finding needle in a haystack +func contains(haystack []string, needle string) bool { + for _, a := range haystack { + if strings.EqualFold(a, needle) { + return true + } + } + return false +} + +// Verify optional parameters are of the correct type. +func typeCheckParameter(obj interface{}, expected string, name string) error { + // Make sure there is an object. + if obj == nil { + return nil + } + + // Check the type is as expected. + if reflect.TypeOf(obj).String() != expected { + return fmt.Errorf("expected %s to be of type %s but received %s", name, expected, reflect.TypeOf(obj).String()) + } + return nil +} + +func parameterValueToString(obj interface{}, key string) string { + if reflect.TypeOf(obj).Kind() != reflect.Ptr { + if actualObj, ok := obj.(interface{ GetActualInstanceValue() interface{} }); ok { + return fmt.Sprintf("%v", actualObj.GetActualInstanceValue()) + } + + return fmt.Sprintf("%v", obj) + } + var param, ok = obj.(MappedNullable) + if !ok { + return "" + } + dataMap, err := param.ToMap() + if err != nil { + return "" + } + return fmt.Sprintf("%v", dataMap[key]) +} + +// parameterAddToHeaderOrQuery adds the provided object to the request header or url query +// supporting deep object syntax +func parameterAddToHeaderOrQuery(headerOrQueryParams interface{}, keyPrefix string, obj interface{}, style string, collectionType string) { + var v = reflect.ValueOf(obj) + var value = "" + if v == reflect.ValueOf(nil) { + value = "null" + } else { + switch v.Kind() { + case reflect.Invalid: + value = "invalid" + + case reflect.Struct: + if t, ok := obj.(MappedNullable); ok { + dataMap, err := t.ToMap() + if err != nil { + return + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, dataMap, style, collectionType) + return + } + if t, ok := obj.(time.Time); ok { + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, t.Format(time.RFC3339Nano), style, collectionType) + return + } + value = v.Type().String() + " value" + case reflect.Slice: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + var lenIndValue = indValue.Len() + for i := 0; i < lenIndValue; i++ { + var arrayValue = indValue.Index(i) + var keyPrefixForCollectionType = keyPrefix + if style == "deepObject" { + keyPrefixForCollectionType = keyPrefix + "[" + strconv.Itoa(i) + "]" + } + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefixForCollectionType, arrayValue.Interface(), style, collectionType) + } + return + + case reflect.Map: + var indValue = reflect.ValueOf(obj) + if indValue == reflect.ValueOf(nil) { + return + } + iter := indValue.MapRange() + for iter.Next() { + k, v := iter.Key(), iter.Value() + parameterAddToHeaderOrQuery(headerOrQueryParams, fmt.Sprintf("%s[%s]", keyPrefix, k.String()), v.Interface(), style, collectionType) + } + return + + case reflect.Interface: + fallthrough + case reflect.Ptr: + parameterAddToHeaderOrQuery(headerOrQueryParams, keyPrefix, v.Elem().Interface(), style, collectionType) + return + + case reflect.Int, reflect.Int8, reflect.Int16, + reflect.Int32, reflect.Int64: + value = strconv.FormatInt(v.Int(), 10) + case reflect.Uint, reflect.Uint8, reflect.Uint16, + reflect.Uint32, reflect.Uint64, reflect.Uintptr: + value = strconv.FormatUint(v.Uint(), 10) + case reflect.Float32, reflect.Float64: + value = strconv.FormatFloat(v.Float(), 'g', -1, 32) + case reflect.Bool: + value = strconv.FormatBool(v.Bool()) + case reflect.String: + value = v.String() + default: + value = v.Type().String() + " value" + } + } + + switch valuesMap := headerOrQueryParams.(type) { + case url.Values: + if collectionType == "csv" && valuesMap.Get(keyPrefix) != "" { + valuesMap.Set(keyPrefix, valuesMap.Get(keyPrefix)+","+value) + } else { + valuesMap.Add(keyPrefix, value) + } + break + case map[string]string: + valuesMap[keyPrefix] = value + break + } +} + +// helper for converting interface{} parameters to json strings +func parameterToJson(obj interface{}) (string, error) { + jsonBuf, err := json.Marshal(obj) + if err != nil { + return "", err + } + return string(jsonBuf), err +} + +// callAPI do the request. +func (c *APIClient) callAPI(request *http.Request) (*http.Response, error) { + if c.cfg.Debug { + dump, err := httputil.DumpRequestOut(request, true) + if err != nil { + return nil, err + } + log.Printf("\n%s\n", string(dump)) + } + + resp, err := c.cfg.HTTPClient.Do(request) + if err != nil { + return resp, err + } + + if c.cfg.Debug { + dump, err := httputil.DumpResponse(resp, true) + if err != nil { + return resp, err + } + log.Printf("\n%s\n", string(dump)) + } + return resp, err +} + +// Allow modification of underlying config for alternate implementations and testing +// Caution: modifying the configuration while live can cause data races and potentially unwanted behavior +func (c *APIClient) GetConfig() *config.Configuration { + return c.cfg +} + +type formFile struct { + fileBytes []byte + fileName string + formFileName string +} + +// prepareRequest build the request +func (c *APIClient) prepareRequest( + ctx context.Context, + path string, method string, + postBody interface{}, + headerParams map[string]string, + queryParams url.Values, + formParams url.Values, + formFiles []formFile) (localVarRequest *http.Request, err error) { + + var body *bytes.Buffer + + // Detect postBody type and post. + if postBody != nil { + contentType := headerParams["Content-Type"] + if contentType == "" { + contentType = detectContentType(postBody) + headerParams["Content-Type"] = contentType + } + + body, err = setBody(postBody, contentType) + if err != nil { + return nil, err + } + } + + // add form parameters and file if available. + if strings.HasPrefix(headerParams["Content-Type"], "multipart/form-data") && len(formParams) > 0 || (len(formFiles) > 0) { + if body != nil { + return nil, errors.New("Cannot specify postBody and multipart form at the same time.") + } + body = &bytes.Buffer{} + w := multipart.NewWriter(body) + + for k, v := range formParams { + for _, iv := range v { + if strings.HasPrefix(k, "@") { // file + err = addFile(w, k[1:], iv) + if err != nil { + return nil, err + } + } else { // form value + w.WriteField(k, iv) + } + } + } + for _, formFile := range formFiles { + if len(formFile.fileBytes) > 0 && formFile.fileName != "" { + w.Boundary() + part, err := w.CreateFormFile(formFile.formFileName, filepath.Base(formFile.fileName)) + if err != nil { + return nil, err + } + _, err = part.Write(formFile.fileBytes) + if err != nil { + return nil, err + } + } + } + + // Set the Boundary in the Content-Type + headerParams["Content-Type"] = w.FormDataContentType() + + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + w.Close() + } + + if strings.HasPrefix(headerParams["Content-Type"], "application/x-www-form-urlencoded") && len(formParams) > 0 { + if body != nil { + return nil, errors.New("Cannot specify postBody and x-www-form-urlencoded form at the same time.") + } + body = &bytes.Buffer{} + body.WriteString(formParams.Encode()) + // Set Content-Length + headerParams["Content-Length"] = fmt.Sprintf("%d", body.Len()) + } + + // Setup path and query parameters + url, err := url.Parse(path) + if err != nil { + return nil, err + } + + // Override request host, if applicable + if c.cfg.Host != "" { + url.Host = c.cfg.Host + } + + // Override request scheme, if applicable + if c.cfg.Scheme != "" { + url.Scheme = c.cfg.Scheme + } + + // Adding Query Param + query := url.Query() + for k, v := range queryParams { + for _, iv := range v { + query.Add(k, iv) + } + } + + // Encode the parameters. + url.RawQuery = queryParamSplit.ReplaceAllStringFunc(query.Encode(), func(s string) string { + pieces := strings.Split(s, "=") + pieces[0] = queryDescape.Replace(pieces[0]) + return strings.Join(pieces, "=") + }) + + // Generate a new request + if body != nil { + localVarRequest, err = http.NewRequest(method, url.String(), body) + } else { + localVarRequest, err = http.NewRequest(method, url.String(), nil) + } + if err != nil { + return nil, err + } + + // add header parameters, if any + if len(headerParams) > 0 { + headers := http.Header{} + for h, v := range headerParams { + headers[h] = []string{v} + } + localVarRequest.Header = headers + } + + // Add the user agent to the request. + localVarRequest.Header.Add("User-Agent", c.cfg.UserAgent) + + if ctx != nil { + // add context to the request + localVarRequest = localVarRequest.WithContext(ctx) + + // Walk through any authentication. + + } + + for header, value := range c.cfg.DefaultHeader { + localVarRequest.Header.Add(header, value) + } + return localVarRequest, nil +} + +func (c *APIClient) decode(v interface{}, b []byte, contentType string) (err error) { + if len(b) == 0 { + return nil + } + if s, ok := v.(*string); ok { + *s = string(b) + return nil + } + if f, ok := v.(*os.File); ok { + f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = f.Write(b) + if err != nil { + return + } + _, err = f.Seek(0, io.SeekStart) + return + } + if f, ok := v.(**os.File); ok { + *f, err = os.CreateTemp("", "HttpClientFile") + if err != nil { + return + } + _, err = (*f).Write(b) + if err != nil { + return + } + _, err = (*f).Seek(0, io.SeekStart) + return + } + if XmlCheck.MatchString(contentType) { + if err = xml.Unmarshal(b, v); err != nil { + return err + } + return nil + } + if JsonCheck.MatchString(contentType) { + if actualObj, ok := v.(interface{ GetActualInstance() interface{} }); ok { // oneOf, anyOf schemas + if unmarshalObj, ok := actualObj.(interface{ UnmarshalJSON([]byte) error }); ok { // make sure it has UnmarshalJSON defined + if err = unmarshalObj.UnmarshalJSON(b); err != nil { + return err + } + } else { + return errors.New("Unknown type with GetActualInstance but no unmarshalObj.UnmarshalJSON defined") + } + } else if err = json.Unmarshal(b, v); err != nil { // simple model + return err + } + return nil + } + return errors.New("undefined response type") +} + +// Add a file to the multipart request +func addFile(w *multipart.Writer, fieldName, path string) error { + file, err := os.Open(filepath.Clean(path)) + if err != nil { + return err + } + defer file.Close() + + part, err := w.CreateFormFile(fieldName, filepath.Base(path)) + if err != nil { + return err + } + _, err = io.Copy(part, file) + + return err +} + +// Set request body from an interface{} +func setBody(body interface{}, contentType string) (bodyBuf *bytes.Buffer, err error) { + if bodyBuf == nil { + bodyBuf = &bytes.Buffer{} + } + + if reader, ok := body.(io.Reader); ok { + _, err = bodyBuf.ReadFrom(reader) + } else if fp, ok := body.(*os.File); ok { + _, err = bodyBuf.ReadFrom(fp) + } else if b, ok := body.([]byte); ok { + _, err = bodyBuf.Write(b) + } else if s, ok := body.(string); ok { + _, err = bodyBuf.WriteString(s) + } else if s, ok := body.(*string); ok { + _, err = bodyBuf.WriteString(*s) + } else if JsonCheck.MatchString(contentType) { + err = json.NewEncoder(bodyBuf).Encode(body) + } else if XmlCheck.MatchString(contentType) { + var bs []byte + bs, err = xml.Marshal(body) + if err == nil { + bodyBuf.Write(bs) + } + } + + if err != nil { + return nil, err + } + + if bodyBuf.Len() == 0 { + err = fmt.Errorf("invalid body type %s\n", contentType) + return nil, err + } + return bodyBuf, nil +} + +// detectContentType method is used to figure out `Request.Body` content type for request header +func detectContentType(body interface{}) string { + contentType := "text/plain; charset=utf-8" + kind := reflect.TypeOf(body).Kind() + + switch kind { + case reflect.Struct, reflect.Map, reflect.Ptr: + contentType = "application/json; charset=utf-8" + case reflect.String: + contentType = "text/plain; charset=utf-8" + default: + if b, ok := body.([]byte); ok { + contentType = http.DetectContentType(b) + } else if kind == reflect.Slice { + contentType = "application/json; charset=utf-8" + } + } + + return contentType +} + +// Ripped from https://github.com/gregjones/httpcache/blob/master/httpcache.go +type cacheControl map[string]string + +func parseCacheControl(headers http.Header) cacheControl { + cc := cacheControl{} + ccHeader := headers.Get("Cache-Control") + for _, part := range strings.Split(ccHeader, ",") { + part = strings.Trim(part, " ") + if part == "" { + continue + } + if strings.ContainsRune(part, '=') { + keyval := strings.Split(part, "=") + cc[strings.Trim(keyval[0], " ")] = strings.Trim(keyval[1], ",") + } else { + cc[part] = "" + } + } + return cc +} + +// CacheExpires helper function to determine remaining time before repeating a request. +func CacheExpires(r *http.Response) time.Time { + // Figure out when the cache expires. + var expires time.Time + now, err := time.Parse(time.RFC1123, r.Header.Get("date")) + if err != nil { + return time.Now() + } + respCacheControl := parseCacheControl(r.Header) + + if maxAge, ok := respCacheControl["max-age"]; ok { + lifetime, err := time.ParseDuration(maxAge + "s") + if err != nil { + expires = now + } else { + expires = now.Add(lifetime) + } + } else { + expiresHeader := r.Header.Get("Expires") + if expiresHeader != "" { + expires, err = time.Parse(time.RFC1123, expiresHeader) + if err != nil { + expires = now + } + } + } + return expires +} + +func strlen(s string) int { + return utf8.RuneCountInString(s) +} + +// format error message using title and detail when model implements rfc7807 +func formatErrorMessage(status string, v interface{}) string { + str := "" + metaValue := reflect.ValueOf(v).Elem() + + if metaValue.Kind() == reflect.Struct { + field := metaValue.FieldByName("Title") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s", field.Interface()) + } + + field = metaValue.FieldByName("Detail") + if field != (reflect.Value{}) { + str = fmt.Sprintf("%s (%s)", str, field.Interface()) + } + } + + return strings.TrimSpace(fmt.Sprintf("%s %s", status, str)) +} diff --git a/services/git/v1betaapi/configuration.go b/services/git/v1betaapi/configuration.go new file mode 100644 index 000000000..c03c28784 --- /dev/null +++ b/services/git/v1betaapi/configuration.go @@ -0,0 +1,38 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. +package v1betaapi + +import ( + "github.com/stackitcloud/stackit-sdk-go/core/config" +) + +// NewConfiguration returns a new Configuration object +func NewConfiguration() *config.Configuration { + cfg := &config.Configuration{ + DefaultHeader: make(map[string]string), + UserAgent: "stackit-sdk-go/git", + Debug: false, + Servers: config.ServerConfigurations{ + { + URL: "https://git.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/git/v1betaapi/model_already_exists_error.go b/services/git/v1betaapi/model_already_exists_error.go new file mode 100644 index 000000000..3467a3cb7 --- /dev/null +++ b/services/git/v1betaapi/model_already_exists_error.go @@ -0,0 +1,157 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AlreadyExistsError type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AlreadyExistsError{} + +// AlreadyExistsError Error response when a resource already exists. +type AlreadyExistsError struct { + Message string `json:"message"` +} + +type _AlreadyExistsError AlreadyExistsError + +// NewAlreadyExistsError instantiates a new AlreadyExistsError object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAlreadyExistsError(message string) *AlreadyExistsError { + this := AlreadyExistsError{} + this.Message = message + return &this +} + +// NewAlreadyExistsErrorWithDefaults instantiates a new AlreadyExistsError object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAlreadyExistsErrorWithDefaults() *AlreadyExistsError { + this := AlreadyExistsError{} + return &this +} + +// GetMessage returns the Message field value +func (o *AlreadyExistsError) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *AlreadyExistsError) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *AlreadyExistsError) SetMessage(v string) { + o.Message = v +} + +func (o AlreadyExistsError) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AlreadyExistsError) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["message"] = o.Message + return toSerialize, nil +} + +func (o *AlreadyExistsError) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAlreadyExistsError := _AlreadyExistsError{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAlreadyExistsError) + + if err != nil { + return err + } + + *o = AlreadyExistsError(varAlreadyExistsError) + + return err +} + +type NullableAlreadyExistsError struct { + value *AlreadyExistsError + isSet bool +} + +func (v NullableAlreadyExistsError) Get() *AlreadyExistsError { + return v.value +} + +func (v *NullableAlreadyExistsError) Set(val *AlreadyExistsError) { + v.value = val + v.isSet = true +} + +func (v NullableAlreadyExistsError) IsSet() bool { + return v.isSet +} + +func (v *NullableAlreadyExistsError) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAlreadyExistsError(val *AlreadyExistsError) *NullableAlreadyExistsError { + return &NullableAlreadyExistsError{value: val, isSet: true} +} + +func (v NullableAlreadyExistsError) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAlreadyExistsError) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_authentication.go b/services/git/v1betaapi/model_authentication.go new file mode 100644 index 000000000..02e9f7113 --- /dev/null +++ b/services/git/v1betaapi/model_authentication.go @@ -0,0 +1,391 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Authentication type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Authentication{} + +// Authentication Describes an authentication definition associated to a STACKIT Git instance. The provider type will be an openidConnect type. +type Authentication struct { + // The well-known configuration url to use for this authentication definition. + AutoDiscoverUrl string `json:"auto_discover_url" validate:"regexp=^https:\\/\\/[a-zA-Z0-9\\\\-\\\\.]+(\\\\.[a-zA-Z]{2,})+(\\/.*)?$"` + // The IDP client id to use. + ClientId string `json:"client_id"` + // The date and time the creation of the authentication definition was triggered. + CreatedAt time.Time `json:"created_at"` + // The url of the icon to use for this authentication definition. + IconUrl string `json:"icon_url" validate:"regexp=^https:\\/\\/[a-zA-Z0-9\\\\-\\\\.]+(\\\\.[a-zA-Z]{2,})+(\\/.*)?$"` + // An auto generated unique uuid which identifies the authentication definition in STACKIT Git instances. + Id string `json:"id"` + // The name to identify an authentication definition associated with a STACKIT Git instance. + Name string `json:"name"` + // The Oauth2 provider to use. + Provider string `json:"provider"` + // Scopes defines the OIDC scopes to request. + Scopes string `json:"scopes"` + // The current status of the authentication definition. + Status string `json:"status"` +} + +type _Authentication Authentication + +// NewAuthentication instantiates a new Authentication object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthentication(autoDiscoverUrl string, clientId string, createdAt time.Time, iconUrl string, id string, name string, provider string, scopes string, status string) *Authentication { + this := Authentication{} + this.AutoDiscoverUrl = autoDiscoverUrl + this.ClientId = clientId + this.CreatedAt = createdAt + this.IconUrl = iconUrl + this.Id = id + this.Name = name + this.Provider = provider + this.Scopes = scopes + this.Status = status + return &this +} + +// NewAuthenticationWithDefaults instantiates a new Authentication object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticationWithDefaults() *Authentication { + this := Authentication{} + return &this +} + +// GetAutoDiscoverUrl returns the AutoDiscoverUrl field value +func (o *Authentication) GetAutoDiscoverUrl() string { + if o == nil { + var ret string + return ret + } + + return o.AutoDiscoverUrl +} + +// GetAutoDiscoverUrlOk returns a tuple with the AutoDiscoverUrl field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetAutoDiscoverUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AutoDiscoverUrl, true +} + +// SetAutoDiscoverUrl sets field value +func (o *Authentication) SetAutoDiscoverUrl(v string) { + o.AutoDiscoverUrl = v +} + +// GetClientId returns the ClientId field value +func (o *Authentication) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *Authentication) SetClientId(v string) { + o.ClientId = v +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Authentication) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Authentication) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetIconUrl returns the IconUrl field value +func (o *Authentication) GetIconUrl() string { + if o == nil { + var ret string + return ret + } + + return o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetIconUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.IconUrl, true +} + +// SetIconUrl sets field value +func (o *Authentication) SetIconUrl(v string) { + o.IconUrl = v +} + +// GetId returns the Id field value +func (o *Authentication) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Authentication) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Authentication) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Authentication) SetName(v string) { + o.Name = v +} + +// GetProvider returns the Provider field value +func (o *Authentication) GetProvider() string { + if o == nil { + var ret string + return ret + } + + return o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetProviderOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Provider, true +} + +// SetProvider sets field value +func (o *Authentication) SetProvider(v string) { + o.Provider = v +} + +// GetScopes returns the Scopes field value +func (o *Authentication) GetScopes() string { + if o == nil { + var ret string + return ret + } + + return o.Scopes +} + +// GetScopesOk returns a tuple with the Scopes field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetScopesOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Scopes, true +} + +// SetScopes sets field value +func (o *Authentication) SetScopes(v string) { + o.Scopes = v +} + +// GetStatus returns the Status field value +func (o *Authentication) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Authentication) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Authentication) SetStatus(v string) { + o.Status = v +} + +func (o Authentication) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Authentication) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["auto_discover_url"] = o.AutoDiscoverUrl + toSerialize["client_id"] = o.ClientId + toSerialize["created_at"] = o.CreatedAt + toSerialize["icon_url"] = o.IconUrl + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["provider"] = o.Provider + toSerialize["scopes"] = o.Scopes + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *Authentication) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "auto_discover_url", + "client_id", + "created_at", + "icon_url", + "id", + "name", + "provider", + "scopes", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthentication := _Authentication{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAuthentication) + + if err != nil { + return err + } + + *o = Authentication(varAuthentication) + + return err +} + +type NullableAuthentication struct { + value *Authentication + isSet bool +} + +func (v NullableAuthentication) Get() *Authentication { + return v.value +} + +func (v *NullableAuthentication) Set(val *Authentication) { + v.value = val + v.isSet = true +} + +func (v NullableAuthentication) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthentication) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthentication(val *Authentication) *NullableAuthentication { + return &NullableAuthentication{value: val, isSet: true} +} + +func (v NullableAuthentication) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthentication) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_authentication_list.go b/services/git/v1betaapi/model_authentication_list.go new file mode 100644 index 000000000..7ff5793e6 --- /dev/null +++ b/services/git/v1betaapi/model_authentication_list.go @@ -0,0 +1,157 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the AuthenticationList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &AuthenticationList{} + +// AuthenticationList A list of authentications belonging to an Instance. +type AuthenticationList struct { + Authentication []Authentication `json:"authentication"` +} + +type _AuthenticationList AuthenticationList + +// NewAuthenticationList instantiates a new AuthenticationList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewAuthenticationList(authentication []Authentication) *AuthenticationList { + this := AuthenticationList{} + this.Authentication = authentication + return &this +} + +// NewAuthenticationListWithDefaults instantiates a new AuthenticationList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewAuthenticationListWithDefaults() *AuthenticationList { + this := AuthenticationList{} + return &this +} + +// GetAuthentication returns the Authentication field value +func (o *AuthenticationList) GetAuthentication() []Authentication { + if o == nil { + var ret []Authentication + return ret + } + + return o.Authentication +} + +// GetAuthenticationOk returns a tuple with the Authentication field value +// and a boolean to check if the value has been set. +func (o *AuthenticationList) GetAuthenticationOk() ([]Authentication, bool) { + if o == nil { + return nil, false + } + return o.Authentication, true +} + +// SetAuthentication sets field value +func (o *AuthenticationList) SetAuthentication(v []Authentication) { + o.Authentication = v +} + +func (o AuthenticationList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o AuthenticationList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["authentication"] = o.Authentication + return toSerialize, nil +} + +func (o *AuthenticationList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "authentication", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varAuthenticationList := _AuthenticationList{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varAuthenticationList) + + if err != nil { + return err + } + + *o = AuthenticationList(varAuthenticationList) + + return err +} + +type NullableAuthenticationList struct { + value *AuthenticationList + isSet bool +} + +func (v NullableAuthenticationList) Get() *AuthenticationList { + return v.value +} + +func (v *NullableAuthenticationList) Set(val *AuthenticationList) { + v.value = val + v.isSet = true +} + +func (v NullableAuthenticationList) IsSet() bool { + return v.isSet +} + +func (v *NullableAuthenticationList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableAuthenticationList(val *AuthenticationList) *NullableAuthenticationList { + return &NullableAuthenticationList{value: val, isSet: true} +} + +func (v NullableAuthenticationList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableAuthenticationList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_bad_error_response.go b/services/git/v1betaapi/model_bad_error_response.go new file mode 100644 index 000000000..922cee064 --- /dev/null +++ b/services/git/v1betaapi/model_bad_error_response.go @@ -0,0 +1,161 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the BadErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &BadErrorResponse{} + +// BadErrorResponse 400 Error Response. +type BadErrorResponse struct { + Details *string `json:"details,omitempty"` + Error *string `json:"error,omitempty"` +} + +// NewBadErrorResponse instantiates a new BadErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewBadErrorResponse() *BadErrorResponse { + this := BadErrorResponse{} + return &this +} + +// NewBadErrorResponseWithDefaults instantiates a new BadErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewBadErrorResponseWithDefaults() *BadErrorResponse { + this := BadErrorResponse{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *BadErrorResponse) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BadErrorResponse) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *BadErrorResponse) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *BadErrorResponse) SetDetails(v string) { + o.Details = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *BadErrorResponse) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *BadErrorResponse) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *BadErrorResponse) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *BadErrorResponse) SetError(v string) { + o.Error = &v +} + +func (o BadErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o BadErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + return toSerialize, nil +} + +type NullableBadErrorResponse struct { + value *BadErrorResponse + isSet bool +} + +func (v NullableBadErrorResponse) Get() *BadErrorResponse { + return v.value +} + +func (v *NullableBadErrorResponse) Set(val *BadErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableBadErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableBadErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBadErrorResponse(val *BadErrorResponse) *NullableBadErrorResponse { + return &NullableBadErrorResponse{value: val, isSet: true} +} + +func (v NullableBadErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBadErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_conflict_error_response.go b/services/git/v1betaapi/model_conflict_error_response.go new file mode 100644 index 000000000..0c325b5c5 --- /dev/null +++ b/services/git/v1betaapi/model_conflict_error_response.go @@ -0,0 +1,161 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the ConflictErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ConflictErrorResponse{} + +// ConflictErrorResponse 409 Error Response. +type ConflictErrorResponse struct { + Details *string `json:"details,omitempty"` + Error *string `json:"error,omitempty"` +} + +// NewConflictErrorResponse instantiates a new ConflictErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewConflictErrorResponse() *ConflictErrorResponse { + this := ConflictErrorResponse{} + return &this +} + +// NewConflictErrorResponseWithDefaults instantiates a new ConflictErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewConflictErrorResponseWithDefaults() *ConflictErrorResponse { + this := ConflictErrorResponse{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *ConflictErrorResponse) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConflictErrorResponse) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *ConflictErrorResponse) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *ConflictErrorResponse) SetDetails(v string) { + o.Details = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *ConflictErrorResponse) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *ConflictErrorResponse) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *ConflictErrorResponse) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *ConflictErrorResponse) SetError(v string) { + o.Error = &v +} + +func (o ConflictErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ConflictErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + return toSerialize, nil +} + +type NullableConflictErrorResponse struct { + value *ConflictErrorResponse + isSet bool +} + +func (v NullableConflictErrorResponse) Get() *ConflictErrorResponse { + return v.value +} + +func (v *NullableConflictErrorResponse) Set(val *ConflictErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableConflictErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableConflictErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableConflictErrorResponse(val *ConflictErrorResponse) *NullableConflictErrorResponse { + return &NullableConflictErrorResponse{value: val, isSet: true} +} + +func (v NullableConflictErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableConflictErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_create_authentication_payload.go b/services/git/v1betaapi/model_create_authentication_payload.go new file mode 100644 index 000000000..efce7047c --- /dev/null +++ b/services/git/v1betaapi/model_create_authentication_payload.go @@ -0,0 +1,364 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateAuthenticationPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateAuthenticationPayload{} + +// CreateAuthenticationPayload Properties to patch on an authentication. All fields are optional. +type CreateAuthenticationPayload struct { + // The well-known configuration url to use for this authentication definition. + AutoDiscoverUrl string `json:"auto_discover_url" validate:"regexp=^https:\\/\\/[a-zA-Z0-9\\\\-\\\\.]+(\\\\.[a-zA-Z]{2,})+(\\/.*)?$"` + // The IDP client id to use. + ClientId string `json:"client_id"` + // The IDP client secret to use. + ClientSecret string `json:"client_secret"` + // The url of the icon to use for this authentication definition. + IconUrl *string `json:"icon_url,omitempty" validate:"regexp=^https:\\/\\/[a-zA-Z0-9\\\\-\\\\.]+(\\\\.[a-zA-Z]{2,})+(\\/.*)?$"` + // The name to identify an authentication definition associated with a STACKIT Git instance. + Name string `json:"name"` + // The Oauth2 provider to use. + Provider *string `json:"provider,omitempty"` + // Scopes defines the OIDC scopes to request. + Scopes *string `json:"scopes,omitempty"` +} + +type _CreateAuthenticationPayload CreateAuthenticationPayload + +// NewCreateAuthenticationPayload instantiates a new CreateAuthenticationPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateAuthenticationPayload(autoDiscoverUrl string, clientId string, clientSecret string, name string) *CreateAuthenticationPayload { + this := CreateAuthenticationPayload{} + this.AutoDiscoverUrl = autoDiscoverUrl + this.ClientId = clientId + this.ClientSecret = clientSecret + this.Name = name + var provider string = "openidConnect" + this.Provider = &provider + var scopes string = "openid profile email" + this.Scopes = &scopes + return &this +} + +// NewCreateAuthenticationPayloadWithDefaults instantiates a new CreateAuthenticationPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateAuthenticationPayloadWithDefaults() *CreateAuthenticationPayload { + this := CreateAuthenticationPayload{} + var provider string = "openidConnect" + this.Provider = &provider + var scopes string = "openid profile email" + this.Scopes = &scopes + return &this +} + +// GetAutoDiscoverUrl returns the AutoDiscoverUrl field value +func (o *CreateAuthenticationPayload) GetAutoDiscoverUrl() string { + if o == nil { + var ret string + return ret + } + + return o.AutoDiscoverUrl +} + +// GetAutoDiscoverUrlOk returns a tuple with the AutoDiscoverUrl field value +// and a boolean to check if the value has been set. +func (o *CreateAuthenticationPayload) GetAutoDiscoverUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.AutoDiscoverUrl, true +} + +// SetAutoDiscoverUrl sets field value +func (o *CreateAuthenticationPayload) SetAutoDiscoverUrl(v string) { + o.AutoDiscoverUrl = v +} + +// GetClientId returns the ClientId field value +func (o *CreateAuthenticationPayload) GetClientId() string { + if o == nil { + var ret string + return ret + } + + return o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value +// and a boolean to check if the value has been set. +func (o *CreateAuthenticationPayload) GetClientIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientId, true +} + +// SetClientId sets field value +func (o *CreateAuthenticationPayload) SetClientId(v string) { + o.ClientId = v +} + +// GetClientSecret returns the ClientSecret field value +func (o *CreateAuthenticationPayload) GetClientSecret() string { + if o == nil { + var ret string + return ret + } + + return o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value +// and a boolean to check if the value has been set. +func (o *CreateAuthenticationPayload) GetClientSecretOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ClientSecret, true +} + +// SetClientSecret sets field value +func (o *CreateAuthenticationPayload) SetClientSecret(v string) { + o.ClientSecret = v +} + +// GetIconUrl returns the IconUrl field value if set, zero value otherwise. +func (o *CreateAuthenticationPayload) GetIconUrl() string { + if o == nil || IsNil(o.IconUrl) { + var ret string + return ret + } + return *o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAuthenticationPayload) GetIconUrlOk() (*string, bool) { + if o == nil || IsNil(o.IconUrl) { + return nil, false + } + return o.IconUrl, true +} + +// HasIconUrl returns a boolean if a field has been set. +func (o *CreateAuthenticationPayload) HasIconUrl() bool { + if o != nil && !IsNil(o.IconUrl) { + return true + } + + return false +} + +// SetIconUrl gets a reference to the given string and assigns it to the IconUrl field. +func (o *CreateAuthenticationPayload) SetIconUrl(v string) { + o.IconUrl = &v +} + +// GetName returns the Name field value +func (o *CreateAuthenticationPayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateAuthenticationPayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateAuthenticationPayload) SetName(v string) { + o.Name = v +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *CreateAuthenticationPayload) GetProvider() string { + if o == nil || IsNil(o.Provider) { + var ret string + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAuthenticationPayload) GetProviderOk() (*string, bool) { + if o == nil || IsNil(o.Provider) { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *CreateAuthenticationPayload) HasProvider() bool { + if o != nil && !IsNil(o.Provider) { + return true + } + + return false +} + +// SetProvider gets a reference to the given string and assigns it to the Provider field. +func (o *CreateAuthenticationPayload) SetProvider(v string) { + o.Provider = &v +} + +// GetScopes returns the Scopes field value if set, zero value otherwise. +func (o *CreateAuthenticationPayload) GetScopes() string { + if o == nil || IsNil(o.Scopes) { + var ret string + return ret + } + return *o.Scopes +} + +// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateAuthenticationPayload) GetScopesOk() (*string, bool) { + if o == nil || IsNil(o.Scopes) { + return nil, false + } + return o.Scopes, true +} + +// HasScopes returns a boolean if a field has been set. +func (o *CreateAuthenticationPayload) HasScopes() bool { + if o != nil && !IsNil(o.Scopes) { + return true + } + + return false +} + +// SetScopes gets a reference to the given string and assigns it to the Scopes field. +func (o *CreateAuthenticationPayload) SetScopes(v string) { + o.Scopes = &v +} + +func (o CreateAuthenticationPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateAuthenticationPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["auto_discover_url"] = o.AutoDiscoverUrl + toSerialize["client_id"] = o.ClientId + toSerialize["client_secret"] = o.ClientSecret + if !IsNil(o.IconUrl) { + toSerialize["icon_url"] = o.IconUrl + } + toSerialize["name"] = o.Name + if !IsNil(o.Provider) { + toSerialize["provider"] = o.Provider + } + if !IsNil(o.Scopes) { + toSerialize["scopes"] = o.Scopes + } + return toSerialize, nil +} + +func (o *CreateAuthenticationPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "auto_discover_url", + "client_id", + "client_secret", + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateAuthenticationPayload := _CreateAuthenticationPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateAuthenticationPayload) + + if err != nil { + return err + } + + *o = CreateAuthenticationPayload(varCreateAuthenticationPayload) + + return err +} + +type NullableCreateAuthenticationPayload struct { + value *CreateAuthenticationPayload + isSet bool +} + +func (v NullableCreateAuthenticationPayload) Get() *CreateAuthenticationPayload { + return v.value +} + +func (v *NullableCreateAuthenticationPayload) Set(val *CreateAuthenticationPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateAuthenticationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateAuthenticationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateAuthenticationPayload(val *CreateAuthenticationPayload) *NullableCreateAuthenticationPayload { + return &NullableCreateAuthenticationPayload{value: val, isSet: true} +} + +func (v NullableCreateAuthenticationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateAuthenticationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_create_instance_payload.go b/services/git/v1betaapi/model_create_instance_payload.go new file mode 100644 index 000000000..1dbb1e0a8 --- /dev/null +++ b/services/git/v1betaapi/model_create_instance_payload.go @@ -0,0 +1,231 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateInstancePayload{} + +// CreateInstancePayload Request a STACKIT Git instance to be created with these properties. +type CreateInstancePayload struct { + // A list of CIDR network addresses that are allowed to access the instance. + Acl []string `json:"acl,omitempty"` + Flavor *string `json:"flavor,omitempty"` + // A user chosen name to distinguish multiple STACKIT Git instances. + Name string `json:"name" validate:"regexp=^[a-z]([a-z0-9\\\\-]){0,30}[a-z0-9]+$"` +} + +type _CreateInstancePayload CreateInstancePayload + +// NewCreateInstancePayload instantiates a new CreateInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateInstancePayload(name string) *CreateInstancePayload { + this := CreateInstancePayload{} + this.Name = name + return &this +} + +// NewCreateInstancePayloadWithDefaults instantiates a new CreateInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateInstancePayloadWithDefaults() *CreateInstancePayload { + this := CreateInstancePayload{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetAcl() []string { + if o == nil || IsNil(o.Acl) { + var ret []string + return ret + } + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetAclOk() ([]string, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given []string and assigns it to the Acl field. +func (o *CreateInstancePayload) SetAcl(v []string) { + o.Acl = v +} + +// GetFlavor returns the Flavor field value if set, zero value otherwise. +func (o *CreateInstancePayload) GetFlavor() string { + if o == nil || IsNil(o.Flavor) { + var ret string + return ret + } + return *o.Flavor +} + +// GetFlavorOk returns a tuple with the Flavor field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetFlavorOk() (*string, bool) { + if o == nil || IsNil(o.Flavor) { + return nil, false + } + return o.Flavor, true +} + +// HasFlavor returns a boolean if a field has been set. +func (o *CreateInstancePayload) HasFlavor() bool { + if o != nil && !IsNil(o.Flavor) { + return true + } + + return false +} + +// SetFlavor gets a reference to the given string and assigns it to the Flavor field. +func (o *CreateInstancePayload) SetFlavor(v string) { + o.Flavor = &v +} + +// GetName returns the Name field value +func (o *CreateInstancePayload) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *CreateInstancePayload) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *CreateInstancePayload) SetName(v string) { + o.Name = v +} + +func (o CreateInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Acl) { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.Flavor) { + toSerialize["flavor"] = o.Flavor + } + toSerialize["name"] = o.Name + return toSerialize, nil +} + +func (o *CreateInstancePayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "name", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateInstancePayload := _CreateInstancePayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateInstancePayload) + + if err != nil { + return err + } + + *o = CreateInstancePayload(varCreateInstancePayload) + + return err +} + +type NullableCreateInstancePayload struct { + value *CreateInstancePayload + isSet bool +} + +func (v NullableCreateInstancePayload) Get() *CreateInstancePayload { + return v.value +} + +func (v *NullableCreateInstancePayload) Set(val *CreateInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateInstancePayload(val *CreateInstancePayload) *NullableCreateInstancePayload { + return &NullableCreateInstancePayload{value: val, isSet: true} +} + +func (v NullableCreateInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_create_runner_payload.go b/services/git/v1betaapi/model_create_runner_payload.go new file mode 100644 index 000000000..f0bce7a40 --- /dev/null +++ b/services/git/v1betaapi/model_create_runner_payload.go @@ -0,0 +1,157 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the CreateRunnerPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &CreateRunnerPayload{} + +// CreateRunnerPayload Request a runner to be created supporting the requested list of runtime labels. +type CreateRunnerPayload struct { + Labels []string `json:"labels"` +} + +type _CreateRunnerPayload CreateRunnerPayload + +// NewCreateRunnerPayload instantiates a new CreateRunnerPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewCreateRunnerPayload(labels []string) *CreateRunnerPayload { + this := CreateRunnerPayload{} + this.Labels = labels + return &this +} + +// NewCreateRunnerPayloadWithDefaults instantiates a new CreateRunnerPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewCreateRunnerPayloadWithDefaults() *CreateRunnerPayload { + this := CreateRunnerPayload{} + return &this +} + +// GetLabels returns the Labels field value +func (o *CreateRunnerPayload) GetLabels() []string { + if o == nil { + var ret []string + return ret + } + + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value +// and a boolean to check if the value has been set. +func (o *CreateRunnerPayload) GetLabelsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Labels, true +} + +// SetLabels sets field value +func (o *CreateRunnerPayload) SetLabels(v []string) { + o.Labels = v +} + +func (o CreateRunnerPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o CreateRunnerPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["labels"] = o.Labels + return toSerialize, nil +} + +func (o *CreateRunnerPayload) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "labels", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varCreateRunnerPayload := _CreateRunnerPayload{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varCreateRunnerPayload) + + if err != nil { + return err + } + + *o = CreateRunnerPayload(varCreateRunnerPayload) + + return err +} + +type NullableCreateRunnerPayload struct { + value *CreateRunnerPayload + isSet bool +} + +func (v NullableCreateRunnerPayload) Get() *CreateRunnerPayload { + return v.value +} + +func (v *NullableCreateRunnerPayload) Set(val *CreateRunnerPayload) { + v.value = val + v.isSet = true +} + +func (v NullableCreateRunnerPayload) IsSet() bool { + return v.isSet +} + +func (v *NullableCreateRunnerPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableCreateRunnerPayload(val *CreateRunnerPayload) *NullableCreateRunnerPayload { + return &NullableCreateRunnerPayload{value: val, isSet: true} +} + +func (v NullableCreateRunnerPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableCreateRunnerPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_feature_toggle.go b/services/git/v1betaapi/model_feature_toggle.go new file mode 100644 index 000000000..06e5466bd --- /dev/null +++ b/services/git/v1betaapi/model_feature_toggle.go @@ -0,0 +1,233 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the FeatureToggle type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &FeatureToggle{} + +// FeatureToggle Feature toggles for the instance. +type FeatureToggle struct { + // Default email notifications. + DefaultEmailNotifications NullableString `json:"default_email_notifications,omitempty"` + // Enable commit signatures. + EnableCommitSignatures NullableBool `json:"enable_commit_signatures,omitempty"` + // Enable local login. + EnableLocalLogin NullableBool `json:"enable_local_login,omitempty"` +} + +// NewFeatureToggle instantiates a new FeatureToggle object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFeatureToggle() *FeatureToggle { + this := FeatureToggle{} + return &this +} + +// NewFeatureToggleWithDefaults instantiates a new FeatureToggle object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFeatureToggleWithDefaults() *FeatureToggle { + this := FeatureToggle{} + return &this +} + +// GetDefaultEmailNotifications returns the DefaultEmailNotifications field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FeatureToggle) GetDefaultEmailNotifications() string { + if o == nil || IsNil(o.DefaultEmailNotifications.Get()) { + var ret string + return ret + } + return *o.DefaultEmailNotifications.Get() +} + +// GetDefaultEmailNotificationsOk returns a tuple with the DefaultEmailNotifications field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FeatureToggle) GetDefaultEmailNotificationsOk() (*string, bool) { + if o == nil { + return nil, false + } + return o.DefaultEmailNotifications.Get(), o.DefaultEmailNotifications.IsSet() +} + +// HasDefaultEmailNotifications returns a boolean if a field has been set. +func (o *FeatureToggle) HasDefaultEmailNotifications() bool { + if o != nil && o.DefaultEmailNotifications.IsSet() { + return true + } + + return false +} + +// SetDefaultEmailNotifications gets a reference to the given NullableString and assigns it to the DefaultEmailNotifications field. +func (o *FeatureToggle) SetDefaultEmailNotifications(v string) { + o.DefaultEmailNotifications.Set(&v) +} + +// SetDefaultEmailNotificationsNil sets the value for DefaultEmailNotifications to be an explicit nil +func (o *FeatureToggle) SetDefaultEmailNotificationsNil() { + o.DefaultEmailNotifications.Set(nil) +} + +// UnsetDefaultEmailNotifications ensures that no value is present for DefaultEmailNotifications, not even an explicit nil +func (o *FeatureToggle) UnsetDefaultEmailNotifications() { + o.DefaultEmailNotifications.Unset() +} + +// GetEnableCommitSignatures returns the EnableCommitSignatures field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FeatureToggle) GetEnableCommitSignatures() bool { + if o == nil || IsNil(o.EnableCommitSignatures.Get()) { + var ret bool + return ret + } + return *o.EnableCommitSignatures.Get() +} + +// GetEnableCommitSignaturesOk returns a tuple with the EnableCommitSignatures field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FeatureToggle) GetEnableCommitSignaturesOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.EnableCommitSignatures.Get(), o.EnableCommitSignatures.IsSet() +} + +// HasEnableCommitSignatures returns a boolean if a field has been set. +func (o *FeatureToggle) HasEnableCommitSignatures() bool { + if o != nil && o.EnableCommitSignatures.IsSet() { + return true + } + + return false +} + +// SetEnableCommitSignatures gets a reference to the given NullableBool and assigns it to the EnableCommitSignatures field. +func (o *FeatureToggle) SetEnableCommitSignatures(v bool) { + o.EnableCommitSignatures.Set(&v) +} + +// SetEnableCommitSignaturesNil sets the value for EnableCommitSignatures to be an explicit nil +func (o *FeatureToggle) SetEnableCommitSignaturesNil() { + o.EnableCommitSignatures.Set(nil) +} + +// UnsetEnableCommitSignatures ensures that no value is present for EnableCommitSignatures, not even an explicit nil +func (o *FeatureToggle) UnsetEnableCommitSignatures() { + o.EnableCommitSignatures.Unset() +} + +// GetEnableLocalLogin returns the EnableLocalLogin field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *FeatureToggle) GetEnableLocalLogin() bool { + if o == nil || IsNil(o.EnableLocalLogin.Get()) { + var ret bool + return ret + } + return *o.EnableLocalLogin.Get() +} + +// GetEnableLocalLoginOk returns a tuple with the EnableLocalLogin field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *FeatureToggle) GetEnableLocalLoginOk() (*bool, bool) { + if o == nil { + return nil, false + } + return o.EnableLocalLogin.Get(), o.EnableLocalLogin.IsSet() +} + +// HasEnableLocalLogin returns a boolean if a field has been set. +func (o *FeatureToggle) HasEnableLocalLogin() bool { + if o != nil && o.EnableLocalLogin.IsSet() { + return true + } + + return false +} + +// SetEnableLocalLogin gets a reference to the given NullableBool and assigns it to the EnableLocalLogin field. +func (o *FeatureToggle) SetEnableLocalLogin(v bool) { + o.EnableLocalLogin.Set(&v) +} + +// SetEnableLocalLoginNil sets the value for EnableLocalLogin to be an explicit nil +func (o *FeatureToggle) SetEnableLocalLoginNil() { + o.EnableLocalLogin.Set(nil) +} + +// UnsetEnableLocalLogin ensures that no value is present for EnableLocalLogin, not even an explicit nil +func (o *FeatureToggle) UnsetEnableLocalLogin() { + o.EnableLocalLogin.Unset() +} + +func (o FeatureToggle) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o FeatureToggle) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.DefaultEmailNotifications.IsSet() { + toSerialize["default_email_notifications"] = o.DefaultEmailNotifications.Get() + } + if o.EnableCommitSignatures.IsSet() { + toSerialize["enable_commit_signatures"] = o.EnableCommitSignatures.Get() + } + if o.EnableLocalLogin.IsSet() { + toSerialize["enable_local_login"] = o.EnableLocalLogin.Get() + } + return toSerialize, nil +} + +type NullableFeatureToggle struct { + value *FeatureToggle + isSet bool +} + +func (v NullableFeatureToggle) Get() *FeatureToggle { + return v.value +} + +func (v *NullableFeatureToggle) Set(val *FeatureToggle) { + v.value = val + v.isSet = true +} + +func (v NullableFeatureToggle) IsSet() bool { + return v.isSet +} + +func (v *NullableFeatureToggle) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFeatureToggle(val *FeatureToggle) *NullableFeatureToggle { + return &NullableFeatureToggle{value: val, isSet: true} +} + +func (v NullableFeatureToggle) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFeatureToggle) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_flavor.go b/services/git/v1betaapi/model_flavor.go new file mode 100644 index 000000000..ee7930018 --- /dev/null +++ b/services/git/v1betaapi/model_flavor.go @@ -0,0 +1,274 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the Flavor type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Flavor{} + +// Flavor Describes a STACKIT Git Flavor. +type Flavor struct { + // Defines the flavor availability. + Availability string `json:"availability"` + // Flavor description. + Description string `json:"description"` + // The display name that will be shown in the Portal. + DisplayName string `json:"display_name"` + // Flavor id. + Id string `json:"id"` + // SAP article number. + Sku string `json:"sku"` +} + +type _Flavor Flavor + +// NewFlavor instantiates a new Flavor object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewFlavor(availability string, description string, displayName string, id string, sku string) *Flavor { + this := Flavor{} + this.Availability = availability + this.Description = description + this.DisplayName = displayName + this.Id = id + this.Sku = sku + return &this +} + +// NewFlavorWithDefaults instantiates a new Flavor object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewFlavorWithDefaults() *Flavor { + this := Flavor{} + return &this +} + +// GetAvailability returns the Availability field value +func (o *Flavor) GetAvailability() string { + if o == nil { + var ret string + return ret + } + + return o.Availability +} + +// GetAvailabilityOk returns a tuple with the Availability field value +// and a boolean to check if the value has been set. +func (o *Flavor) GetAvailabilityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Availability, true +} + +// SetAvailability sets field value +func (o *Flavor) SetAvailability(v string) { + o.Availability = v +} + +// GetDescription returns the Description field value +func (o *Flavor) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *Flavor) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *Flavor) SetDescription(v string) { + o.Description = v +} + +// GetDisplayName returns the DisplayName field value +func (o *Flavor) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *Flavor) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *Flavor) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetId returns the Id field value +func (o *Flavor) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Flavor) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Flavor) SetId(v string) { + o.Id = v +} + +// GetSku returns the Sku field value +func (o *Flavor) GetSku() string { + if o == nil { + var ret string + return ret + } + + return o.Sku +} + +// GetSkuOk returns a tuple with the Sku field value +// and a boolean to check if the value has been set. +func (o *Flavor) GetSkuOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Sku, true +} + +// SetSku sets field value +func (o *Flavor) SetSku(v string) { + o.Sku = v +} + +func (o Flavor) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Flavor) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["availability"] = o.Availability + toSerialize["description"] = o.Description + toSerialize["display_name"] = o.DisplayName + toSerialize["id"] = o.Id + toSerialize["sku"] = o.Sku + return toSerialize, nil +} + +func (o *Flavor) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "availability", + "description", + "display_name", + "id", + "sku", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varFlavor := _Flavor{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varFlavor) + + if err != nil { + return err + } + + *o = Flavor(varFlavor) + + return err +} + +type NullableFlavor struct { + value *Flavor + isSet bool +} + +func (v NullableFlavor) Get() *Flavor { + return v.value +} + +func (v *NullableFlavor) Set(val *Flavor) { + v.value = val + v.isSet = true +} + +func (v NullableFlavor) IsSet() bool { + return v.isSet +} + +func (v *NullableFlavor) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFlavor(val *Flavor) *NullableFlavor { + return &NullableFlavor{value: val, isSet: true} +} + +func (v NullableFlavor) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFlavor) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_generic_error_response.go b/services/git/v1betaapi/model_generic_error_response.go new file mode 100644 index 000000000..582a61025 --- /dev/null +++ b/services/git/v1betaapi/model_generic_error_response.go @@ -0,0 +1,193 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the GenericErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &GenericErrorResponse{} + +// GenericErrorResponse Generic Error Response. +type GenericErrorResponse struct { + Details []string `json:"details,omitempty"` + Message string `json:"message"` +} + +type _GenericErrorResponse GenericErrorResponse + +// NewGenericErrorResponse instantiates a new GenericErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewGenericErrorResponse(message string) *GenericErrorResponse { + this := GenericErrorResponse{} + this.Message = message + return &this +} + +// NewGenericErrorResponseWithDefaults instantiates a new GenericErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewGenericErrorResponseWithDefaults() *GenericErrorResponse { + this := GenericErrorResponse{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *GenericErrorResponse) GetDetails() []string { + if o == nil || IsNil(o.Details) { + var ret []string + return ret + } + return o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *GenericErrorResponse) GetDetailsOk() ([]string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *GenericErrorResponse) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given []string and assigns it to the Details field. +func (o *GenericErrorResponse) SetDetails(v []string) { + o.Details = v +} + +// GetMessage returns the Message field value +func (o *GenericErrorResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *GenericErrorResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *GenericErrorResponse) SetMessage(v string) { + o.Message = v +} + +func (o GenericErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o GenericErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + toSerialize["message"] = o.Message + return toSerialize, nil +} + +func (o *GenericErrorResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varGenericErrorResponse := _GenericErrorResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varGenericErrorResponse) + + if err != nil { + return err + } + + *o = GenericErrorResponse(varGenericErrorResponse) + + return err +} + +type NullableGenericErrorResponse struct { + value *GenericErrorResponse + isSet bool +} + +func (v NullableGenericErrorResponse) Get() *GenericErrorResponse { + return v.value +} + +func (v *NullableGenericErrorResponse) Set(val *GenericErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableGenericErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableGenericErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableGenericErrorResponse(val *GenericErrorResponse) *NullableGenericErrorResponse { + return &NullableGenericErrorResponse{value: val, isSet: true} +} + +func (v NullableGenericErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableGenericErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_instance.go b/services/git/v1betaapi/model_instance.go new file mode 100644 index 000000000..fd7140345 --- /dev/null +++ b/services/git/v1betaapi/model_instance.go @@ -0,0 +1,448 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Instance type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Instance{} + +// Instance Describes a STACKIT Git instance. +type Instance struct { + // Restricted ACL for instance access. + Acl []string `json:"acl"` + // How many bytes of disk space is consumed. Read Only. + ConsumedDisk string `json:"consumed_disk"` + // How many bytes of Object Storage is consumed. Read Only. + ConsumedObjectStorage string `json:"consumed_object_storage"` + // The date and time the creation of the STACKIT Git instance was triggered. + Created time.Time `json:"created"` + FeatureToggle FeatureToggle `json:"feature_toggle"` + // Instance flavor. + Flavor string `json:"flavor"` + // A auto generated unique id which identifies the STACKIT Git instances. + Id string `json:"id"` + // A user chosen name to distinguish multiple STACKIT Git instances. + Name string `json:"name"` + // The current state of the STACKIT Git instance. + State string `json:"state"` + // The URL for reaching the STACKIT Git instance. + Url string `json:"url"` + // The current version of STACKIT Git deployed to the instance. + Version string `json:"version"` +} + +type _Instance Instance + +// NewInstance instantiates a new Instance object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInstance(acl []string, consumedDisk string, consumedObjectStorage string, created time.Time, featureToggle FeatureToggle, flavor string, id string, name string, state string, url string, version string) *Instance { + this := Instance{} + this.Acl = acl + this.ConsumedDisk = consumedDisk + this.ConsumedObjectStorage = consumedObjectStorage + this.Created = created + this.FeatureToggle = featureToggle + this.Flavor = flavor + this.Id = id + this.Name = name + this.State = state + this.Url = url + this.Version = version + return &this +} + +// NewInstanceWithDefaults instantiates a new Instance object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInstanceWithDefaults() *Instance { + this := Instance{} + return &this +} + +// GetAcl returns the Acl field value +func (o *Instance) GetAcl() []string { + if o == nil { + var ret []string + return ret + } + + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value +// and a boolean to check if the value has been set. +func (o *Instance) GetAclOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Acl, true +} + +// SetAcl sets field value +func (o *Instance) SetAcl(v []string) { + o.Acl = v +} + +// GetConsumedDisk returns the ConsumedDisk field value +func (o *Instance) GetConsumedDisk() string { + if o == nil { + var ret string + return ret + } + + return o.ConsumedDisk +} + +// GetConsumedDiskOk returns a tuple with the ConsumedDisk field value +// and a boolean to check if the value has been set. +func (o *Instance) GetConsumedDiskOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsumedDisk, true +} + +// SetConsumedDisk sets field value +func (o *Instance) SetConsumedDisk(v string) { + o.ConsumedDisk = v +} + +// GetConsumedObjectStorage returns the ConsumedObjectStorage field value +func (o *Instance) GetConsumedObjectStorage() string { + if o == nil { + var ret string + return ret + } + + return o.ConsumedObjectStorage +} + +// GetConsumedObjectStorageOk returns a tuple with the ConsumedObjectStorage field value +// and a boolean to check if the value has been set. +func (o *Instance) GetConsumedObjectStorageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.ConsumedObjectStorage, true +} + +// SetConsumedObjectStorage sets field value +func (o *Instance) SetConsumedObjectStorage(v string) { + o.ConsumedObjectStorage = v +} + +// GetCreated returns the Created field value +func (o *Instance) GetCreated() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.Created +} + +// GetCreatedOk returns a tuple with the Created field value +// and a boolean to check if the value has been set. +func (o *Instance) GetCreatedOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.Created, true +} + +// SetCreated sets field value +func (o *Instance) SetCreated(v time.Time) { + o.Created = v +} + +// GetFeatureToggle returns the FeatureToggle field value +func (o *Instance) GetFeatureToggle() FeatureToggle { + if o == nil { + var ret FeatureToggle + return ret + } + + return o.FeatureToggle +} + +// GetFeatureToggleOk returns a tuple with the FeatureToggle field value +// and a boolean to check if the value has been set. +func (o *Instance) GetFeatureToggleOk() (*FeatureToggle, bool) { + if o == nil { + return nil, false + } + return &o.FeatureToggle, true +} + +// SetFeatureToggle sets field value +func (o *Instance) SetFeatureToggle(v FeatureToggle) { + o.FeatureToggle = v +} + +// GetFlavor returns the Flavor field value +func (o *Instance) GetFlavor() string { + if o == nil { + var ret string + return ret + } + + return o.Flavor +} + +// GetFlavorOk returns a tuple with the Flavor field value +// and a boolean to check if the value has been set. +func (o *Instance) GetFlavorOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Flavor, true +} + +// SetFlavor sets field value +func (o *Instance) SetFlavor(v string) { + o.Flavor = v +} + +// GetId returns the Id field value +func (o *Instance) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Instance) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Instance) SetId(v string) { + o.Id = v +} + +// GetName returns the Name field value +func (o *Instance) GetName() string { + if o == nil { + var ret string + return ret + } + + return o.Name +} + +// GetNameOk returns a tuple with the Name field value +// and a boolean to check if the value has been set. +func (o *Instance) GetNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Name, true +} + +// SetName sets field value +func (o *Instance) SetName(v string) { + o.Name = v +} + +// GetState returns the State field value +func (o *Instance) GetState() string { + if o == nil { + var ret string + return ret + } + + return o.State +} + +// GetStateOk returns a tuple with the State field value +// and a boolean to check if the value has been set. +func (o *Instance) GetStateOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.State, true +} + +// SetState sets field value +func (o *Instance) SetState(v string) { + o.State = v +} + +// GetUrl returns the Url field value +func (o *Instance) GetUrl() string { + if o == nil { + var ret string + return ret + } + + return o.Url +} + +// GetUrlOk returns a tuple with the Url field value +// and a boolean to check if the value has been set. +func (o *Instance) GetUrlOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Url, true +} + +// SetUrl sets field value +func (o *Instance) SetUrl(v string) { + o.Url = v +} + +// GetVersion returns the Version field value +func (o *Instance) GetVersion() string { + if o == nil { + var ret string + return ret + } + + return o.Version +} + +// GetVersionOk returns a tuple with the Version field value +// and a boolean to check if the value has been set. +func (o *Instance) GetVersionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Version, true +} + +// SetVersion sets field value +func (o *Instance) SetVersion(v string) { + o.Version = v +} + +func (o Instance) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Instance) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["acl"] = o.Acl + toSerialize["consumed_disk"] = o.ConsumedDisk + toSerialize["consumed_object_storage"] = o.ConsumedObjectStorage + toSerialize["created"] = o.Created + toSerialize["feature_toggle"] = o.FeatureToggle + toSerialize["flavor"] = o.Flavor + toSerialize["id"] = o.Id + toSerialize["name"] = o.Name + toSerialize["state"] = o.State + toSerialize["url"] = o.Url + toSerialize["version"] = o.Version + return toSerialize, nil +} + +func (o *Instance) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "acl", + "consumed_disk", + "consumed_object_storage", + "created", + "feature_toggle", + "flavor", + "id", + "name", + "state", + "url", + "version", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varInstance := _Instance{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varInstance) + + if err != nil { + return err + } + + *o = Instance(varInstance) + + return err +} + +type NullableInstance struct { + value *Instance + isSet bool +} + +func (v NullableInstance) Get() *Instance { + return v.value +} + +func (v *NullableInstance) Set(val *Instance) { + v.value = val + v.isSet = true +} + +func (v NullableInstance) IsSet() bool { + return v.isSet +} + +func (v *NullableInstance) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInstance(val *Instance) *NullableInstance { + return &NullableInstance{value: val, isSet: true} +} + +func (v NullableInstance) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInstance) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_internal_server_error_response.go b/services/git/v1betaapi/model_internal_server_error_response.go new file mode 100644 index 000000000..ceff4396a --- /dev/null +++ b/services/git/v1betaapi/model_internal_server_error_response.go @@ -0,0 +1,161 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the InternalServerErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &InternalServerErrorResponse{} + +// InternalServerErrorResponse Internal server error. +type InternalServerErrorResponse struct { + Details *string `json:"details,omitempty"` + Error *string `json:"error,omitempty"` +} + +// NewInternalServerErrorResponse instantiates a new InternalServerErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewInternalServerErrorResponse() *InternalServerErrorResponse { + this := InternalServerErrorResponse{} + return &this +} + +// NewInternalServerErrorResponseWithDefaults instantiates a new InternalServerErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewInternalServerErrorResponseWithDefaults() *InternalServerErrorResponse { + this := InternalServerErrorResponse{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *InternalServerErrorResponse) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalServerErrorResponse) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *InternalServerErrorResponse) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *InternalServerErrorResponse) SetDetails(v string) { + o.Details = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *InternalServerErrorResponse) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *InternalServerErrorResponse) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *InternalServerErrorResponse) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *InternalServerErrorResponse) SetError(v string) { + o.Error = &v +} + +func (o InternalServerErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o InternalServerErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + return toSerialize, nil +} + +type NullableInternalServerErrorResponse struct { + value *InternalServerErrorResponse + isSet bool +} + +func (v NullableInternalServerErrorResponse) Get() *InternalServerErrorResponse { + return v.value +} + +func (v *NullableInternalServerErrorResponse) Set(val *InternalServerErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableInternalServerErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableInternalServerErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInternalServerErrorResponse(val *InternalServerErrorResponse) *NullableInternalServerErrorResponse { + return &NullableInternalServerErrorResponse{value: val, isSet: true} +} + +func (v NullableInternalServerErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInternalServerErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_list_flavors.go b/services/git/v1betaapi/model_list_flavors.go new file mode 100644 index 000000000..f1d536186 --- /dev/null +++ b/services/git/v1betaapi/model_list_flavors.go @@ -0,0 +1,157 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListFlavors type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListFlavors{} + +// ListFlavors A list of STACKIT Git Flavors. +type ListFlavors struct { + Flavors []Flavor `json:"flavors"` +} + +type _ListFlavors ListFlavors + +// NewListFlavors instantiates a new ListFlavors object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListFlavors(flavors []Flavor) *ListFlavors { + this := ListFlavors{} + this.Flavors = flavors + return &this +} + +// NewListFlavorsWithDefaults instantiates a new ListFlavors object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListFlavorsWithDefaults() *ListFlavors { + this := ListFlavors{} + return &this +} + +// GetFlavors returns the Flavors field value +func (o *ListFlavors) GetFlavors() []Flavor { + if o == nil { + var ret []Flavor + return ret + } + + return o.Flavors +} + +// GetFlavorsOk returns a tuple with the Flavors field value +// and a boolean to check if the value has been set. +func (o *ListFlavors) GetFlavorsOk() ([]Flavor, bool) { + if o == nil { + return nil, false + } + return o.Flavors, true +} + +// SetFlavors sets field value +func (o *ListFlavors) SetFlavors(v []Flavor) { + o.Flavors = v +} + +func (o ListFlavors) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListFlavors) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["flavors"] = o.Flavors + return toSerialize, nil +} + +func (o *ListFlavors) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "flavors", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListFlavors := _ListFlavors{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListFlavors) + + if err != nil { + return err + } + + *o = ListFlavors(varListFlavors) + + return err +} + +type NullableListFlavors struct { + value *ListFlavors + isSet bool +} + +func (v NullableListFlavors) Get() *ListFlavors { + return v.value +} + +func (v *NullableListFlavors) Set(val *ListFlavors) { + v.value = val + v.isSet = true +} + +func (v NullableListFlavors) IsSet() bool { + return v.isSet +} + +func (v *NullableListFlavors) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListFlavors(val *ListFlavors) *NullableListFlavors { + return &NullableListFlavors{value: val, isSet: true} +} + +func (v NullableListFlavors) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListFlavors) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_list_instances.go b/services/git/v1betaapi/model_list_instances.go new file mode 100644 index 000000000..5459ad848 --- /dev/null +++ b/services/git/v1betaapi/model_list_instances.go @@ -0,0 +1,157 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the ListInstances type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &ListInstances{} + +// ListInstances A list of STACKIT Git instances. +type ListInstances struct { + Instances []Instance `json:"instances"` +} + +type _ListInstances ListInstances + +// NewListInstances instantiates a new ListInstances object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewListInstances(instances []Instance) *ListInstances { + this := ListInstances{} + this.Instances = instances + return &this +} + +// NewListInstancesWithDefaults instantiates a new ListInstances object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewListInstancesWithDefaults() *ListInstances { + this := ListInstances{} + return &this +} + +// GetInstances returns the Instances field value +func (o *ListInstances) GetInstances() []Instance { + if o == nil { + var ret []Instance + return ret + } + + return o.Instances +} + +// GetInstancesOk returns a tuple with the Instances field value +// and a boolean to check if the value has been set. +func (o *ListInstances) GetInstancesOk() ([]Instance, bool) { + if o == nil { + return nil, false + } + return o.Instances, true +} + +// SetInstances sets field value +func (o *ListInstances) SetInstances(v []Instance) { + o.Instances = v +} + +func (o ListInstances) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o ListInstances) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["instances"] = o.Instances + return toSerialize, nil +} + +func (o *ListInstances) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "instances", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varListInstances := _ListInstances{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varListInstances) + + if err != nil { + return err + } + + *o = ListInstances(varListInstances) + + return err +} + +type NullableListInstances struct { + value *ListInstances + isSet bool +} + +func (v NullableListInstances) Get() *ListInstances { + return v.value +} + +func (v *NullableListInstances) Set(val *ListInstances) { + v.value = val + v.isSet = true +} + +func (v NullableListInstances) IsSet() bool { + return v.isSet +} + +func (v *NullableListInstances) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableListInstances(val *ListInstances) *NullableListInstances { + return &NullableListInstances{value: val, isSet: true} +} + +func (v NullableListInstances) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableListInstances) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_not_found_error_response.go b/services/git/v1betaapi/model_not_found_error_response.go new file mode 100644 index 000000000..4b0ad682a --- /dev/null +++ b/services/git/v1betaapi/model_not_found_error_response.go @@ -0,0 +1,161 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the NotFoundErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &NotFoundErrorResponse{} + +// NotFoundErrorResponse 404 Error Response. +type NotFoundErrorResponse struct { + Details *string `json:"details,omitempty"` + Error *string `json:"error,omitempty"` +} + +// NewNotFoundErrorResponse instantiates a new NotFoundErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewNotFoundErrorResponse() *NotFoundErrorResponse { + this := NotFoundErrorResponse{} + return &this +} + +// NewNotFoundErrorResponseWithDefaults instantiates a new NotFoundErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewNotFoundErrorResponseWithDefaults() *NotFoundErrorResponse { + this := NotFoundErrorResponse{} + return &this +} + +// GetDetails returns the Details field value if set, zero value otherwise. +func (o *NotFoundErrorResponse) GetDetails() string { + if o == nil || IsNil(o.Details) { + var ret string + return ret + } + return *o.Details +} + +// GetDetailsOk returns a tuple with the Details field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotFoundErrorResponse) GetDetailsOk() (*string, bool) { + if o == nil || IsNil(o.Details) { + return nil, false + } + return o.Details, true +} + +// HasDetails returns a boolean if a field has been set. +func (o *NotFoundErrorResponse) HasDetails() bool { + if o != nil && !IsNil(o.Details) { + return true + } + + return false +} + +// SetDetails gets a reference to the given string and assigns it to the Details field. +func (o *NotFoundErrorResponse) SetDetails(v string) { + o.Details = &v +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *NotFoundErrorResponse) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *NotFoundErrorResponse) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *NotFoundErrorResponse) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *NotFoundErrorResponse) SetError(v string) { + o.Error = &v +} + +func (o NotFoundErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o NotFoundErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Details) { + toSerialize["details"] = o.Details + } + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + return toSerialize, nil +} + +type NullableNotFoundErrorResponse struct { + value *NotFoundErrorResponse + isSet bool +} + +func (v NullableNotFoundErrorResponse) Get() *NotFoundErrorResponse { + return v.value +} + +func (v *NullableNotFoundErrorResponse) Set(val *NotFoundErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableNotFoundErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableNotFoundErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableNotFoundErrorResponse(val *NotFoundErrorResponse) *NullableNotFoundErrorResponse { + return &NullableNotFoundErrorResponse{value: val, isSet: true} +} + +func (v NullableNotFoundErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableNotFoundErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_patch_authentication_payload.go b/services/git/v1betaapi/model_patch_authentication_payload.go new file mode 100644 index 000000000..27866732b --- /dev/null +++ b/services/git/v1betaapi/model_patch_authentication_payload.go @@ -0,0 +1,311 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the PatchAuthenticationPayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchAuthenticationPayload{} + +// PatchAuthenticationPayload Properties to patch on an authentication. All fields are optional. +type PatchAuthenticationPayload struct { + // The well-known configuration url to use for this authentication definition. + AutoDiscoverUrl *string `json:"auto_discover_url,omitempty" validate:"regexp=^https:\\/\\/[a-zA-Z0-9\\\\-\\\\.]+(\\\\.[a-zA-Z]{2,})+(\\/.*)?$"` + // The IDP client id to use. + ClientId *string `json:"client_id,omitempty"` + // The IDP client secret to use. + ClientSecret *string `json:"client_secret,omitempty"` + // The url of the icon to use for this authentication definition. + IconUrl *string `json:"icon_url,omitempty" validate:"regexp=^https:\\/\\/[a-zA-Z0-9\\\\-\\\\.]+(\\\\.[a-zA-Z]{2,})+(\\/.*)?$"` + // The Oauth2 provider to use. + Provider *string `json:"provider,omitempty"` + // Scopes defines the OIDC scopes to request. + Scopes *string `json:"scopes,omitempty"` +} + +// NewPatchAuthenticationPayload instantiates a new PatchAuthenticationPayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchAuthenticationPayload() *PatchAuthenticationPayload { + this := PatchAuthenticationPayload{} + return &this +} + +// NewPatchAuthenticationPayloadWithDefaults instantiates a new PatchAuthenticationPayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchAuthenticationPayloadWithDefaults() *PatchAuthenticationPayload { + this := PatchAuthenticationPayload{} + return &this +} + +// GetAutoDiscoverUrl returns the AutoDiscoverUrl field value if set, zero value otherwise. +func (o *PatchAuthenticationPayload) GetAutoDiscoverUrl() string { + if o == nil || IsNil(o.AutoDiscoverUrl) { + var ret string + return ret + } + return *o.AutoDiscoverUrl +} + +// GetAutoDiscoverUrlOk returns a tuple with the AutoDiscoverUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchAuthenticationPayload) GetAutoDiscoverUrlOk() (*string, bool) { + if o == nil || IsNil(o.AutoDiscoverUrl) { + return nil, false + } + return o.AutoDiscoverUrl, true +} + +// HasAutoDiscoverUrl returns a boolean if a field has been set. +func (o *PatchAuthenticationPayload) HasAutoDiscoverUrl() bool { + if o != nil && !IsNil(o.AutoDiscoverUrl) { + return true + } + + return false +} + +// SetAutoDiscoverUrl gets a reference to the given string and assigns it to the AutoDiscoverUrl field. +func (o *PatchAuthenticationPayload) SetAutoDiscoverUrl(v string) { + o.AutoDiscoverUrl = &v +} + +// GetClientId returns the ClientId field value if set, zero value otherwise. +func (o *PatchAuthenticationPayload) GetClientId() string { + if o == nil || IsNil(o.ClientId) { + var ret string + return ret + } + return *o.ClientId +} + +// GetClientIdOk returns a tuple with the ClientId field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchAuthenticationPayload) GetClientIdOk() (*string, bool) { + if o == nil || IsNil(o.ClientId) { + return nil, false + } + return o.ClientId, true +} + +// HasClientId returns a boolean if a field has been set. +func (o *PatchAuthenticationPayload) HasClientId() bool { + if o != nil && !IsNil(o.ClientId) { + return true + } + + return false +} + +// SetClientId gets a reference to the given string and assigns it to the ClientId field. +func (o *PatchAuthenticationPayload) SetClientId(v string) { + o.ClientId = &v +} + +// GetClientSecret returns the ClientSecret field value if set, zero value otherwise. +func (o *PatchAuthenticationPayload) GetClientSecret() string { + if o == nil || IsNil(o.ClientSecret) { + var ret string + return ret + } + return *o.ClientSecret +} + +// GetClientSecretOk returns a tuple with the ClientSecret field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchAuthenticationPayload) GetClientSecretOk() (*string, bool) { + if o == nil || IsNil(o.ClientSecret) { + return nil, false + } + return o.ClientSecret, true +} + +// HasClientSecret returns a boolean if a field has been set. +func (o *PatchAuthenticationPayload) HasClientSecret() bool { + if o != nil && !IsNil(o.ClientSecret) { + return true + } + + return false +} + +// SetClientSecret gets a reference to the given string and assigns it to the ClientSecret field. +func (o *PatchAuthenticationPayload) SetClientSecret(v string) { + o.ClientSecret = &v +} + +// GetIconUrl returns the IconUrl field value if set, zero value otherwise. +func (o *PatchAuthenticationPayload) GetIconUrl() string { + if o == nil || IsNil(o.IconUrl) { + var ret string + return ret + } + return *o.IconUrl +} + +// GetIconUrlOk returns a tuple with the IconUrl field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchAuthenticationPayload) GetIconUrlOk() (*string, bool) { + if o == nil || IsNil(o.IconUrl) { + return nil, false + } + return o.IconUrl, true +} + +// HasIconUrl returns a boolean if a field has been set. +func (o *PatchAuthenticationPayload) HasIconUrl() bool { + if o != nil && !IsNil(o.IconUrl) { + return true + } + + return false +} + +// SetIconUrl gets a reference to the given string and assigns it to the IconUrl field. +func (o *PatchAuthenticationPayload) SetIconUrl(v string) { + o.IconUrl = &v +} + +// GetProvider returns the Provider field value if set, zero value otherwise. +func (o *PatchAuthenticationPayload) GetProvider() string { + if o == nil || IsNil(o.Provider) { + var ret string + return ret + } + return *o.Provider +} + +// GetProviderOk returns a tuple with the Provider field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchAuthenticationPayload) GetProviderOk() (*string, bool) { + if o == nil || IsNil(o.Provider) { + return nil, false + } + return o.Provider, true +} + +// HasProvider returns a boolean if a field has been set. +func (o *PatchAuthenticationPayload) HasProvider() bool { + if o != nil && !IsNil(o.Provider) { + return true + } + + return false +} + +// SetProvider gets a reference to the given string and assigns it to the Provider field. +func (o *PatchAuthenticationPayload) SetProvider(v string) { + o.Provider = &v +} + +// GetScopes returns the Scopes field value if set, zero value otherwise. +func (o *PatchAuthenticationPayload) GetScopes() string { + if o == nil || IsNil(o.Scopes) { + var ret string + return ret + } + return *o.Scopes +} + +// GetScopesOk returns a tuple with the Scopes field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchAuthenticationPayload) GetScopesOk() (*string, bool) { + if o == nil || IsNil(o.Scopes) { + return nil, false + } + return o.Scopes, true +} + +// HasScopes returns a boolean if a field has been set. +func (o *PatchAuthenticationPayload) HasScopes() bool { + if o != nil && !IsNil(o.Scopes) { + return true + } + + return false +} + +// SetScopes gets a reference to the given string and assigns it to the Scopes field. +func (o *PatchAuthenticationPayload) SetScopes(v string) { + o.Scopes = &v +} + +func (o PatchAuthenticationPayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchAuthenticationPayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.AutoDiscoverUrl) { + toSerialize["auto_discover_url"] = o.AutoDiscoverUrl + } + if !IsNil(o.ClientId) { + toSerialize["client_id"] = o.ClientId + } + if !IsNil(o.ClientSecret) { + toSerialize["client_secret"] = o.ClientSecret + } + if !IsNil(o.IconUrl) { + toSerialize["icon_url"] = o.IconUrl + } + if !IsNil(o.Provider) { + toSerialize["provider"] = o.Provider + } + if !IsNil(o.Scopes) { + toSerialize["scopes"] = o.Scopes + } + return toSerialize, nil +} + +type NullablePatchAuthenticationPayload struct { + value *PatchAuthenticationPayload + isSet bool +} + +func (v NullablePatchAuthenticationPayload) Get() *PatchAuthenticationPayload { + return v.value +} + +func (v *NullablePatchAuthenticationPayload) Set(val *PatchAuthenticationPayload) { + v.value = val + v.isSet = true +} + +func (v NullablePatchAuthenticationPayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchAuthenticationPayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchAuthenticationPayload(val *PatchAuthenticationPayload) *NullablePatchAuthenticationPayload { + return &NullablePatchAuthenticationPayload{value: val, isSet: true} +} + +func (v NullablePatchAuthenticationPayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchAuthenticationPayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_patch_instance_payload.go b/services/git/v1betaapi/model_patch_instance_payload.go new file mode 100644 index 000000000..c70b3de7e --- /dev/null +++ b/services/git/v1betaapi/model_patch_instance_payload.go @@ -0,0 +1,163 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "encoding/json" +) + +// checks if the PatchInstancePayload type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchInstancePayload{} + +// PatchInstancePayload Properties to patch on an instance. All fields are optional. +type PatchInstancePayload struct { + // A list of CIDR network addresses that are allowed to access the instance. + Acl []string `json:"acl,omitempty"` + FeatureToggle *FeatureToggle `json:"feature_toggle,omitempty"` +} + +// NewPatchInstancePayload instantiates a new PatchInstancePayload object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchInstancePayload() *PatchInstancePayload { + this := PatchInstancePayload{} + return &this +} + +// NewPatchInstancePayloadWithDefaults instantiates a new PatchInstancePayload object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchInstancePayloadWithDefaults() *PatchInstancePayload { + this := PatchInstancePayload{} + return &this +} + +// GetAcl returns the Acl field value if set, zero value otherwise (both if not set or set to explicit null). +func (o *PatchInstancePayload) GetAcl() []string { + if o == nil { + var ret []string + return ret + } + return o.Acl +} + +// GetAclOk returns a tuple with the Acl field value if set, nil otherwise +// and a boolean to check if the value has been set. +// NOTE: If the value is an explicit nil, `nil, true` will be returned +func (o *PatchInstancePayload) GetAclOk() ([]string, bool) { + if o == nil || IsNil(o.Acl) { + return nil, false + } + return o.Acl, true +} + +// HasAcl returns a boolean if a field has been set. +func (o *PatchInstancePayload) HasAcl() bool { + if o != nil && !IsNil(o.Acl) { + return true + } + + return false +} + +// SetAcl gets a reference to the given []string and assigns it to the Acl field. +func (o *PatchInstancePayload) SetAcl(v []string) { + o.Acl = v +} + +// GetFeatureToggle returns the FeatureToggle field value if set, zero value otherwise. +func (o *PatchInstancePayload) GetFeatureToggle() FeatureToggle { + if o == nil || IsNil(o.FeatureToggle) { + var ret FeatureToggle + return ret + } + return *o.FeatureToggle +} + +// GetFeatureToggleOk returns a tuple with the FeatureToggle field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchInstancePayload) GetFeatureToggleOk() (*FeatureToggle, bool) { + if o == nil || IsNil(o.FeatureToggle) { + return nil, false + } + return o.FeatureToggle, true +} + +// HasFeatureToggle returns a boolean if a field has been set. +func (o *PatchInstancePayload) HasFeatureToggle() bool { + if o != nil && !IsNil(o.FeatureToggle) { + return true + } + + return false +} + +// SetFeatureToggle gets a reference to the given FeatureToggle and assigns it to the FeatureToggle field. +func (o *PatchInstancePayload) SetFeatureToggle(v FeatureToggle) { + o.FeatureToggle = &v +} + +func (o PatchInstancePayload) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchInstancePayload) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if o.Acl != nil { + toSerialize["acl"] = o.Acl + } + if !IsNil(o.FeatureToggle) { + toSerialize["feature_toggle"] = o.FeatureToggle + } + return toSerialize, nil +} + +type NullablePatchInstancePayload struct { + value *PatchInstancePayload + isSet bool +} + +func (v NullablePatchInstancePayload) Get() *PatchInstancePayload { + return v.value +} + +func (v *NullablePatchInstancePayload) Set(val *PatchInstancePayload) { + v.value = val + v.isSet = true +} + +func (v NullablePatchInstancePayload) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchInstancePayload) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchInstancePayload(val *PatchInstancePayload) *NullablePatchInstancePayload { + return &NullablePatchInstancePayload{value: val, isSet: true} +} + +func (v NullablePatchInstancePayload) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchInstancePayload) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_patch_operation.go b/services/git/v1betaapi/model_patch_operation.go new file mode 100644 index 000000000..a92bbecc9 --- /dev/null +++ b/services/git/v1betaapi/model_patch_operation.go @@ -0,0 +1,224 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the PatchOperation type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &PatchOperation{} + +// PatchOperation Request a STACKIT Git instance to be patch with these properties. +type PatchOperation struct { + // The patch operation to perform. + Op string `json:"op"` + // An RFC6901 JSON Pointer to the target location. + Path string `json:"path"` + // The value to be used for 'add' and 'remove' operations. + Value *string `json:"value,omitempty"` +} + +type _PatchOperation PatchOperation + +// NewPatchOperation instantiates a new PatchOperation object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewPatchOperation(op string, path string) *PatchOperation { + this := PatchOperation{} + this.Op = op + this.Path = path + return &this +} + +// NewPatchOperationWithDefaults instantiates a new PatchOperation object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewPatchOperationWithDefaults() *PatchOperation { + this := PatchOperation{} + return &this +} + +// GetOp returns the Op field value +func (o *PatchOperation) GetOp() string { + if o == nil { + var ret string + return ret + } + + return o.Op +} + +// GetOpOk returns a tuple with the Op field value +// and a boolean to check if the value has been set. +func (o *PatchOperation) GetOpOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Op, true +} + +// SetOp sets field value +func (o *PatchOperation) SetOp(v string) { + o.Op = v +} + +// GetPath returns the Path field value +func (o *PatchOperation) GetPath() string { + if o == nil { + var ret string + return ret + } + + return o.Path +} + +// GetPathOk returns a tuple with the Path field value +// and a boolean to check if the value has been set. +func (o *PatchOperation) GetPathOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Path, true +} + +// SetPath sets field value +func (o *PatchOperation) SetPath(v string) { + o.Path = v +} + +// GetValue returns the Value field value if set, zero value otherwise. +func (o *PatchOperation) GetValue() string { + if o == nil || IsNil(o.Value) { + var ret string + return ret + } + return *o.Value +} + +// GetValueOk returns a tuple with the Value field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PatchOperation) GetValueOk() (*string, bool) { + if o == nil || IsNil(o.Value) { + return nil, false + } + return o.Value, true +} + +// HasValue returns a boolean if a field has been set. +func (o *PatchOperation) HasValue() bool { + if o != nil && !IsNil(o.Value) { + return true + } + + return false +} + +// SetValue gets a reference to the given string and assigns it to the Value field. +func (o *PatchOperation) SetValue(v string) { + o.Value = &v +} + +func (o PatchOperation) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o PatchOperation) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["op"] = o.Op + toSerialize["path"] = o.Path + if !IsNil(o.Value) { + toSerialize["value"] = o.Value + } + return toSerialize, nil +} + +func (o *PatchOperation) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "op", + "path", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varPatchOperation := _PatchOperation{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varPatchOperation) + + if err != nil { + return err + } + + *o = PatchOperation(varPatchOperation) + + return err +} + +type NullablePatchOperation struct { + value *PatchOperation + isSet bool +} + +func (v NullablePatchOperation) Get() *PatchOperation { + return v.value +} + +func (v *NullablePatchOperation) Set(val *PatchOperation) { + v.value = val + v.isSet = true +} + +func (v NullablePatchOperation) IsSet() bool { + return v.isSet +} + +func (v *NullablePatchOperation) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullablePatchOperation(val *PatchOperation) *NullablePatchOperation { + return &NullablePatchOperation{value: val, isSet: true} +} + +func (v NullablePatchOperation) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullablePatchOperation) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_runner.go b/services/git/v1betaapi/model_runner.go new file mode 100644 index 000000000..53a8fd08d --- /dev/null +++ b/services/git/v1betaapi/model_runner.go @@ -0,0 +1,243 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the Runner type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &Runner{} + +// Runner Describes a runner associated to a STACKIT Git instance. +type Runner struct { + CreatedAt time.Time `json:"created_at"` + Id string `json:"id"` + Labels []string `json:"labels"` + // The current status of the runner. + Status string `json:"status"` +} + +type _Runner Runner + +// NewRunner instantiates a new Runner object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunner(createdAt time.Time, id string, labels []string, status string) *Runner { + this := Runner{} + this.CreatedAt = createdAt + this.Id = id + this.Labels = labels + this.Status = status + return &this +} + +// NewRunnerWithDefaults instantiates a new Runner object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunnerWithDefaults() *Runner { + this := Runner{} + return &this +} + +// GetCreatedAt returns the CreatedAt field value +func (o *Runner) GetCreatedAt() time.Time { + if o == nil { + var ret time.Time + return ret + } + + return o.CreatedAt +} + +// GetCreatedAtOk returns a tuple with the CreatedAt field value +// and a boolean to check if the value has been set. +func (o *Runner) GetCreatedAtOk() (*time.Time, bool) { + if o == nil { + return nil, false + } + return &o.CreatedAt, true +} + +// SetCreatedAt sets field value +func (o *Runner) SetCreatedAt(v time.Time) { + o.CreatedAt = v +} + +// GetId returns the Id field value +func (o *Runner) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *Runner) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *Runner) SetId(v string) { + o.Id = v +} + +// GetLabels returns the Labels field value +func (o *Runner) GetLabels() []string { + if o == nil { + var ret []string + return ret + } + + return o.Labels +} + +// GetLabelsOk returns a tuple with the Labels field value +// and a boolean to check if the value has been set. +func (o *Runner) GetLabelsOk() ([]string, bool) { + if o == nil { + return nil, false + } + return o.Labels, true +} + +// SetLabels sets field value +func (o *Runner) SetLabels(v []string) { + o.Labels = v +} + +// GetStatus returns the Status field value +func (o *Runner) GetStatus() string { + if o == nil { + var ret string + return ret + } + + return o.Status +} + +// GetStatusOk returns a tuple with the Status field value +// and a boolean to check if the value has been set. +func (o *Runner) GetStatusOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Status, true +} + +// SetStatus sets field value +func (o *Runner) SetStatus(v string) { + o.Status = v +} + +func (o Runner) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o Runner) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["created_at"] = o.CreatedAt + toSerialize["id"] = o.Id + toSerialize["labels"] = o.Labels + toSerialize["status"] = o.Status + return toSerialize, nil +} + +func (o *Runner) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "created_at", + "id", + "labels", + "status", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRunner := _Runner{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRunner) + + if err != nil { + return err + } + + *o = Runner(varRunner) + + return err +} + +type NullableRunner struct { + value *Runner + isSet bool +} + +func (v NullableRunner) Get() *Runner { + return v.value +} + +func (v *NullableRunner) Set(val *Runner) { + v.value = val + v.isSet = true +} + +func (v NullableRunner) IsSet() bool { + return v.isSet +} + +func (v *NullableRunner) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunner(val *Runner) *NullableRunner { + return &NullableRunner{value: val, isSet: true} +} + +func (v NullableRunner) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunner) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_runner_runtime.go b/services/git/v1betaapi/model_runner_runtime.go new file mode 100644 index 000000000..92dfb1b53 --- /dev/null +++ b/services/git/v1betaapi/model_runner_runtime.go @@ -0,0 +1,274 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RunnerRuntime type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunnerRuntime{} + +// RunnerRuntime Describes a STACKIT Git Runner runtime. +type RunnerRuntime struct { + // Indicates the availability of the runner label + Availability string `json:"availability"` + // Human-friendly description of the runtime and it's capabilities. + Description string `json:"description"` + // Human-friendly name of the runtime. + DisplayName string `json:"display_name"` + // Runtime identifier. + Id string `json:"id"` + // Runtime label. + Label string `json:"label"` +} + +type _RunnerRuntime RunnerRuntime + +// NewRunnerRuntime instantiates a new RunnerRuntime object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunnerRuntime(availability string, description string, displayName string, id string, label string) *RunnerRuntime { + this := RunnerRuntime{} + this.Availability = availability + this.Description = description + this.DisplayName = displayName + this.Id = id + this.Label = label + return &this +} + +// NewRunnerRuntimeWithDefaults instantiates a new RunnerRuntime object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunnerRuntimeWithDefaults() *RunnerRuntime { + this := RunnerRuntime{} + return &this +} + +// GetAvailability returns the Availability field value +func (o *RunnerRuntime) GetAvailability() string { + if o == nil { + var ret string + return ret + } + + return o.Availability +} + +// GetAvailabilityOk returns a tuple with the Availability field value +// and a boolean to check if the value has been set. +func (o *RunnerRuntime) GetAvailabilityOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Availability, true +} + +// SetAvailability sets field value +func (o *RunnerRuntime) SetAvailability(v string) { + o.Availability = v +} + +// GetDescription returns the Description field value +func (o *RunnerRuntime) GetDescription() string { + if o == nil { + var ret string + return ret + } + + return o.Description +} + +// GetDescriptionOk returns a tuple with the Description field value +// and a boolean to check if the value has been set. +func (o *RunnerRuntime) GetDescriptionOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Description, true +} + +// SetDescription sets field value +func (o *RunnerRuntime) SetDescription(v string) { + o.Description = v +} + +// GetDisplayName returns the DisplayName field value +func (o *RunnerRuntime) GetDisplayName() string { + if o == nil { + var ret string + return ret + } + + return o.DisplayName +} + +// GetDisplayNameOk returns a tuple with the DisplayName field value +// and a boolean to check if the value has been set. +func (o *RunnerRuntime) GetDisplayNameOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.DisplayName, true +} + +// SetDisplayName sets field value +func (o *RunnerRuntime) SetDisplayName(v string) { + o.DisplayName = v +} + +// GetId returns the Id field value +func (o *RunnerRuntime) GetId() string { + if o == nil { + var ret string + return ret + } + + return o.Id +} + +// GetIdOk returns a tuple with the Id field value +// and a boolean to check if the value has been set. +func (o *RunnerRuntime) GetIdOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Id, true +} + +// SetId sets field value +func (o *RunnerRuntime) SetId(v string) { + o.Id = v +} + +// GetLabel returns the Label field value +func (o *RunnerRuntime) GetLabel() string { + if o == nil { + var ret string + return ret + } + + return o.Label +} + +// GetLabelOk returns a tuple with the Label field value +// and a boolean to check if the value has been set. +func (o *RunnerRuntime) GetLabelOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Label, true +} + +// SetLabel sets field value +func (o *RunnerRuntime) SetLabel(v string) { + o.Label = v +} + +func (o RunnerRuntime) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunnerRuntime) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["availability"] = o.Availability + toSerialize["description"] = o.Description + toSerialize["display_name"] = o.DisplayName + toSerialize["id"] = o.Id + toSerialize["label"] = o.Label + return toSerialize, nil +} + +func (o *RunnerRuntime) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "availability", + "description", + "display_name", + "id", + "label", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRunnerRuntime := _RunnerRuntime{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRunnerRuntime) + + if err != nil { + return err + } + + *o = RunnerRuntime(varRunnerRuntime) + + return err +} + +type NullableRunnerRuntime struct { + value *RunnerRuntime + isSet bool +} + +func (v NullableRunnerRuntime) Get() *RunnerRuntime { + return v.value +} + +func (v *NullableRunnerRuntime) Set(val *RunnerRuntime) { + v.value = val + v.isSet = true +} + +func (v NullableRunnerRuntime) IsSet() bool { + return v.isSet +} + +func (v *NullableRunnerRuntime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunnerRuntime(val *RunnerRuntime) *NullableRunnerRuntime { + return &NullableRunnerRuntime{value: val, isSet: true} +} + +func (v NullableRunnerRuntime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunnerRuntime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_runner_runtime_list.go b/services/git/v1betaapi/model_runner_runtime_list.go new file mode 100644 index 000000000..737028e0e --- /dev/null +++ b/services/git/v1betaapi/model_runner_runtime_list.go @@ -0,0 +1,157 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" +) + +// checks if the RunnerRuntimeList type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &RunnerRuntimeList{} + +// RunnerRuntimeList A list of STACKIT Git RunnerLabels. +type RunnerRuntimeList struct { + Items []RunnerRuntime `json:"items"` +} + +type _RunnerRuntimeList RunnerRuntimeList + +// NewRunnerRuntimeList instantiates a new RunnerRuntimeList object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewRunnerRuntimeList(items []RunnerRuntime) *RunnerRuntimeList { + this := RunnerRuntimeList{} + this.Items = items + return &this +} + +// NewRunnerRuntimeListWithDefaults instantiates a new RunnerRuntimeList object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewRunnerRuntimeListWithDefaults() *RunnerRuntimeList { + this := RunnerRuntimeList{} + return &this +} + +// GetItems returns the Items field value +func (o *RunnerRuntimeList) GetItems() []RunnerRuntime { + if o == nil { + var ret []RunnerRuntime + return ret + } + + return o.Items +} + +// GetItemsOk returns a tuple with the Items field value +// and a boolean to check if the value has been set. +func (o *RunnerRuntimeList) GetItemsOk() ([]RunnerRuntime, bool) { + if o == nil { + return nil, false + } + return o.Items, true +} + +// SetItems sets field value +func (o *RunnerRuntimeList) SetItems(v []RunnerRuntime) { + o.Items = v +} + +func (o RunnerRuntimeList) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o RunnerRuntimeList) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + toSerialize["items"] = o.Items + return toSerialize, nil +} + +func (o *RunnerRuntimeList) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "items", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varRunnerRuntimeList := _RunnerRuntimeList{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varRunnerRuntimeList) + + if err != nil { + return err + } + + *o = RunnerRuntimeList(varRunnerRuntimeList) + + return err +} + +type NullableRunnerRuntimeList struct { + value *RunnerRuntimeList + isSet bool +} + +func (v NullableRunnerRuntimeList) Get() *RunnerRuntimeList { + return v.value +} + +func (v *NullableRunnerRuntimeList) Set(val *RunnerRuntimeList) { + v.value = val + v.isSet = true +} + +func (v NullableRunnerRuntimeList) IsSet() bool { + return v.isSet +} + +func (v *NullableRunnerRuntimeList) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableRunnerRuntimeList(val *RunnerRuntimeList) *NullableRunnerRuntimeList { + return &NullableRunnerRuntimeList{value: val, isSet: true} +} + +func (v NullableRunnerRuntimeList) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableRunnerRuntimeList) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/model_unauthorized_error_response.go b/services/git/v1betaapi/model_unauthorized_error_response.go new file mode 100644 index 000000000..1cf0b1868 --- /dev/null +++ b/services/git/v1betaapi/model_unauthorized_error_response.go @@ -0,0 +1,302 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "time" +) + +// checks if the UnauthorizedErrorResponse type satisfies the MappedNullable interface at compile time +var _ MappedNullable = &UnauthorizedErrorResponse{} + +// UnauthorizedErrorResponse Unauthorized Error Response. +type UnauthorizedErrorResponse struct { + Error *string `json:"error,omitempty"` + Message string `json:"message"` + Path *string `json:"path,omitempty"` + Status *int32 `json:"status,omitempty"` + Timestamp *time.Time `json:"timestamp,omitempty"` +} + +type _UnauthorizedErrorResponse UnauthorizedErrorResponse + +// NewUnauthorizedErrorResponse instantiates a new UnauthorizedErrorResponse object +// This constructor will assign default values to properties that have it defined, +// and makes sure properties required by API are set, but the set of arguments +// will change when the set of required properties is changed +func NewUnauthorizedErrorResponse(message string) *UnauthorizedErrorResponse { + this := UnauthorizedErrorResponse{} + this.Message = message + return &this +} + +// NewUnauthorizedErrorResponseWithDefaults instantiates a new UnauthorizedErrorResponse object +// This constructor will only assign default values to properties that have it defined, +// but it doesn't guarantee that properties required by API are set +func NewUnauthorizedErrorResponseWithDefaults() *UnauthorizedErrorResponse { + this := UnauthorizedErrorResponse{} + return &this +} + +// GetError returns the Error field value if set, zero value otherwise. +func (o *UnauthorizedErrorResponse) GetError() string { + if o == nil || IsNil(o.Error) { + var ret string + return ret + } + return *o.Error +} + +// GetErrorOk returns a tuple with the Error field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UnauthorizedErrorResponse) GetErrorOk() (*string, bool) { + if o == nil || IsNil(o.Error) { + return nil, false + } + return o.Error, true +} + +// HasError returns a boolean if a field has been set. +func (o *UnauthorizedErrorResponse) HasError() bool { + if o != nil && !IsNil(o.Error) { + return true + } + + return false +} + +// SetError gets a reference to the given string and assigns it to the Error field. +func (o *UnauthorizedErrorResponse) SetError(v string) { + o.Error = &v +} + +// GetMessage returns the Message field value +func (o *UnauthorizedErrorResponse) GetMessage() string { + if o == nil { + var ret string + return ret + } + + return o.Message +} + +// GetMessageOk returns a tuple with the Message field value +// and a boolean to check if the value has been set. +func (o *UnauthorizedErrorResponse) GetMessageOk() (*string, bool) { + if o == nil { + return nil, false + } + return &o.Message, true +} + +// SetMessage sets field value +func (o *UnauthorizedErrorResponse) SetMessage(v string) { + o.Message = v +} + +// GetPath returns the Path field value if set, zero value otherwise. +func (o *UnauthorizedErrorResponse) GetPath() string { + if o == nil || IsNil(o.Path) { + var ret string + return ret + } + return *o.Path +} + +// GetPathOk returns a tuple with the Path field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UnauthorizedErrorResponse) GetPathOk() (*string, bool) { + if o == nil || IsNil(o.Path) { + return nil, false + } + return o.Path, true +} + +// HasPath returns a boolean if a field has been set. +func (o *UnauthorizedErrorResponse) HasPath() bool { + if o != nil && !IsNil(o.Path) { + return true + } + + return false +} + +// SetPath gets a reference to the given string and assigns it to the Path field. +func (o *UnauthorizedErrorResponse) SetPath(v string) { + o.Path = &v +} + +// GetStatus returns the Status field value if set, zero value otherwise. +func (o *UnauthorizedErrorResponse) GetStatus() int32 { + if o == nil || IsNil(o.Status) { + var ret int32 + return ret + } + return *o.Status +} + +// GetStatusOk returns a tuple with the Status field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UnauthorizedErrorResponse) GetStatusOk() (*int32, bool) { + if o == nil || IsNil(o.Status) { + return nil, false + } + return o.Status, true +} + +// HasStatus returns a boolean if a field has been set. +func (o *UnauthorizedErrorResponse) HasStatus() bool { + if o != nil && !IsNil(o.Status) { + return true + } + + return false +} + +// SetStatus gets a reference to the given int32 and assigns it to the Status field. +func (o *UnauthorizedErrorResponse) SetStatus(v int32) { + o.Status = &v +} + +// GetTimestamp returns the Timestamp field value if set, zero value otherwise. +func (o *UnauthorizedErrorResponse) GetTimestamp() time.Time { + if o == nil || IsNil(o.Timestamp) { + var ret time.Time + return ret + } + return *o.Timestamp +} + +// GetTimestampOk returns a tuple with the Timestamp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *UnauthorizedErrorResponse) GetTimestampOk() (*time.Time, bool) { + if o == nil || IsNil(o.Timestamp) { + return nil, false + } + return o.Timestamp, true +} + +// HasTimestamp returns a boolean if a field has been set. +func (o *UnauthorizedErrorResponse) HasTimestamp() bool { + if o != nil && !IsNil(o.Timestamp) { + return true + } + + return false +} + +// SetTimestamp gets a reference to the given time.Time and assigns it to the Timestamp field. +func (o *UnauthorizedErrorResponse) SetTimestamp(v time.Time) { + o.Timestamp = &v +} + +func (o UnauthorizedErrorResponse) MarshalJSON() ([]byte, error) { + toSerialize, err := o.ToMap() + if err != nil { + return []byte{}, err + } + return json.Marshal(toSerialize) +} + +func (o UnauthorizedErrorResponse) ToMap() (map[string]interface{}, error) { + toSerialize := map[string]interface{}{} + if !IsNil(o.Error) { + toSerialize["error"] = o.Error + } + toSerialize["message"] = o.Message + if !IsNil(o.Path) { + toSerialize["path"] = o.Path + } + if !IsNil(o.Status) { + toSerialize["status"] = o.Status + } + if !IsNil(o.Timestamp) { + toSerialize["timestamp"] = o.Timestamp + } + return toSerialize, nil +} + +func (o *UnauthorizedErrorResponse) UnmarshalJSON(data []byte) (err error) { + // This validates that all required properties are included in the JSON object + // by unmarshalling the object into a generic map with string keys and checking + // that every required field exists as a key in the generic map. + requiredProperties := []string{ + "message", + } + + allProperties := make(map[string]interface{}) + + err = json.Unmarshal(data, &allProperties) + + if err != nil { + return err + } + + for _, requiredProperty := range requiredProperties { + if _, exists := allProperties[requiredProperty]; !exists { + return fmt.Errorf("no value given for required property %v", requiredProperty) + } + } + + varUnauthorizedErrorResponse := _UnauthorizedErrorResponse{} + + decoder := json.NewDecoder(bytes.NewReader(data)) + decoder.DisallowUnknownFields() + err = decoder.Decode(&varUnauthorizedErrorResponse) + + if err != nil { + return err + } + + *o = UnauthorizedErrorResponse(varUnauthorizedErrorResponse) + + return err +} + +type NullableUnauthorizedErrorResponse struct { + value *UnauthorizedErrorResponse + isSet bool +} + +func (v NullableUnauthorizedErrorResponse) Get() *UnauthorizedErrorResponse { + return v.value +} + +func (v *NullableUnauthorizedErrorResponse) Set(val *UnauthorizedErrorResponse) { + v.value = val + v.isSet = true +} + +func (v NullableUnauthorizedErrorResponse) IsSet() bool { + return v.isSet +} + +func (v *NullableUnauthorizedErrorResponse) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableUnauthorizedErrorResponse(val *UnauthorizedErrorResponse) *NullableUnauthorizedErrorResponse { + return &NullableUnauthorizedErrorResponse{value: val, isSet: true} +} + +func (v NullableUnauthorizedErrorResponse) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableUnauthorizedErrorResponse) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} diff --git a/services/git/v1betaapi/response.go b/services/git/v1betaapi/response.go new file mode 100644 index 000000000..f8322c410 --- /dev/null +++ b/services/git/v1betaapi/response.go @@ -0,0 +1,48 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "net/http" +) + +// APIResponse stores the API response returned by the server. +type APIResponse struct { + *http.Response `json:"-"` + Message string `json:"message,omitempty"` + // Operation is the name of the OpenAPI operation. + Operation string `json:"operation,omitempty"` + // RequestURL is the request URL. This value is always available, even if the + // embedded *http.Response is nil. + RequestURL string `json:"url,omitempty"` + // Method is the HTTP method used for the request. This value is always + // available, even if the embedded *http.Response is nil. + Method string `json:"method,omitempty"` + // Payload holds the contents of the response body (which may be nil or empty). + // This is provided here as the raw response.Body() reader will have already + // been drained. + Payload []byte `json:"-"` +} + +// NewAPIResponse returns a new APIResponse object. +func NewAPIResponse(r *http.Response) *APIResponse { + + response := &APIResponse{Response: r} + return response +} + +// NewAPIResponseWithError returns a new APIResponse object with the provided error message. +func NewAPIResponseWithError(errorMessage string) *APIResponse { + + response := &APIResponse{Message: errorMessage} + return response +} diff --git a/services/git/v1betaapi/utils.go b/services/git/v1betaapi/utils.go new file mode 100644 index 000000000..0237b6ba5 --- /dev/null +++ b/services/git/v1betaapi/utils.go @@ -0,0 +1,362 @@ +/* +STACKIT Git API + +STACKIT Git management API. + +API version: 1beta.0.4 +Contact: git@stackit.cloud +*/ + +// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. + +package v1betaapi + +import ( + "bytes" + "encoding/json" + "fmt" + "reflect" + "time" +) + +// PtrBool is a helper routine that returns a pointer to given boolean value. +func PtrBool(v bool) *bool { return &v } + +// PtrInt is a helper routine that returns a pointer to given integer value. +func PtrInt(v int) *int { return &v } + +// PtrInt32 is a helper routine that returns a pointer to given integer value. +func PtrInt32(v int32) *int32 { return &v } + +// PtrInt64 is a helper routine that returns a pointer to given integer value. +func PtrInt64(v int64) *int64 { return &v } + +// PtrFloat32 is a helper routine that returns a pointer to given float value. +func PtrFloat32(v float32) *float32 { return &v } + +// PtrFloat64 is a helper routine that returns a pointer to given float value. +func PtrFloat64(v float64) *float64 { return &v } + +// PtrString is a helper routine that returns a pointer to given string value. +func PtrString(v string) *string { return &v } + +// PtrTime is helper routine that returns a pointer to given Time value. +func PtrTime(v time.Time) *time.Time { return &v } + +type NullableBool struct { + value *bool + isSet bool +} + +func (v NullableBool) Get() *bool { + return v.value +} + +func (v *NullableBool) Set(val *bool) { + v.value = val + v.isSet = true +} + +func (v NullableBool) IsSet() bool { + return v.isSet +} + +func (v *NullableBool) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableBool(val *bool) *NullableBool { + return &NullableBool{value: val, isSet: true} +} + +func (v NullableBool) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableBool) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt struct { + value *int + isSet bool +} + +func (v NullableInt) Get() *int { + return v.value +} + +func (v *NullableInt) Set(val *int) { + v.value = val + v.isSet = true +} + +func (v NullableInt) IsSet() bool { + return v.isSet +} + +func (v *NullableInt) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt(val *int) *NullableInt { + return &NullableInt{value: val, isSet: true} +} + +func (v NullableInt) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt32 struct { + value *int32 + isSet bool +} + +func (v NullableInt32) Get() *int32 { + return v.value +} + +func (v *NullableInt32) Set(val *int32) { + v.value = val + v.isSet = true +} + +func (v NullableInt32) IsSet() bool { + return v.isSet +} + +func (v *NullableInt32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt32(val *int32) *NullableInt32 { + return &NullableInt32{value: val, isSet: true} +} + +func (v NullableInt32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableInt64 struct { + value *int64 + isSet bool +} + +func (v NullableInt64) Get() *int64 { + return v.value +} + +func (v *NullableInt64) Set(val *int64) { + v.value = val + v.isSet = true +} + +func (v NullableInt64) IsSet() bool { + return v.isSet +} + +func (v *NullableInt64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableInt64(val *int64) *NullableInt64 { + return &NullableInt64{value: val, isSet: true} +} + +func (v NullableInt64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableInt64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat32 struct { + value *float32 + isSet bool +} + +func (v NullableFloat32) Get() *float32 { + return v.value +} + +func (v *NullableFloat32) Set(val *float32) { + v.value = val + v.isSet = true +} + +func (v NullableFloat32) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat32) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat32(val *float32) *NullableFloat32 { + return &NullableFloat32{value: val, isSet: true} +} + +func (v NullableFloat32) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat32) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableFloat64 struct { + value *float64 + isSet bool +} + +func (v NullableFloat64) Get() *float64 { + return v.value +} + +func (v *NullableFloat64) Set(val *float64) { + v.value = val + v.isSet = true +} + +func (v NullableFloat64) IsSet() bool { + return v.isSet +} + +func (v *NullableFloat64) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableFloat64(val *float64) *NullableFloat64 { + return &NullableFloat64{value: val, isSet: true} +} + +func (v NullableFloat64) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableFloat64) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableString struct { + value *string + isSet bool +} + +func (v NullableString) Get() *string { + return v.value +} + +func (v *NullableString) Set(val *string) { + v.value = val + v.isSet = true +} + +func (v NullableString) IsSet() bool { + return v.isSet +} + +func (v *NullableString) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableString(val *string) *NullableString { + return &NullableString{value: val, isSet: true} +} + +func (v NullableString) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableString) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +type NullableTime struct { + value *time.Time + isSet bool +} + +func (v NullableTime) Get() *time.Time { + return v.value +} + +func (v *NullableTime) Set(val *time.Time) { + v.value = val + v.isSet = true +} + +func (v NullableTime) IsSet() bool { + return v.isSet +} + +func (v *NullableTime) Unset() { + v.value = nil + v.isSet = false +} + +func NewNullableTime(val *time.Time) *NullableTime { + return &NullableTime{value: val, isSet: true} +} + +func (v NullableTime) MarshalJSON() ([]byte, error) { + return json.Marshal(v.value) +} + +func (v *NullableTime) UnmarshalJSON(src []byte) error { + v.isSet = true + return json.Unmarshal(src, &v.value) +} + +// IsNil checks if an input is nil +func IsNil(i interface{}) bool { + if i == nil { + return true + } + switch reflect.TypeOf(i).Kind() { + case reflect.Chan, reflect.Func, reflect.Map, reflect.Ptr, reflect.UnsafePointer, reflect.Interface, reflect.Slice: + return reflect.ValueOf(i).IsNil() + case reflect.Array: + return reflect.ValueOf(i).IsZero() + } + return false +} + +type MappedNullable interface { + ToMap() (map[string]interface{}, error) +} + +// A wrapper for strict JSON decoding +func newStrictDecoder(data []byte) *json.Decoder { + dec := json.NewDecoder(bytes.NewBuffer(data)) + dec.DisallowUnknownFields() + return dec +} + +// Prevent trying to import "fmt" +func reportError(format string, a ...interface{}) error { + return fmt.Errorf(format, a...) +} diff --git a/services/git/wait/deprecation.go b/services/git/wait/deprecation.go new file mode 100644 index 000000000..58f184c09 --- /dev/null +++ b/services/git/wait/deprecation.go @@ -0,0 +1,2 @@ +// Deprecated: Will be removed after 2026-09-30. Move to the packages generated for each available API version instead +package wait